Browse Source

update continue.md: add sim engine capability matrix and improved precalc guidance

- Add Sim Engine Capabilities section (Implemented / NOT Implemented)
- Update precalc scripts guidance: check capability matrix, always use local-frame values
- Update process per file: add pre-checks (TOML config exists, not already refactored, capability check)
- Add post-checks: verify no other tests broke, note missing sim_engine features
test-refactor
cinnaboot 2 months ago
parent
commit
e6b5da8b86
  1. 32
      continue.md

32
continue.md

@ -9,6 +9,24 @@
- Old configs in `old_tests/` use multiline inline tables (toml-c17 style) — keep for reference
- Python's `tomllib` requires single-line inline tables
## Sim Engine Capabilities
### Implemented
- Body propagation (elliptical + parabolic via Barker's equation)
- Orbital↔Cartesian transforms (full z-x-z Euler rotation)
- Velocity drift detection and element reconstruction
- Global coordinate computation (hierarchical parent→child)
- Spacecraft struct, loading, propagation
- Impulsive burns (prograde, retrograde, normal, antinormal, radial_in, radial_out, custom)
- TOML 1.0 config parsing
### NOT Implemented (notify the user before beginning to refactor)
- SOI transitions
- Maneuver trigger system (TRIGGER_TIME, TRIGGER_TRUE_ANOMALY)
- Hohmann transfer calculations
- Rendezvous planning
- OrbitTracker
- Energy functions (KE, PE, total)
- Hyperbolic propagation
## 1. Structure
- One `SCENARIO("description")` per logical test group, with `[tag1][tag2]` annotations
- Shared fixture: all constants, structs, and variables declared between `SCENARIO` opening and first `SECTION`
@ -28,19 +46,27 @@
## 4. Precalc scripts
- For each test file, create `scripts/precalc_<test_name>.py` that computes expected values.
- Use `scripts/sim_engine.py` for physics (orbital_to_cartesian, propagate, etc.).
- **Check the capability matrix first** — only use sim_engine.py for implemented features.
- **Always output local-frame values** (distances from parent, not global from origin).
- C++ tests typically use local coordinates (e.g., `vec3_distance(craft->local_position, (Vec3){0,0,0})`).
- Global distances are dominated by parent body positions (e.g., Earth-Sun distance swamps LEO orbit).
- Output C++-style comments with precalculated constants for embedding in the test.
- Run with: `python3 scripts/precalc_<test_name>.py`
- If sim_engine.py lacks a feature (e.g., spacecraft, OrbitTracker), use analytical formulas instead (**but notify the user what feature was missing**)
- If sim_engine.py lacks a feature, use analytical formulas instead (**but notify the user what feature was missing**)
## 5. Process per file
- **Pre-check**: Verify the test file has a TOML config in `old_tests/`. If it doesn't, skip — it's likely hardcoded.
- **Pre-check**: Check if the test is already in `tests/` (already refactored). Skip if so.
- **Pre-check**: Check the capability matrix — if the test needs SOI, maneuvers, rendezvous, etc., flag this before starting.
- Process **one test file at a time**.
- Create `scripts/precalc_<test_name>.py` and run it to get expected values.
- Copy from `old_tests/` to `tests/`, rewrite using the pattern from `test_true_anomaly_roundtrip.cpp`.
- Rewrite TOML configs to TOML 1.0 inline table syntax (single-line `{}`).
- Build and verify: `make test-build` then `./build/orbit_test '[tag]' -s`.
- Run full suite: `make test`.
- Replace broken tests (e.g., OrbitTracker bugs) with working alternatives using propagation checks.
- **Verify no other tests broke** — the new test shouldn't affect unrelated tests.
- Note any sim_engine.py features that were missing for this test (add to capability matrix if needed).
- notify the user about any broken tests (e.g., OrbitTracker bugs)
- **Always ask for review** before moving to the next file.
- **Only commit when asked.**

Loading…
Cancel
Save