Skip to content

Commit 5981723

Browse files
author
shijiashuai
committed
refactor: comprehensive project cleanup and normalization
## Version - Sync version to 2.1.0 across CMakeLists.txt and openspec.yaml ## Code Changes - Remove dead code (empty src/core/force_calculator.cpp) - Fix CUDA stack overflow risk (STACK_SIZE: 128 → 256) ## Documentation - Consolidate changelog/ directory into single CHANGELOG.md - Fix duplicate links in docs/zh-CN/README.md - Remove QWEN.md and FINAL_CHECKLIST.md (obsolete) - Archive legacy specs to specs-archived/ ## CI/CD Optimization - Add paths filtering for pull_request events in ci.yml - Optimize pages.yml paths (remove '**.md' wildcard) - Reduce fetch-depth from 0 to 1 in pages.yml - Simplify docs-consistency job in ci.yml ## Configuration - Fix CODEOWNERS case sensitivity (@LessUp@LessUp) - Add .omc/ to .gitignore
1 parent a4f3ebb commit 5981723

31 files changed

Lines changed: 243 additions & 2161 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/CMakeLists.txt @LessUp
2020

2121
# Documentation
22-
/docs/ @Lessup
22+
/docs/ @LessUp
2323
/README.md @LessUp
2424
/README.zh-CN.md @LessUp
2525
/CHANGELOG.md @LessUp

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- Treat `openspec/specs/` as the only active specification source.
66
- Use or update an OpenSpec change before implementing behavior, workflow, documentation-policy, automation, or structure changes.
7-
- Ignore `specs-legacy/` for active development.
7+
- Ignore `specs-archived/` for active development.
88
- Prefer deleting or consolidating duplicate docs instead of keeping mirrored content.
99

1010
## Current Project Priorities

.github/project-status.md

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,45 @@
1-
# Project Status: Closeout Phase
1+
# Project Status: Closeout Phase Complete
22

33
## Current State
44

5-
This project is in **closeout and maintenance** phase. All core features are complete and stable.
5+
This project is in **final closeout phase**. All core features are complete and stable. The repository has been comprehensively stabilized for maintenance and archival readiness.
66

77
### Last Major Release
88
- **Version**: v2.0.0 (2026-03-13)
99
- **Status**: Stable
10-
- **Next Phase**: Archive-ready
10+
- **Phase**: Archive-ready
1111

1212
---
1313

14-
## Repository Status Checklist
14+
## Repository Health Metrics
15+
16+
| Metric | Value | Status |
17+
|--------|-------|--------|
18+
| Total Commits | 43+ | ✅ Clear history |
19+
| Markdown Files | ~80 | ✅ Curated, no duplicates |
20+
| C++ Source Files | 16 | ✅ Stable codebase |
21+
| CUDA Source Files | 5 | ✅ GPU kernels |
22+
| AI Instruction Files | 3 aligned | ✅ Single source |
23+
| OpenSpec Capabilities | 6 registered | ✅ Complete registry |
24+
| Build Configurations | CPU + GPU | ✅ Flexible |
25+
26+
---
27+
28+
## Closeout Checklist
1529

1630
### ✅ OpenSpec Governance
1731
- [x] Unified `openspec/` as single source of truth
1832
- [x] All bilingual specifications in parity
1933
- [x] Clear capability registration in `openspec.yaml`
20-
- [x] All legacy specs marked as historical-only
34+
- [x] Legacy specs archived to `specs-archived/` with historical markers
2135

2236
### ✅ Documentation
2337
- [x] README.md focused on value and canonical links
24-
- [x] AGENTS.md streamlined to 60 lines
38+
- [x] AGENTS.md streamlined to 68 lines
2539
- [x] CLAUDE.md created with Claude-specific guidance
2640
- [x] .github/copilot-instructions.md for Copilot
2741
- [x] CONTRIBUTING.md aligned to OpenSpec workflow
28-
- [x] Stale docs (QWEN.md, etc.) updated to stubs
42+
- [x] Stale docs and duplicates removed
2943
- [x] Changelog consolidated to canonical directory
3044

3145
### ✅ Build System
@@ -48,12 +62,48 @@ This project is in **closeout and maintenance** phase. All core features are com
4862
- [x] Workflows simplified and noise-reduced
4963

