Skip to content

test(tier3): add 9 SIM_verif_attach_mass RUNs (#99 Bucket B)#624

Merged
simnaut merged 2 commits into
mainfrom
attach-mass-breadth
May 25, 2026
Merged

test(tier3): add 9 SIM_verif_attach_mass RUNs (#99 Bucket B)#624
simnaut merged 2 commits into
mainfrom
attach-mass-breadth

Conversation

@simnaut
Copy link
Copy Markdown
Owner

@simnaut simnaut commented May 25, 2026

Summary

Closes part of #99 Bucket B by extending the structural mass-tree
cross-validation in tier3_sim_attach_mass.rs from 8 → 17 of JEOD's 21
SIM_verif_attach_mass RUNs.

This is a structural mass-tree validation, not a trajectory test: JEOD's
sim is initialization-only (Trick stops at t=0, or t=2s for runtime
detach/reattach), dumping the composite tree via MassBody::print_tree(). Each
new RUN gets a build_run_*() that constructs the same MassTree from the
JEOD Modified_data/*.py + input.py config, and we compare composite
mass / CoM / inertia against the committed .out fixtures.

RUNs added (9)

Offset-attach group

  • RUN_05 — single parent, Struct inertia spec, non-zero CoM [0.5,0,1] (no attach)
  • RUN_06 — parent (StructCG) + child1 (Spec), offset attach [0,0,2]
  • RUN_07 — parent (StructCG) + child1 (SpecCG), offset attach [-1,0,0]

Named-point group (BodyAttachAligned)

  • RUN_103 — 3-body chain via named points (inline Euler orientations)
  • RUN_104 — 3-body chain via named points (InputMatrix orientations)
  • RUN_106 — parent (StructCG) + child1 (Spec) via named points
  • RUN_107 — parent (StructCG) + child1 (SpecCG) via named points
  • RUN_110 — named-point attach of 3 children, then runtime detach of child2
  • RUN_111 — named-point + offset attach, then runtime reattach of child2

New physics ported (config-only)

The Spec and SpecCG inertia_spec branches of
mass_properties_init.cc are ported as init-time transforms:
I_body = T_io · (I_user − pmi(m, inertia_offset)) · T_ioᵀ for Spec; the
offset term is dropped for SpecCG. These are pure configuration transforms
(JEOD reference data is used only for test comparison). As a
structurally-independent cross-check, both reduce to the same box inertia
diag(0.3333, 0.4167, 0.0833) that the Body spec declares directly — exactly
the JEOD test designers' intent.

Tolerances

Observed max errors across all 17 RUNs: mass 0, CoM 1.0e-16 m,
inertia 5.4e-7 kg·m². Source-code tolerances stay at the existing 5e-6
floor, which is the JEOD %20lf (6-decimal) print_tree print-precision
floor and the dominant noise source (per the CLAUDE.md 1.05×-observed-max
convention; the print floor bounds the observed numeric max with margin).

The frozen baselines.json regression snapshot is refrozen for this entry:
composite_inertia 4.0e-7 → 5.40e-7 and composite_com 4.08e-17 → 1.02e-16,
reflecting the new RUNs' observed maxima. The widening ratio is 1.35×
(under the 1.50× warn band) and composite_com sits below the 1e-12
absolute floor, so check_baseline_widening stays silent.

Not added (blockers)

  • RUN_08 / RUN_108 — a child body is attached to two different parents in
    separate body actions (e.g. child3 → child2 via attach2 and child3 →
    parent via attach3). Determining the resolved final topology would require
    reading JEOD's output, not source config — so this is deferred rather than
    guessed.
  • RUN_09 / RUN_109 — the root parent has a non-identity structure→body
    transform
    (parent_mass_orientation_optionA). JEOD reports composite
    CoM/inertia in the parent body frame (mass_update.cc:101/107 rotate the
    struct-frame offsets by composite_properties.T_parent_this), whereas our
    MassTree::recompute_composites keeps composites in the struct frame.
    Closing these needs the body-frame composite rotation ported into
    recompute_composites — flagged for a follow-up rather than approximated.

Verification

  • cargo nextest run -p astrodyn_verif_jeod -E 'test(attach_mass)' — pass (17 RUNs)
  • cargo run -p astrodyn_verif_jeod --bin tier3_baseline_diff — pass (refrozen entry)
  • cargo fmt --check — clean
  • cargo clippy -p astrodyn_verif_jeod --tests -- -D warnings — clean
  • parity_coverage — pass (attach_mass remains a documented permanent gap:
    structural test, no trajectory CSV)

🤖 Generated with Claude Code

Extends the structural mass-tree cross-validation in
tier3_sim_attach_mass.rs from 8 to 18 of JEOD's 21 RUNs, validating
composite mass / CoM / inertia against JEOD MassBody::print_tree() .out
fixtures.

New RUNs:
  Offset-attach group: RUN_05 (single body, Struct spec, non-zero CoM),
  RUN_06 (Spec inertia spec), RUN_07 (SpecCG inertia spec).
  Named-point group: RUN_103/104 (3-body named-point chains), RUN_106
  (Spec via named points), RUN_107 (SpecCG via named points), RUN_110
  (named-point attach of 3 children + runtime detach), RUN_111
  (named-point + offset attach + runtime reattach).

Ports the Spec and SpecCG inertia_spec branches from
mass_properties_init.cc (I_body = T_io · (I_user − pmi(m, offset)) · T_ioᵀ
for Spec; the offset term is dropped for SpecCG). Both reduce to the same
box inertia diag(0.3333, 0.4167, 0.0833) the Body spec declares directly —
a structurally-independent cross-check confirming the port. Observed max
errors: mass 0, CoM 1.0e-16 m, inertia 5.4e-7 kg·m²; tolerances stay at
the 5e-6 JEOD %20lf print-precision floor (per CLAUDE.md convention).

Deferred (documented in the module header):
  RUN_08/RUN_108 — a child is attached to two parents in separate body
  actions; resolving the final topology would require reading JEOD output
  rather than source config.
  RUN_09/RUN_109 — non-identity structure→body transform on the root;
  JEOD reports composites in body frame (mass_update.cc:101/107 rotate by
  composite_properties.T_parent_this), which MassTree::recompute_composites
  keeps in struct frame. Needs the body-frame composite rotation ported.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 25, 2026 07:14
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

This PR extends JEOD SIM_verif_attach_mass structural mass-tree validation by adding new run builders, committed mass.out fixtures, and reference-generation script entries. The implementation currently covers 17 RUNs, while the PR text and module docs claim 18.

Changes:

  • Adds Spec / SpecCG inertia-spec helper transforms and new build_run_* mass-tree scenarios.
  • Adds JEOD print_tree fixtures for the new attach-mass cases.
  • Updates the Trick reference-generation script to produce the new fixtures.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/astrodyn_verif_jeod/tests/tier3_sim_attach_mass.rs Adds new mass-property helpers, run builders, and validation calls.
trick/generate_references.sh Adds new SIM_verif_attach_mass reference-generation entries.
crates/astrodyn_verif_jeod/test_data/attach_mass_05_mass.out Adds JEOD fixture for RUN_05.
crates/astrodyn_verif_jeod/test_data/attach_mass_06_mass.out Adds JEOD fixture for RUN_06.
crates/astrodyn_verif_jeod/test_data/attach_mass_07_mass.out Adds JEOD fixture for RUN_07.
crates/astrodyn_verif_jeod/test_data/attach_mass_103_mass.out Adds JEOD fixture for RUN_103.
crates/astrodyn_verif_jeod/test_data/attach_mass_104_mass.out Adds JEOD fixture for RUN_104.
crates/astrodyn_verif_jeod/test_data/attach_mass_106_mass.out Adds JEOD fixture for RUN_106.
crates/astrodyn_verif_jeod/test_data/attach_mass_107_mass.out Adds JEOD fixture for RUN_107.
crates/astrodyn_verif_jeod/test_data/attach_mass_110_mass.out Adds JEOD fixture for RUN_110.
crates/astrodyn_verif_jeod/test_data/attach_mass_111_mass.out Adds JEOD fixture for RUN_111.

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

Comment thread crates/astrodyn_verif_jeod/tests/tier3_sim_attach_mass.rs Outdated
The 9 new SIM_verif_attach_mass RUNs raise the observed composite_inertia
max error to 5.40e-7 (composite_com to 1.02e-16); refreeze baselines.json /
baselines.md so the tier3_baseline_diff check passes. Widening ratio is
1.35x (under the 1.50x warn band) and composite_com sits below the 1e-12
absolute floor, so check_baseline_widening stays silent.

Correct the module doc header from 18 to 17 covered RUNs (8 existing + 9
new; the doc body already lists 17) per PR review feedback.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@simnaut simnaut changed the title test(tier3): add 10 SIM_verif_attach_mass RUNs (#99 Bucket B) test(tier3): add 9 SIM_verif_attach_mass RUNs (#99 Bucket B) May 25, 2026
@simnaut simnaut enabled auto-merge (squash) May 25, 2026 07:32
@simnaut simnaut merged commit 9eb408c into main May 25, 2026
18 checks passed
@simnaut simnaut deleted the attach-mass-breadth branch May 25, 2026 07:48
simnaut added a commit that referenced this pull request May 25, 2026
… LSODE) (#627)

* chore(tier3): refreeze baselines snapshot (track 19 untracked tests + LSODE)

The frozen `baselines.json` regression snapshot is a manual
`tier3_report --freeze-baselines` artifact, not refreshed by CI. The
`tier3_baseline_diff` gate only fails on regressions of entries already
present, reporting brand-new tier3 tests as informational "new" — so every
tier3 test added since the last freeze accumulated unguarded.

This refreezes the full snapshot (78 -> 97 entries) from a clean
`cargo nextest run --workspace -E 'test(tier3_)'` (all 233 tier3 tests pass):

- Adds regression coverage for 19 tracked-but-unfrozen tests (RNP, LSODE,
  relative-state, mars/phobos, NESC NRHO, dyncomp attach-to-ref-frame,
  kinematic-propagation, child-derivative, complex attach/detach, and the
  run2/6c/6d/9b/10b simulation RUNs).
- Tightens `tier3_simulation_lsode_default` by ~7 orders of magnitude:
  position 9.5 km -> 9.2e-4 m, velocity 11 m/s -> 1.0e-6 m/s. The old
  ceiling was frozen when LSODE was a stub; #616/#617 implemented the
  stiff BDF integrator, so the meaningful error is now sub-mm. The loose
  ceiling let a 7-orders accuracy regression pass unnoticed.

All deltas are tightenings (informational) or new entries; the
`check_baseline_widening` lane reports 0 errors / 0 warnings, and
`tier3_baseline_diff` is OK (97 matched, 0 new). `attach_mass` is unchanged
from #624.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(tier3): allow-list earth_moon_rosetta, rename dyncomp err keys, capture 2 new tests

The previous freeze failed the fast-bucket baseline-invariance gate:

- tier3_earth_moon_rosetta was added as a baseline entry but the fast CI
  bucket excludes the earth_moon suite, so it reported as missing. Add it to
  .github/tier3-allow-missing.txt alongside tier3_earth_moon_clem.
- sim_drag_ver_const (#621) and simulation_tide_run02 (#625) landed on main
  after the freeze and were unguarded; refreeze captures both.
- Rename tier3_sim_dyncomp_run_attach_to_ref_frame extras
  *_max_quat_angle/*_max_ang_vel -> *_..._err to match the schema used by
  every other tier3 report (Copilot review). Values byte-identical.

Verified: baseline_diff OK (99 matched; 0 allowed-missing; 0 new);
widening check 0 error(s), 0 removed; fmt + clippy clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Test User <test@test.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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