Skip to content

Commit 51b27c5

Browse files
authored
Merge pull request #27 from comp-physics/refactor-2
2 parents 730f530 + 5daf775 commit 51b27c5

File tree

65 files changed

+6463
-17984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+6463
-17984
lines changed

.claude/rules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If terminal execution is unavailable or blocked by approvals, ask for approval o
1919

2020
The project has a gold-standard validation suite that rigorously verifies the Navier-Stokes solver:
2121

22-
#### Core Tests (tests/test_physics_validation.cpp) - ~2 min on GPU:
22+
#### Core Tests (tests/test_physics_validation_advanced.cpp) - ~2 min on GPU:
2323

2424
1. Poiseuille Flow (Analytical)
2525
- Tests: Viscous terms, pressure gradient, parabolic profile
@@ -50,7 +50,7 @@ The project has a gold-standard validation suite that rigorously verifies the Na
5050
- Tests: No NaN/Inf, realizability (ν_t >= 0)
5151
- Validates: Numerical stability
5252

53-
#### Advanced Validation (tests/test_tg_validation.cpp) - ~30 sec:
53+
#### Taylor-Green Validation (in tests/test_physics_validation_advanced.cpp):
5454

5555
Taylor-Green Vortex Test
5656
- Initial: u=sin(x)cos(y), v=-cos(x)sin(y) (divergence-free)

.cursorrules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
The project has a **gold-standard validation suite** that rigorously verifies the Navier-Stokes solver:
88

9-
#### Core Tests (`tests/test_physics_validation.cpp`) - ~2 min on GPU:
9+
#### Core Tests (`tests/test_physics_validation_advanced.cpp`) - ~2 min on GPU:
1010

1111
1. **Poiseuille Flow (Analytical)**
1212
- Tests: Viscous terms, pressure gradient, parabolic profile
@@ -37,7 +37,7 @@ The project has a **gold-standard validation suite** that rigorously verifies th
3737
- Tests: No NaN/Inf, realizability (ν_t ≥ 0)
3838
- Validates: Numerical stability
3939

40-
#### Advanced Validation (`tests/test_tg_validation.cpp`) - ~30 sec:
40+
#### Taylor-Green Validation (in `tests/test_physics_validation_advanced.cpp`):
4141

4242
**Taylor-Green Vortex Test**
4343
- Initial: u=sin(x)cos(y), v=-cos(x)sin(y) (divergence-free)

.github/scripts/compare_cpu_gpu_builds.sh

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,8 @@ mkdir -p cpu_gpu_comparison
3333
echo "[FAIL] Bitwise CPU reference generation failed!"
3434
exit 1
3535
}
36-
./test_poisson_cpu_gpu_3d --dump-prefix cpu_gpu_comparison/poisson3d || {
37-
echo "[FAIL] Poisson 3D CPU reference generation failed!"
38-
exit 1
39-
}
40-
./test_cpu_gpu_consistency --dump-prefix cpu_gpu_comparison/consistency || {
41-
echo "[FAIL] Consistency CPU reference generation failed!"
42-
exit 1
43-
}
44-
./test_solver_cpu_gpu --dump-prefix cpu_gpu_comparison/solver || {
45-
echo "[FAIL] Solver CPU reference generation failed!"
46-
exit 1
47-
}
48-
./test_time_history_consistency --dump-prefix cpu_gpu_comparison/timehistory || {
49-
echo "[FAIL] Time-history CPU reference generation failed!"
50-
exit 1
51-
}
36+
# Note: test_cpu_gpu_consistency, test_solver_cpu_gpu, test_time_history_consistency
37+
# were consolidated into test_cpu_gpu_unified (runs within single-build, not cross-build)
5238

5339
echo ""
5440
echo "--- Step 2: Run GPU and compare against CPU reference ---"
@@ -74,22 +60,7 @@ fi
7460
echo "[FAIL] Bitwise GPU vs CPU comparison failed!"
7561
exit 1
7662
}
77-
./test_poisson_cpu_gpu_3d --compare-prefix "$WORKDIR/build_ci_cpu_ref/cpu_gpu_comparison/poisson3d" || {
78-
echo "[FAIL] Poisson 3D GPU vs CPU comparison failed!"
79-
exit 1
80-
}
81-
./test_cpu_gpu_consistency --compare-prefix "$WORKDIR/build_ci_cpu_ref/cpu_gpu_comparison/consistency" || {
82-
echo "[FAIL] Consistency GPU vs CPU comparison failed!"
83-
exit 1
84-
}
85-
./test_solver_cpu_gpu --compare-prefix "$WORKDIR/build_ci_cpu_ref/cpu_gpu_comparison/solver" || {
86-
echo "[FAIL] Solver GPU vs CPU comparison failed!"
87-
exit 1
88-
}
89-
./test_time_history_consistency --compare-prefix "$WORKDIR/build_ci_cpu_ref/cpu_gpu_comparison/timehistory" || {
90-
echo "[FAIL] Time-history GPU vs CPU comparison failed!"
91-
exit 1
92-
}
63+
# Note: Additional consistency tests consolidated into test_cpu_gpu_unified (single-build)
9364

9465
echo ""
9566
echo "[PASS] CPU-only vs GPU-offload comparison completed successfully"

.github/scripts/cpu_sanity_suite.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,8 @@ run_test "3D Gradients" "./test_3d_gradients" 60
110110
# Poisson solver tests
111111
echo ""
112112
echo "--- Poisson Solver Tests ---"
113-
run_test "Poisson Selection" "./test_poisson_selection" 60
113+
run_test "Poisson Unified" "./test_poisson_unified" 180
114114
run_test "Residual Consistency" "./test_residual_consistency" 120
115-
run_test "Poisson Nullspace" "./test_poisson_nullspace" 120
116115

117116
# MPI guard test
118117
echo ""

.github/scripts/gpu_correctness_suite.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ echo "==================================================================="
110110
echo " 6. CPU/GPU Consistency Validation (Critical)"
111111
echo "==================================================================="
112112
echo ""
113-
./test_cpu_gpu_consistency
113+
./test_cpu_gpu_unified
114114

115115
echo ""
116116
echo "==================================================================="
@@ -125,8 +125,7 @@ echo "==================================================================="
125125
echo " 8. Physics Validation (Comprehensive)"
126126
echo "==================================================================="
127127
echo ""
128-
./test_physics_validation
129-
./test_tg_validation
128+
./test_physics_validation_advanced
130129

131130
echo ""
132131
echo "==================================================================="

0 commit comments

Comments
 (0)