5064
### ✅ GitHub Presentation
51-
- [x] Description: "High-performance N-body particle simulation..."
65+
- [x] Description: "High-performance N-body particle simulation with Barnes-Hut algorithm, GPU acceleration, and real-time visualization"
5266
- [x] Homepage: https://lessup.github.io/n-body/
5367
- [x] Topics: n-body-simulation, cuda, barnes-hut, gpu-acceleration, particle-physics
5468

5569
---
5670

71+
## Key Decisions & Rationale
72+
73+
1. **Keep unstaged work as baseline** ← Allows continuous progress without reverts
74+
2. **Single instruction source** ← Reduces maintenance burden of parallel guidance
75+
3. **CPU-first build validation** ← Supports diverse development environments
76+
4. **Minimal LSP stack** ← Avoids context-heavy MCP overhead; clangd is sufficient
77+
5. **Aggressive duplication removal** ← Sharper, more maintainable docs
78+
79+
---
80+
81+
## Files Changed Summary (Closeout Phase)
82+
83+
### Created (~35 files)
84+
- OpenSpec specs: `simulation-core.md`, `force-computation.md`, `visualization.md`, `simulation-control.md`, `quality-attributes.md`, `repository-governance.md` + Chinese versions
85+
- AI Instructions: `AGENTS.zh-CN.md`, `CLAUDE.md`, `.github/copilot-instructions.md`
86+
- Build & Tooling: `.vscode/settings.json`, `.vscode/extensions.json`, `.githooks/pre-commit`, `scripts/setup-hooks.sh`
87+
- Guidance: `.copilot-init.md`, `openspec/changes/archive/2026-04-23-project-closeout-stabilization/`
88+
- OpenSpec config: `openspec.yaml`
89+
90+
### Modified (~20 files)
91+
- `CMakeLists.txt` (added CUDA option, conditional builds)
92+
- `scripts/build.sh` (CUDA auto-detection)
93+
- `README.md`, `README.zh-CN.md` (complete rewrites)
94+
- `CONTRIBUTING.md` (4-principle restructure)
95+
- `.github/workflows/pages.yml` (simplified triggers)
96+
- `CHANGELOG.md` (consolidated to navigation)
97+
98+
### Deleted (~25 files)
99+
- `specs/` and `specs-legacy/` directories (consolidated to `specs-archived/`)
100+
- `docs/tutorials/README.md` and `docs/zh-CN/tutorials/README.md` (empty placeholders)
101+
- `FINAL_CHECKLIST.md` (merged into this file)
102+
- `QWEN.md` (compatibility stub)
103+
- Duplicate site content from legacy Jekyll
104+
105+
---
106+
57107
## Future Development (If Needed)
58108

59109
If further work is required, use the OpenSpec workflow:
@@ -94,5 +144,5 @@ If further work is required, use the OpenSpec workflow:
94144

95145
---
96146

97-
Last Updated: 2024-04-24
147+
Last Updated: 2026-04-27
98148
Status: ✅ Ready for Archive

.github/workflows/ci.yml

Lines changed: 24 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ on:
1313
- '.clang-format'
1414
pull_request:
1515
branches: [main, master]
16+
paths:
17+
- '**.cpp'
18+
- '**.cu'
19+
- '**.cuh'
20+
- '**.hpp'
21+
- 'CMakeLists.txt'
22+
- 'cmake/**'
23+
- '.clang-format'
1624
workflow_dispatch:
1725

1826
permissions:
@@ -75,66 +83,6 @@ jobs:
7583
- name: Checkout
7684
uses: actions/checkout@v4
7785

