Skip to content

Commit 8ea6649

Browse files
waltsimsclaude
andcommitted
Clarify axisymmetric design and update testing strategy for 0.6.x
Phase 2.3: Explain axisymmetric as dimensionality reduction (not a separate solver), document the wrapper design, legacy AS/ASC mapping, and constraints (staggered grid, viscous absorption only). Testing Strategy: Add per-version test plans for 0.6.0-0.6.3 and cross-cutting backend parity tests. Documents existing infrastructure (66 MATLAB collectors, 12-job CI matrix). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fb9597e commit 8ea6649

1 file changed

Lines changed: 43 additions & 14 deletions

File tree

plans/release-strategy.md

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,28 @@ Port examples one at a time using MATLAB as ground truth — not old Python resu
193193

194194
**Goal:** Add axisymmetric simulation to `kspaceFirstOrder()` and port AS examples.
195195

196-
**Current state:** `kspaceFirstOrderAS.py` / `kspaceFirstOrderASC.py` are standalone entry points. New API hardcodes `axisymmetric_flag=0`.
196+
**What axisymmetric means:** Dimensionality reduction for problems with cylindrical symmetry. A 3D symmetric problem is simulated on a 2D (r, z) half-domain; a 2D symmetric problem on a 1D half-domain. Results are mirrored around the symmetry axis to reconstruct the full field.
197+
198+
**Current state:** `kspaceFirstOrderAS.py` / `kspaceFirstOrderASC.py` are standalone entry points using the legacy `kWaveSimulation` pipeline. The new API hardcodes `axisymmetric_flag=0`.
199+
200+
**Design:** Not a separate solver — a wrapper around `kspaceFirstOrder()` that:
201+
1. Takes `axisymmetric=True` kwarg
202+
2. Reduces the grid to a half-domain (y ≥ 0 = radial direction)
203+
3. Adds radial symmetry terms: special PML at axis (no absorption at y=0), expanded grid for FFT symmetries (WSWA: 4× radial, WSWS: 2×-2), radial coordinate vectors for geometric source terms
204+
4. Runs the lower-dimensional simulation via `Simulation`
205+
5. Mirrors results around the axis for output
206+
207+
**Legacy mapping:** `kspaceFirstOrderAS``kspaceFirstOrder(..., axisymmetric=True, backend="python")`, `kspaceFirstOrderASC``kspaceFirstOrder(..., axisymmetric=True, backend="cpp")`
208+
209+
**Constraints:** Staggered grid mandatory (`use_sg=True` enforced). Viscous absorption only (`alpha_power=2` fixed).
197210

198211
**Tasks:**
199212
1. Add `axisymmetric: bool = False` kwarg to `kspaceFirstOrder()`
200-
2. Implement radial symmetry terms in `Simulation` class (operates on (r, z) grid)
201-
3. Port `at_circular_piston_AS`, `at_focused_bowl_AS`
202-
4. Validate against MATLAB references
203-
5. Deprecate `kspaceFirstOrderAS` / `kspaceFirstOrderASC`
213+
2. Implement radial symmetry pre/post-processing in `kspaceFirstOrder()` (grid reduction, PML axis handling, result mirroring)
214+
3. Add radial terms to `Simulation` class (geometric source terms for (r, z) grid)
215+
4. Port `at_circular_piston_AS`, `at_focused_bowl_AS` using the v0.6.2 MATLAB-first workflow
216+
5. Validate against MATLAB references
217+
6. Deprecate `kspaceFirstOrderAS` / `kspaceFirstOrderASC`
204218

205219
---
206220

@@ -301,15 +315,30 @@ result = kspaceFirstOrder(kgrid, medium, source, sensor,
301315
## Testing Strategy
302316

303317
**Existing (keep):**
304-
- MATLAB reference tests via CI
305-
- Multi-platform pytest (Windows, Ubuntu, macOS)
306-
- Python 3.10-3.13 coverage
307-
308-
**Add:**
309-
- `tests/test_native_solver.py` - native vs C++ parity
310-
- `tests/test_unified_api.py` - new kwargs API
311-
- `tests/test_deprecation_warnings.py` - verify warnings emitted
312-
- `tests/test_backend_parity.py` - all backends produce same results
318+
- MATLAB reference tests via CI (66 MATLAB collectors → `.mat` fixtures, `scipy.io.loadmat`)
319+
- Multi-platform pytest (Windows, Ubuntu, macOS) × Python 3.10-3.13 (12-job matrix)
320+
- Integration tests in `tests/integration/` with `assert_fields_close()` (rtol=1e-10, atol=1e-12)
321+
- Weekly example runner (`run-examples.yml`, `KWAVE_FORCE_CPU=1`)
322+
323+
**v0.6.0 (done):**
324+
- `tests/test_native_solver.py` — 33 tests for Python backend
325+
- `tests/test_unified_api.py` — new kwargs API
326+
- `tests/test_compat.py``options_to_kwargs()` migration
327+
328+
**v0.6.1 (C-order migration):**
329+
- `tests/test_memory_layout.py` — C/F-order input produces identical results, `simulate_from_dicts` F→C→F round-trip, `cpp_simulation` writes correct F-order HDF5
330+
331+
**v0.6.2 (example migration):**
332+
- Per-example MATLAB reference integration tests — validate via k-wave-cupy interop first, then add `.mat` fixtures to `tests/integration/`
333+
- Each ported example gets a corresponding `test_<example_name>.py` with MATLAB reference comparison
334+
335+
**v0.6.3 (axisymmetric):**
336+
- Extend existing `test_ivp_axisymmetric_simulation.py` to use new `kspaceFirstOrder(..., axisymmetric=True)` API
337+
- New MATLAB reference tests for `at_circular_piston_AS`, `at_focused_bowl_AS`
338+
339+
**Cross-cutting:**
340+
- `tests/test_backend_parity.py` — Python vs C++ backends produce same results for shared test cases
341+
- `tests/test_deprecation_warnings.py` — verify FutureWarning emitted on legacy API calls
313342

314343
---
315344

0 commit comments

Comments
 (0)