Skip to content

Extend SIM_2_dyn_plus_STD Tier 3 coverage (calendar + scale-factor RUNs)#629

Merged
simnaut merged 2 commits into
mainfrom
sim2-dyn-plus-std
May 25, 2026
Merged

Extend SIM_2_dyn_plus_STD Tier 3 coverage (calendar + scale-factor RUNs)#629
simnaut merged 2 commits into
mainfrom
sim2-dyn-plus-std

Conversation

@simnaut
Copy link
Copy Markdown
Owner

@simnaut simnaut commented May 25, 2026

What

Extends Tier 3 time cross-validation for SIM_2_dyn_plus_STD (issue #99 Bucket B, previously "1 of 5 RUNs") from 1 to 3 covered RUNs.

RUN Init method Validated scales
RUN_initialize_by_value (existing) TAI by value (TJT=10000) TAI s, TAI TJT, DYN
RUN_initialize_by_calendar (new) TAI by calendar (2005-12-31 23:59:50), scale_factor=1 TAI s, TAI TJT, DYN
RUN_scale_factor_changes (new) TAI by calendar, then dyn_time.scale_factor reassigned mid-run (t=5 → -1.0, t=10 → 0.5, t=20 → -2.0) TAI s, TAI TJT, DYN

RUN_scale_factor_changes exercises JEOD TimeDyn::update_offset (offset = seconds − scale_factor·simtime) including a full time reversal, mirrored by astrodyn_time's DynamicTime::update_offset. The harness applies each scale change before the advance that leaves the read's sim time, matching JEOD's read-fires-before-next-update ordering row-for-row.

Out of scope

The remaining two RUNs — RUN_fail_dyn_initialized and RUN_fail_uninitialized — are JEOD negative tests (initialize-from-Dyn and uninitialized initializer, both designed to abort at init). They are not time-propagation runs, so they have no propagated time-scale output to cross-validate and are excluded from this time-scale verification family.

Capability check

Both new RUNs are expressible by SimulationTime as-is: set_scale_factor already wires JEOD's TimeDyn rate/direction/reversal behavior. No new physics or approximation was required.

How

  • Added both RUNs to the SIM_2 group in trick/generate_references.sh (reusing the TAI+Dyn DRAscii snippet).
  • Regenerated reference CSVs via cargo xtask regenerate-tier3 (Docker, incremental) and committed them.
  • Verified regenerated CSV headers carry the expected TAI TJT / TAI seconds / DYN seconds columns before writing assertions (DRAscii drop pitfall).

Tolerances (1.05× observed; matching existing SIM_2 bounds)

calendar:     26 points, TAI_tjt 6.29e-7 s, TAI_s 0, DYN 0
scale_factor: 26 points, TAI_tjt 4.71e-7 s, TAI_s 0, DYN 0

TAI TJT bounded at 1e-6 s (calendar→TJT rounding noise); TAI seconds and DYN are exact.

Verification

  • cargo nextest run -p astrodyn_verif_jeod -E 'test(tier3_time_v2)' — 3 passed
  • cargo fmt --check — clean
  • cargo clippy -p astrodyn_verif_jeod --tests -- -D warnings — clean

🤖 Generated with Claude Code

Issue #99 Bucket B SIM_2_dyn_plus_STD was "1 of 5 RUNs": only
RUN_initialize_by_value (init-by-value) was cross-validated. This adds
the two further portable RUNs:

  - RUN_initialize_by_calendar  — TAI init by calendar (2005-12-31
    23:59:50), scale_factor=1. Validates TAI seconds, TAI TJT, DYN.
  - RUN_scale_factor_changes    — TAI init by calendar, then
    dyn_time.scale_factor reassigned mid-run (t=5 -> -1.0, t=10 -> 0.5,
    t=20 -> -2.0), exercising JEOD TimeDyn::update_offset rate/direction
    changes incl. a full time reversal. Validates TAI seconds, TAI TJT,
    DYN.

Both RUNs are expressible by SimulationTime as-is (set_scale_factor wires
JEOD's TimeDyn offset/reversal behavior); no new physics needed. The two
RUN_fail_* runs are JEOD negative tests (init-from-Dyn / uninitialized,
designed to abort) — not propagation runs, so out of scope for a
time-scale cross-validation.

Added both RUNs to the SIM_2 group in trick/generate_references.sh
(reusing the TAI+Dyn DRAscii snippet), regenerated the reference CSVs,
and committed them. Observed maxima (tolerances at the existing SIM_2
1e-6 s TJT bound; TAI seconds and DYN exact):
  calendar:     TAI_tjt 6.29e-7 s, TAI_s 0, DYN 0
  scale_factor: TAI_tjt 4.71e-7 s, TAI_s 0, DYN 0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 25, 2026 19:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the Tier 3 JEOD cross-validation suite for SIM_2_dyn_plus_STD to cover additional initialization and dynamic scale-factor scenarios, increasing time-propagation RUN coverage from 1 to 3 while reusing the existing TAI+DYN DRAscii column set.

Changes:

  • Added two new SIM_2 RUNs (RUN_initialize_by_calendar, RUN_scale_factor_changes) to the Trick reference-generation harness.
  • Added two new Rust Tier 3 tests that replay the scale-factor scheduling semantics and validate TAI seconds, TAI TJT, and DYN against JEOD CSVs.
  • Committed regenerated reference CSVs for the two new RUNs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
trick/generate_references.sh Adds SIM_2 RUN entries for calendar-init and scale-factor-change runs using the existing time_v2 DRAscii snippet.
crates/astrodyn_verif_jeod/tests/tier3_sim_time_docker.rs Adds two new Tier 3 tests validating calendar initialization and mid-run scale_factor reassignment (including reversal) against JEOD outputs.
crates/astrodyn_verif_jeod/test_data/time_v2_calendar_time_v2.csv New JEOD reference CSV for SIM_2 calendar initialization run.
crates/astrodyn_verif_jeod/test_data/time_v2_scale_factor_time_v2.csv New JEOD reference CSV for SIM_2 scale-factor-change run.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…mments

The hardcoded "observed maxima" numbers in the SIM_2 calendar/scale_factor
test comments had already gone stale (claimed ~9e-9 s vs the actual
6.29e-7 / 4.71e-7 s the tests print at runtime). The println! in each test
already reports the real maxima, so the comment figures were redundant and
prone to exactly this drift. Keep the qualitative rationale and the assert!
tolerance literals; remove the duplicated numbers. Same scrub applied to the
pre-existing time_v4 jeod1x comment in the same file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@simnaut simnaut enabled auto-merge (squash) May 25, 2026 20:14
@simnaut simnaut merged commit 5c37652 into main May 25, 2026
20 of 22 checks passed
@simnaut simnaut deleted the sim2-dyn-plus-std branch May 25, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants