22
33Thank you for considering contributing to go-webgpu! This document outlines the development workflow and guidelines.
44
5- ## Git Workflow (Git-Flow )
5+ ## Git Workflow (Pull Request )
66
7- This project uses Git-Flow branching model for development .
7+ All changes to ` main ` branch ** must ** go through Pull Requests. The ` main ` branch is protected .
88
99### Branch Structure
1010
1111```
12- main # Production-ready code (tagged releases)
13- └─ develop # Integration branch for next release
14- ├─ feature/* # New features
15- ├─ bugfix/* # Bug fixes
16- └─ hotfix/* # Critical fixes from main
12+ main # Protected. Production-ready code (tagged releases)
13+ ├─ feat/* # New features
14+ ├─ fix/* # Bug fixes
15+ ├─ deps/* # Dependency updates
16+ ├─ docs/* # Documentation
17+ └─ hotfix/* # Critical fixes
1718```
1819
19- ### Branch Purposes
20+ ### Branch Protection
2021
21- - ** main** : Production-ready code. Only releases are merged here.
22- - ** develop** : Active development branch. All features merge here first.
23- - ** feature/\* ** : New features. Branch from ` develop ` , merge back to ` develop ` .
24- - ** bugfix/\* ** : Bug fixes. Branch from ` develop ` , merge back to ` develop ` .
25- - ** hotfix/\* ** : Critical production fixes. Branch from ` main ` , merge to both ` main ` and ` develop ` .
22+ - ** main** is protected — no direct pushes allowed
23+ - All changes require a Pull Request
24+ - Admins can bypass protection for emergency fixes
2625
2726### Workflow Commands
2827
2928#### Starting a New Feature
3029
3130``` bash
32- # Create feature branch from develop
33- git checkout develop
34- git pull origin develop
35- git checkout -b feature /my-new-feature
31+ # Create feature branch from main
32+ git checkout main
33+ git pull origin main
34+ git checkout -b feat /my-new-feature
3635
3736# Work on your feature...
3837git add .
3938git commit -m " feat: add my new feature"
4039
41- # When done, merge back to develop
42- git checkout develop
43- git merge --squash feature/my-new-feature
44- git commit -m " feat: my new feature"
45- git branch -d feature/my-new-feature
46- git push origin develop
40+ # Push branch and create PR
41+ git push -u origin feat/my-new-feature
42+ gh pr create --title " feat: add my new feature" --body " Description..."
43+
44+ # After PR is merged, clean up
45+ git checkout main
46+ git pull origin main
47+ git branch -d feat/my-new-feature
4748```
4849
4950#### Fixing a Bug
5051
5152``` bash
52- # Create bugfix branch from develop
53- git checkout develop
54- git pull origin develop
55- git checkout -b bugfix/ fix- issue-123
53+ # Create fix branch from main
54+ git checkout main
55+ git pull origin main
56+ git checkout -b fix/ issue-123
5657
5758# Fix the bug...
5859git add .
5960git commit -m " fix: resolve issue #123"
6061
61- # Merge back to develop
62- git checkout develop
63- git merge --squash bugfix/fix-issue-123
64- git commit -m " fix: resolve issue #123"
65- git branch -d bugfix/fix-issue-123
66- git push origin develop
62+ # Push and create PR
63+ git push -u origin fix/issue-123
64+ gh pr create --title " fix: resolve issue #123" --body " Closes #123"
6765```
6866
6967#### Creating a Release
7068
7169``` bash
72- # Create release branch from develop
73- git checkout develop
74- git pull origin develop
75- git checkout -b release/v0.2.0
76-
77- # Update version numbers, CHANGELOG, etc.
78- git add .
79- git commit -m " chore: prepare release v0.2.0"
80-
81- # Merge to main and tag
70+ # After PR is merged, create release from main
8271git checkout main
83- git merge --no-ff release/v0.2.0
84- git tag -a v0.2.0 -m " Release v0.2.0"
72+ git pull origin main
8573
86- # Merge back to develop
87- git checkout develop
88- git merge --no-ff release/v0.2.0
89-
90- # Delete release branch
91- git branch -d release/v0.2.0
92-
93- # Push everything
94- git push origin main develop --tags
74+ # Create tag and release
75+ git tag -a v0.2.0 -m " Release v0.2.0"
76+ git push origin v0.2.0
77+ gh release create v0.2.0 --title " v0.2.0" --notes " Release notes..."
9578```
9679
9780## Commit Message Guidelines
@@ -111,10 +94,11 @@ Follow [Conventional Commits](https://www.conventionalcommits.org/) specificatio
11194- ** feat** : New feature
11295- ** fix** : Bug fix
11396- ** docs** : Documentation changes
97+ - ** deps** : Dependency updates
11498- ** style** : Code style changes (formatting, etc.)
11599- ** refactor** : Code refactoring
116100- ** test** : Adding or updating tests
117- - ** chore** : Maintenance tasks (build, dependencies , etc.)
101+ - ** chore** : Maintenance tasks (build, CI , etc.)
118102- ** perf** : Performance improvements
119103
120104### Examples
@@ -123,9 +107,10 @@ Follow [Conventional Commits](https://www.conventionalcommits.org/) specificatio
123107feat: add Texture3D support
124108fix: correct buffer mapping alignment
125109docs: update README with compute shader example
110+ deps: update goffi v0.3.1 → v0.3.3
126111refactor: simplify device creation flow
127112test: add render pipeline tests
128- chore: update wgpu-native to v24.0.1
113+ chore: update CI workflow
129114perf: optimize command encoder batch submission
130115```
131116
@@ -168,7 +153,7 @@ perf: optimize command encoder batch submission
168153
169154### Prerequisites
170155
171- - Go 1.21 or later
156+ - Go 1.25 or later
172157- golangci-lint v2
173158- wgpu-native shared libraries (download script provided)
174159
@@ -342,7 +327,7 @@ type CStruct struct {
342327
343328### macOS
344329- Uses goffi for pure-Go FFI (CGO_ENABLED=0)
345- - Currently x86_64 only (goffi ARM64 support pending )
330+ - Supports both x86_64 and ARM64 (Apple Silicon )
346331- Surface requires Metal layer
347332
348333## Getting Help
0 commit comments