Skip to content

Add an orbit-class magnetic-drift control - #97

Merged
krystophny merged 1 commit into
mainfrom
agent/mimic-magdrift-orbit-class-minimal
Jul 26, 2026
Merged

Add an orbit-class magnetic-drift control#97
krystophny merged 1 commit into
mainfrom
agent/mimic-magdrift-orbit-class-minimal

Conversation

@krystophny

Copy link
Copy Markdown
Member

MARS-K has no passing magnetic-drift path. This adds one narrowly scoped control so NEO-RT can reproduce that orbit-class physics in one run.

magdrift_passing is an integer namelist/API control: negative follows magdrift (the backward-compatible default), zero disables only the passing contribution, and positive enables it. The trapped branch and native torque signs are unchanged.

The independent behavioral oracle runs three real golden-record cases: full drift, no drift, and mixed scope. It verifies that the mixed run's passing contribution equals the no-drift run while its trapped contribution equals the full-drift run. This is the previous two-run composition, not an assertion of the new implementation's internal state.

Validation:

  • fo test: 10/10
  • targeted golden-record behavioral test: 1/1
  • clean GNU build

This supersedes #94, whose branch accidentally contained unrelated stacked work.

…ift scope

MARS-K has no passing magnetic-drift code path at all. Matching that scope in
NEO-RT previously required two runs -- trapped with magdrift, passing without --
whose per-class outputs were added by hand. That works because NEO-RT serializes
Tco, Tctr and Tt separately and the class contributions are additive, but it
doubles the runs and puts the composition in the analysis layer where it is easy
to get wrong.

`magdrift_passing` switches the magnetic drift off for passing orbits only. It
gates two places: the passing branch of Om_tB, which now returns exactly zero
rather than an interpolated value, and init_canon_freq_passing_spline, which no
longer builds a drift spline it will not use.

The namelist control is an integer with a negative "follow magdrift" default, so
every existing deck keeps its behaviour bit-identically and no deck has to name
the new key. Only an explicit 0 or 1 overrides.

VALIDATION IS PENDING and this should not merge without it. The oracle is the
two-run equivalence above: trapped-with-drift plus passing-without, summed from
the separate class columns, must reproduce a single run with magdrift=.true. and
magdrift_passing=0. That compares against an existing, independent code path
rather than restating the patch. A bespoke unit test was attempted and dropped:
driving Om_tB directly needs more orbit-machinery setup than the check is worth,
and the two-run comparison is the stronger oracle anyway.

First of a planned set of code-mimicry flags, whose purpose is to let NEO-RT be
run *as* MARS-K on the MARS field and *as* PENTRC on the GPEC field, so that
residual differences are physics rather than configuration.
@krystophny
krystophny merged commit 5fa2f60 into main Jul 26, 2026
2 checks passed
@krystophny
krystophny deleted the agent/mimic-magdrift-orbit-class-minimal branch July 26, 2026 16:49
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.

1 participant