78-
- name: Verify executable name consistency
79-
run: |
80-
echo "Checking executable name consistency..."
81-
82-
# Check nbody_sim appears in key files
83-
if grep -rq 'nbody_sim' README.md README.zh-CN.md index.md docs/; then
84-
echo "✓ Executable name 'nbody_sim' found in documentation"
85-
else
86-
echo "⚠ Executable name 'nbody_sim' not found in some docs"
87-
fi
88-
89-
# Check CMakeLists.txt has correct target
90-
if grep -q 'add_executable(nbody_sim' CMakeLists.txt; then
91-
echo "✓ CMakeLists.txt defines 'nbody_sim' target"
92-
else
93-
echo "✗ CMakeLists.txt missing 'nbody_sim' target"
94-
exit 1
95-
fi
96-
97-
- name: Verify keyboard controls documentation
98-
run: |
99-
echo "Checking keyboard controls documentation..."
100-
101-
# Check controls are documented
102-
controls_found=0
103-
if grep -q 'Space' README.md; then
104-
echo "✓ Space key documented"
105-
controls_found=$((controls_found + 1))
106-
fi
107-
if grep -q 'Pause\|pause' README.md; then
108-
echo "✓ Pause action documented"
109-
controls_found=$((controls_found + 1))
110-
fi
111-
if grep -q 'Reset\|reset' README.md; then
112-
echo "✓ Reset action documented"
113-
controls_found=$((controls_found + 1))
114-
fi
115-
116-
if [ $controls_found -ge 2 ]; then
117-
echo "✓ Controls documentation check passed"
118-
else
119-
echo "⚠ Some controls may be missing"
120-
fi
121-
122-
- name: Verify test framework configuration
123-
run: |
124-
echo "Checking test framework configuration..."
125-
126-
if grep -q 'googletest' CMakeLists.txt || grep -q 'GoogleTest' CMakeLists.txt; then
127-
echo "✓ Google Test configured in CMakeLists.txt"
128-
else
129-
echo "⚠ Google Test may not be configured"
130-
fi
131-
132-
if grep -q 'rapidcheck' CMakeLists.txt || grep -q 'RapidCheck' CMakeLists.txt; then
133-
echo "✓ RapidCheck configured in CMakeLists.txt"
134-
else
135-
echo "⚠ RapidCheck may not be configured"
136-
fi
137-
13886
- name: Verify project structure
13987
run: |
14088
echo "Checking project structure..."
@@ -159,6 +107,22 @@ jobs:
159107
fi
160108
done
161109
110+
- name: Verify test framework configuration
111+
run: |
112+
echo "Checking test framework configuration..."
113+
114+
if grep -q 'googletest' CMakeLists.txt || grep -q 'GoogleTest' CMakeLists.txt; then
115+
echo "✓ Google Test configured in CMakeLists.txt"
116+
else
117+
echo "⚠ Google Test may not be configured"
118+
fi
119+
120+
if grep -q 'rapidcheck' CMakeLists.txt || grep -q 'RapidCheck' CMakeLists.txt; then
121+
echo "✓ RapidCheck configured in CMakeLists.txt"
122+
else
123+
echo "⚠ RapidCheck may not be configured"
124+
fi
125+
162126
- name: Summary
163127
run: |
164128
echo ""
@@ -183,68 +147,5 @@ jobs:
183147
globs: |
184148
*.md
185149
docs/**/*.md
186-
changelog/**/*.md
187150
examples/**/*.md
188151
189-
build-info:
190-
name: Build Information
191-
runs-on: ubuntu-latest
192-
needs: [format-check, docs-consistency]
193-
env:
194-
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
195-
steps:
196-
- name: Display build requirements
197-
run: |
198-
echo "# N-Body Simulation Build Requirements"
199-
echo ""
200-
echo "This project requires a CUDA-enabled environment for building."
201-
echo ""
202-
echo "## Hardware Requirements"
203-
echo ""
204-
echo "| Component | Minimum | Recommended |"
205-
echo "|-----------|---------|-------------|"
206-
echo "| GPU | NVIDIA CC 7.0+ | NVIDIA CC 8.0+ |"
207-
echo "| VRAM | 4GB | 8GB+ |"
208-
echo "| RAM | 8GB | 16GB+ |"
209-
echo ""
210-
echo "## Software Requirements"
211-
echo ""
212-
echo "| Component | Version |"
213-
echo "|-----------|---------|"
214-
echo "| CUDA Toolkit | 11.0+ |"
215-
echo "| CMake | 3.18+ |"
216-
echo "| OpenGL | 3.3+ |"
217-
echo "| GLFW | 3.3+ |"
218-
echo "| GLEW | 2.1+ |"
219-
echo "| GLM | 0.9.9+ |"
220-
echo ""
221-
echo "## Build Commands"
222-
echo ""
223-
echo '```bash'
224-
echo "# Clone repository"
225-
echo "git clone https://github.com/LessUp/n-body.git"
226-
echo "cd n-body"
227-
echo ""
228-
echo "# Build"
229-
echo "mkdir build && cd build"
230-
echo "cmake .. -DCMAKE_BUILD_TYPE=Release"
231-
echo "cmake --build . -j\$(nproc)"
232-
echo '```'
233-
echo ""
234-
echo "## Run Tests"
235-
echo ""
236-
echo '```bash'
237-
echo "ctest --output-on-failure"
238-
echo "./nbody_tests"
239-
echo '```'
240-
echo ""
241-
echo "## Run Simulation"
242-
echo ""
243-
echo '```bash'
244-
echo "./nbody_sim 10000 # 10K particles"
245-
echo "./nbody_sim 100000 # 100K particles"
246-
echo '```'
247-
echo ""
248-
echo "---"
249-
echo "CI validates formatting and documentation consistency."
250-
echo "For full build verification, use a local CUDA environment."

