{"id":48883543,"url":"https://github.com/lessup/webgpu-sorting","last_synced_at":"2026-04-21T21:00:47.303Z","repository":{"id":346090599,"uuid":"1127109471","full_name":"LessUp/webgpu-sorting","owner":"LessUp","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-16T03:01:59.000Z","size":183,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-16T04:11:30.350Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LessUp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-03T07:35:38.000Z","updated_at":"2026-04-16T03:02:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"19503536-181b-4cf0-80fe-faffec19ccd5","html_url":"https://github.com/LessUp/webgpu-sorting","commit_stats":null,"previous_names":["lessup/webgpu-sorting"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/LessUp/webgpu-sorting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LessUp%2Fwebgpu-sorting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LessUp%2Fwebgpu-sorting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LessUp%2Fwebgpu-sorting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LessUp%2Fwebgpu-sorting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LessUp","download_url":"https://codeload.github.com/LessUp/webgpu-sorting/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LessUp%2Fwebgpu-sorting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32110137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-16T04:05:26.492Z","updated_at":"2026-04-21T21:00:47.298Z","avatar_url":"https://github.com/LessUp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebGPU Sorting\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eHigh-Performance GPU Sorting Algorithms Using WebGPU Compute Shaders\u003c/strong\u003e\u003cbr/\u003e\n  \u003cstrong\u003e基于 WebGPU 计算着色器的高性能 GPU 排序算法\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/your-username/webgpu-sorting/actions\"\u003e\u003cimg src=\"https://img.shields.io/badge/CI-passing-brightgreen\" alt=\"CI Status\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/WebGPU-Compute-blue\" alt=\"WebGPU\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/WGSL-Shaders-green\" alt=\"WGSL\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/TypeScript-5.3-blue\" alt=\"TypeScript\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/tests-38%20passed-brightgreen\" alt=\"Tests\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-yellow\" alt=\"License\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"./docs/en/\"\u003eEnglish Documentation\u003c/a\u003e |\n  \u003ca href=\"./docs/zh/\"\u003e中文文档\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Overview | 项目简介\n\n### English\n\nWebGPU Sorting is a high-performance sorting library that leverages the WebGPU API to execute sorting algorithms on the GPU. It provides significant performance improvements over JavaScript's native `Array.sort()` for large datasets.\n\n**Key Features:**\n\n- **10-100x performance** improvement for large arrays\n- Two optimized algorithms: **Bitonic Sort** and **Radix Sort**\n- Clean TypeScript API with type safety\n- Comprehensive test coverage (38 tests)\n- Works in all WebGPU-enabled browsers\n\n### 中文\n\nWebGPU Sorting 是一个高性能排序库，利用 WebGPU API 在 GPU 上执行排序算法。对于大型数据集，它比 JavaScript 原生的 `Array.sort()` 提供显著的性能提升。\n\n**核心特性：**\n\n- 大型数组 **10-100 倍性能**提升\n- 两种优化算法：**双调排序**和**基数排序**\n- 类型安全的 TypeScript API\n- 全面的测试覆盖（38 个测试）\n- 支持所有 WebGPU 浏览器\n\n---\n\n## Algorithms | 算法\n\n| Algorithm        | Time Complexity | Space Complexity | Best For                       |\n| ---------------- | --------------- | ---------------- | ------------------------------ |\n| **Bitonic Sort** | O(n log²n)      | O(1) - in-place  | Medium arrays, general purpose |\n| **Radix Sort**   | O(n × k)        | O(n)             | Large arrays, 32-bit integers  |\n\n---\n\n## Quick Start | 快速开始\n\n### Installation | 安装\n\n```bash\n# Clone the repository\ngit clone https://github.com/your-username/webgpu-sorting.git\ncd webgpu-sorting\n\n# Install dependencies\nnpm install\n\n# Start development server\nnpm run dev\n```\n\n### Basic Usage | 基本用法\n\n```typescript\nimport { GPUContext, BitonicSorter, Validator } from './src';\n\nasync function main() {\n  // 1. Initialize WebGPU | 初始化 WebGPU\n  const context = new GPUContext();\n  await context.initialize();\n\n  // 2. Create sorter | 创建排序器\n  const sorter = new BitonicSorter(context);\n\n  // 3. Prepare data | 准备数据\n  const data = new Uint32Array([5, 2, 8, 1, 9, 3, 7, 4, 6, 0]);\n\n  // 4. Sort | 执行排序\n  const result = await sorter.sort(data);\n  console.log('Sorted:', result.sortedData); // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n\n  // 5. Validate | 验证结果\n  const validation = Validator.validate(data, result.sortedData);\n  console.log('Valid:', validation.isValid);\n\n  // 6. Cleanup | 清理资源\n  sorter.destroy();\n  context.destroy();\n}\n\nmain();\n```\n\n---\n\n## Performance | 性能\n\n### Benchmark Results | 基准测试结果\n\n| Array Size | JS Array.sort() | Bitonic Sort | Radix Sort | Speedup (Bitonic) | Speedup (Radix) |\n| ---------- | --------------- | ------------ | ---------- | ----------------- | --------------- |\n| 1K         | ~0.1ms          | ~0.5ms       | ~0.8ms     | 0.2x              | 0.1x            |\n| 10K        | ~1ms            | ~0.8ms       | ~1ms       | 1.3x              | 1.0x            |\n| 100K       | ~15ms           | ~2ms         | ~3ms       | **7.5x**          | **5.0x**        |\n| 1M         | ~200ms          | ~10ms        | ~15ms      | **20x**           | **13x**         |\n\n_Note: Results may vary based on GPU hardware and browser implementation._\n\n---\n\n## Documentation | 文档\n\n### English\n\n- [Getting Started](./docs/en/GETTING_STARTED.md) - Installation and first steps\n- [API Reference](./docs/en/API.md) - Complete API documentation\n- [Technical Details](./docs/en/TECHNICAL.md) - Architecture and algorithms\n\n### 中文\n\n- [入门指南](./docs/zh/GETTING_STARTED.md) - 安装和快速开始\n- [API 参考](./docs/zh/API.md) - 完整 API 文档\n- [技术文档](./docs/zh/TECHNICAL.md) - 架构和算法实现\n\n---\n\n## Browser Support | 浏览器支持\n\n| Browser | Version | Status             | Notes                       |\n| ------- | ------- | ------------------ | --------------------------- |\n| Chrome  | 113+    | ✅ Fully Supported | Recommended                 |\n| Edge    | 113+    | ✅ Fully Supported | Based on Chromium           |\n| Firefox | Nightly | ⚠️ Experimental    | Enable `dom.webgpu.enabled` |\n| Safari  | 18+     | ⚠️ Partial         | macOS 14+ required          |\n\n---\n\n## Project Structure | 项目结构\n\n```\nwebgpu-sorting/\n├── src/\n│   ├── core/                    # WebGPU core infrastructure\n│   ├── sorting/                 # Sorting algorithm implementations\n│   ├── shaders/                 # WGSL compute shaders\n│   ├── benchmark/               # Performance benchmarking\n│   └── types.ts                 # Type definitions\n├── docs/\n│   ├── en/                      # English documentation\n│   ├── zh/                      # Chinese documentation\n│   └── README.md                # Documentation index\n├── test/                        # Test suite (38 tests)\n├── examples/                    # Code examples\n├── index.html                   # Interactive demo\n└── package.json\n```\n\n---\n\n## Available Scripts | 可用脚本\n\n```bash\n# Development | 开发\nnpm run dev              # Start development server\n\n# Testing | 测试\nnpm test                 # Run all tests\nnpm run test:watch       # Run tests in watch mode\nnpm run test:coverage    # Generate coverage report\n\n# Linting | 代码检查\nnpm run lint             # Run ESLint\nnpm run lint:fix         # Fix ESLint issues\nnpm run format           # Format code with Prettier\n\n# Building | 构建\nnpm run build            # Build for production\nnpm run preview          # Preview production build\n```\n\n---\n\n## Contributing | 贡献\n\nWe welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.\n\n欢迎贡献！请参阅 [CONTRIBUTING.md](./CONTRIBUTING.md) 了解贡献指南。\n\n---\n\n## License | 许可证\n\n[MIT License](./LICENSE)\n\n---\n\n## Acknowledgments | 致谢\n\n- [WebGPU Specification](https://www.w3.org/TR/webgpu/) by W3C\n- [WebGPU Fundamentals](https://webgpufundamentals.org/) for tutorials\n- All contributors to this project\n\n---\n\n**Version**: 1.0.1  \n**Last Updated**: 2026-04-16\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flessup%2Fwebgpu-sorting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flessup%2Fwebgpu-sorting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flessup%2Fwebgpu-sorting/lists"}