Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.1] - 2024-12-24

### Changed

- **goffi:** v0.3.1 → v0.3.3 (PointerType argument passing hotfix)
- **golang.org/x/sys:** v0.38.0 → v0.39.0

### Fixed

- Critical bug in PointerType argument passing ([goffi#4](https://github.com/go-webgpu/goffi/issues/4))

### Infrastructure

- Branch protection enabled for `main`
- All changes now require Pull Requests
- Updated CONTRIBUTING.md with PR workflow

---

## [0.1.0] - 2024-11-28

### Added
Expand Down Expand Up @@ -70,4 +89,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Dependencies
- github.com/go-webgpu/goffi v0.3.1
- wgpu-native v24.0.0.2
- wgpu-native v24.0.3.1
101 changes: 43 additions & 58 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,96 +2,79 @@

Thank you for considering contributing to go-webgpu! This document outlines the development workflow and guidelines.

## Git Workflow (Git-Flow)
## Git Workflow (Pull Request)

This project uses Git-Flow branching model for development.
All changes to `main` branch **must** go through Pull Requests. The `main` branch is protected.

### Branch Structure

```
main # Production-ready code (tagged releases)
└─ develop # Integration branch for next release
├─ feature/* # New features
├─ bugfix/* # Bug fixes
└─ hotfix/* # Critical fixes from main
main # Protected. Production-ready code (tagged releases)
├─ feat/* # New features
├─ fix/* # Bug fixes
├─ deps/* # Dependency updates
├─ docs/* # Documentation
└─ hotfix/* # Critical fixes
```

### Branch Purposes
### Branch Protection

- **main**: Production-ready code. Only releases are merged here.
- **develop**: Active development branch. All features merge here first.
- **feature/\***: New features. Branch from `develop`, merge back to `develop`.
- **bugfix/\***: Bug fixes. Branch from `develop`, merge back to `develop`.
- **hotfix/\***: Critical production fixes. Branch from `main`, merge to both `main` and `develop`.
- **main** is protected — no direct pushes allowed
- All changes require a Pull Request
- Admins can bypass protection for emergency fixes

### Workflow Commands

#### Starting a New Feature

```bash
# Create feature branch from develop
git checkout develop
git pull origin develop
git checkout -b feature/my-new-feature
# Create feature branch from main
git checkout main
git pull origin main
git checkout -b feat/my-new-feature

# Work on your feature...
git add .
git commit -m "feat: add my new feature"

# When done, merge back to develop
git checkout develop
git merge --squash feature/my-new-feature
git commit -m "feat: my new feature"
git branch -d feature/my-new-feature
git push origin develop
# Push branch and create PR
git push -u origin feat/my-new-feature
gh pr create --title "feat: add my new feature" --body "Description..."

# After PR is merged, clean up
git checkout main
git pull origin main
git branch -d feat/my-new-feature
```

#### Fixing a Bug

```bash
# Create bugfix branch from develop
git checkout develop
git pull origin develop
git checkout -b bugfix/fix-issue-123
# Create fix branch from main
git checkout main
git pull origin main
git checkout -b fix/issue-123

# Fix the bug...
git add .
git commit -m "fix: resolve issue #123"

# Merge back to develop
git checkout develop
git merge --squash bugfix/fix-issue-123
git commit -m "fix: resolve issue #123"
git branch -d bugfix/fix-issue-123
git push origin develop
# Push and create PR
git push -u origin fix/issue-123
gh pr create --title "fix: resolve issue #123" --body "Closes #123"
```

#### Creating a Release

```bash
# Create release branch from develop
git checkout develop
git pull origin develop
git checkout -b release/v0.2.0

# Update version numbers, CHANGELOG, etc.
git add .
git commit -m "chore: prepare release v0.2.0"

# Merge to main and tag
# After PR is merged, create release from main
git checkout main
git merge --no-ff release/v0.2.0
git tag -a v0.2.0 -m "Release v0.2.0"
git pull origin main

# Merge back to develop
git checkout develop
git merge --no-ff release/v0.2.0

# Delete release branch
git branch -d release/v0.2.0

# Push everything
git push origin main develop --tags
# Create tag and release
git tag -a v0.2.0 -m "Release v0.2.0"
git push origin v0.2.0
gh release create v0.2.0 --title "v0.2.0" --notes "Release notes..."
```

## Commit Message Guidelines
Expand All @@ -111,10 +94,11 @@ Follow [Conventional Commits](https://www.conventionalcommits.org/) specificatio
- **feat**: New feature
- **fix**: Bug fix
- **docs**: Documentation changes
- **deps**: Dependency updates
- **style**: Code style changes (formatting, etc.)
- **refactor**: Code refactoring
- **test**: Adding or updating tests
- **chore**: Maintenance tasks (build, dependencies, etc.)
- **chore**: Maintenance tasks (build, CI, etc.)
- **perf**: Performance improvements

### Examples
Expand All @@ -123,9 +107,10 @@ Follow [Conventional Commits](https://www.conventionalcommits.org/) specificatio
feat: add Texture3D support
fix: correct buffer mapping alignment
docs: update README with compute shader example
deps: update goffi v0.3.1 → v0.3.3
refactor: simplify device creation flow
test: add render pipeline tests
chore: update wgpu-native to v24.0.1
chore: update CI workflow
perf: optimize command encoder batch submission
```

Expand Down Expand Up @@ -168,7 +153,7 @@ perf: optimize command encoder batch submission

### Prerequisites

- Go 1.21 or later
- Go 1.25 or later
- golangci-lint v2
- wgpu-native shared libraries (download script provided)

Expand Down Expand Up @@ -342,7 +327,7 @@ type CStruct struct {

### macOS
- Uses goffi for pure-Go FFI (CGO_ENABLED=0)
- Currently x86_64 only (goffi ARM64 support pending)
- Supports both x86_64 and ARM64 (Apple Silicon)
- Surface requires Metal layer

## Getting Help
Expand Down
19 changes: 10 additions & 9 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> **Strategic Focus**: Production-grade Zero-CGO WebGPU bindings for Go

**Last Updated**: 2024-11-28 | **Current Version**: v0.1.0 | **Target**: v1.0.0 stable
**Last Updated**: 2024-12-24 | **Current Version**: v0.1.1 | **Target**: v1.0.0 stable

---

Expand All @@ -12,12 +12,12 @@ Build **production-ready, cross-platform WebGPU bindings** for Go with zero CGO

### Current State vs Target

| Metric | Current (v0.1.0) | Target (v1.0.0) |
| Metric | Current (v0.1.1) | Target (v1.0.0) |
|--------|------------------|-----------------|
| Platforms | Windows, Linux, macOS (x64, arm64) | All major platforms |
| CGO Required | No (Zero-CGO) | No |
| API Coverage | ~80% WebGPU | 100% WebGPU |
| wgpu-native | v24.0.0.2 | Latest stable |
| wgpu-native | v24.0.3.1 | Latest stable |
| Test Coverage | ~70% | 90%+ |
| Examples | 11 | 20+ |

Expand All @@ -26,7 +26,7 @@ Build **production-ready, cross-platform WebGPU bindings** for Go with zero CGO
## Release Strategy

```
v0.1.0 (Current) -> Initial release with core features + ARM64
v0.1.1 (Current) -> Hotfix: goffi PointerType bug + PR workflow
|
v0.2.0 (Next) -> API improvements, builder patterns
|
Expand Down Expand Up @@ -157,7 +157,7 @@ v1.0.0 STABLE -> Production release with API stability guarantee

---

## Current Examples (v0.1.0)
## Current Examples (v0.1.x)

| Example | Features Demonstrated |
|---------|----------------------|
Expand All @@ -179,9 +179,9 @@ v1.0.0 STABLE -> Production release with API stability guarantee

| Dependency | Version | Purpose |
|------------|---------|---------|
| wgpu-native | v24.0.0.2 | WebGPU implementation |
| goffi | v0.3.1 | Pure-Go FFI (x64 + ARM64) |
| Go | 1.21+ | Language runtime |
| wgpu-native | v24.0.3.1 | WebGPU implementation |
| goffi | v0.3.3 | Pure-Go FFI (x64 + ARM64) |
| Go | 1.25+ | Language runtime |

### Upstream Tracking

Expand Down Expand Up @@ -215,8 +215,9 @@ Priority features are marked in GitHub Issues with labels:

| Version | Date | Type | Key Changes |
|---------|------|------|-------------|
| v0.1.1 | 2024-12-24 | Hotfix | goffi v0.3.3 (PointerType fix), PR workflow |
| v0.1.0 | 2024-11-28 | Initial | Core API, 11 examples, 5 platforms (x64 + ARM64) |

---

*Current: v0.1.0 | Next: v0.2.0 (API Improvements) | Target: v1.0.0 (Q4 2025)*
*Current: v0.1.1 | Next: v0.2.0 (API Improvements) | Target: v1.0.0 (Q4 2025)*
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module github.com/go-webgpu/webgpu

go 1.25

require github.com/go-webgpu/goffi v0.3.1
require github.com/go-webgpu/goffi v0.3.3

require golang.org/x/sys v0.38.0
require golang.org/x/sys v0.39.0
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/go-webgpu/goffi v0.3.1 h1:q1a7eG5gvMNbTOY8/YNGcBxyn5iVvtl9N8ifqJXiZRk=
github.com/go-webgpu/goffi v0.3.1/go.mod h1:wfoxNsJkU+5RFbV1kNN1kunhc1lFHuJKK3zpgx08/uM=
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
github.com/go-webgpu/goffi v0.3.3 h1:sK4nmMYZG6zLTMtSXD8rXlz0PnqZU4y4u0bqmZVEADk=
github.com/go-webgpu/goffi v0.3.3/go.mod h1:wfoxNsJkU+5RFbV1kNN1kunhc1lFHuJKK3zpgx08/uM=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=