.github/workflows/pages.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66
paths:
77
- 'site/**'
88
- 'docs/**'
9-
- 'changelog/**'
10-
- 'examples/**'
11-
- '**.md'
9+
- 'README.md'
10+
- 'README.zh-CN.md'
11+
- 'CHANGELOG.md'
1212
- '.github/workflows/pages.yml'
1313
workflow_dispatch:
1414

@@ -29,7 +29,7 @@ jobs:
2929
- name: Checkout
3030
uses: actions/checkout@v4
3131
with:
32-
fetch-depth: 0
32+
fetch-depth: 1
3333

3434
- name: Setup Pages
3535
uses: actions/configure-pages@v5

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ __pycache__/
6868
.Python
6969
venv/
7070
.venv/
71+
72+
# AI tools
73+
.omc/

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Maintain and stabilize a CUDA/OpenGL N-body simulation project that is now in a
1111
| `openspec/specs/` | Active requirements and repository rules |
1212
| `openspec/changes/` | Active proposals, designs, delta specs, and task lists |
1313
| `openspec/changes/archive/` | Completed changes |
14-
| `specs-legacy/` | Historical-only material; never use as the active source of truth |
14+
| `specs-archived/` | Historical-only material; never use as the active source of truth |
1515
| `docs/` | Repository-local reader and contributor documentation |
1616
| `site/` | GitHub Pages showcase surface |
1717
| `.github/` | CI, Pages, issue/PR templates, and Copilot instructions |
@@ -37,6 +37,7 @@ Maintain and stabilize a CUDA/OpenGL N-body simulation project that is now in a
3737
## Project-Specific Rules
3838

3939
- Treat `openspec/` as the only active specification system.
40+
- Historical specs in `specs-archived/` are for reference only.
4041
- During the current cleanup effort, treat existing unstaged repository edits as the working baseline unless the user explicitly says otherwise.
4142
- Prefer deletion, consolidation, or redirection over keeping duplicate docs and site mirrors.
4243
- Do not add generic engineering or AI boilerplate; every file must be specific to this project.

AGENTS.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| `openspec/specs/` | 当前活跃需求与仓库规则 |
1212
| `openspec/changes/` | 活跃提案、设计、变更规格与任务清单 |
1313
| `openspec/changes/archive/` | 已完成变更 |
14-
| `specs-legacy/` | 仅供历史参考,绝不能作为当前事实来源 |
14+
| `specs-archived/` | 仅供历史参考,绝不能作为当前事实来源 |
1515
| `docs/` | 仓库内读者与贡献者文档 |
1616
| `site/` | GitHub Pages 展示表面 |
1717
| `.github/` | CI、Pages、Issue/PR 模板与 Copilot 指令 |
@@ -36,7 +36,7 @@
3636

3737
## 项目特定规则
3838

39-
-`openspec/` 视为唯一活跃规格系统。
39+
-`openspec/` 视为唯一活跃规格系统。历史规格在 `specs-archived/` 中仅供参考。
4040
- 在当前清理阶段,把仓库里现有未提交改动视为工作基线,除非用户明确要求其他处理方式。
4141
- 遇到重复文档或重复站点内容时,优先删除、合并或重定向,而不是继续并存。
4242
- 不要添加通用化、无项目针对性的工程文档或 AI 提示模板。

0 commit comments

Comments
 (0)