Skip to content

InnerLayer.SLAYER - TEST - Pin the reverse-shear invariance of the layer magnitudes - #432

Merged
d-burg merged 2 commits into
developfrom
test/slayer-reverse-shear-invariance
Aug 28, 2026
Merged

InnerLayer.SLAYER - TEST - Pin the reverse-shear invariance of the layer magnitudes#432
d-burg merged 2 commits into
developfrom
test/slayer-reverse-shear-invariance

Conversation

@d-burg

@d-burg d-burg commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Release note

  • Audience: developers
  • Numerical impact: none. Test-only; the diff touches no file under src/.
  • Migration: none.

#431 made the SLAYER layer timescales and widths use |s| so a reverse-shear rational surface produces a result instead of a DomainError. Nothing in the suite pinned that behaviour. This adds the missing coverage.

Why this was a gap

Every existing SLAYER testset constructs its parameters at sval_r = 1.0runtests_slayer_params.jl:13,132, runtests_slayer_riccati.jl:19,32, runtests_slayer_runner.jl:20, runtests_dispersion_coupled.jl:25, runtests_dispersion_residual.jl:25. No shipped deck has a reverse-shear rational surface either, so neither the suite nor the regression harness would notice if the abs() calls were reverted. #431's own validation was an out-of-tree scan of DIII-D shot 153072_3415, which is not reproducible in CI.

What is asserted

dc_type=:lar with a nonzero dr_val is used so the check covers the Wd self-consistency iteration and both critical-Δ square roots, not just tau_h.

  • sval_r keeps its sign in the struct — it is a diagnostic, not a magnitude
  • all 15 normalized layer quantities are bit-identical between sval_r = ±1.0 (abs(-1.0) === 1.0, so == is the right assertion, not )
  • lu > 0 and tauk > 0, so the S^(1/3) that used to throw now evaluates

Regression report

The diff adds one testset and changes no file under src/, so the harness is inert by construction and was not run. Stating this rather than pasting a run that could only report "unchanged".

(no src/ change — harness not applicable)

Validation

  • julia --project=. test/runtests.jl runtests_slayer_params.jl68/68 pass (49 before this PR)

Notes for reviewers

Opened as a draft.

Suggested reviewer @matt-pharr (InnerLayer focus per docs/development/contributors.md); assignee @d-burg. Say the word if you would rather it went to @logan-nc, who reviewed #431.

Note

#298 carries a cherry-picked copy of the #431 fix ("the copy resolves away once #431 merges"). That sync is now due, and merging this first means #298 picks the test up on the same sync.

…yer magnitudes

The shear-magnitude fix has no test coverage: every SLAYER testset builds its
parameters at sval_r = 1.0, and no shipped deck has a reverse-shear rational
surface, so a regression would be silent.

Assert that a negative-shear surface reproduces its positive-shear mirror
bit-identically across every normalized layer quantity, that sval_r keeps its
sign in the diagnostic, and that the Lundquist number stays positive so the
S^(1/3) that used to raise a DomainError evaluates.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@d-burg d-burg self-assigned this Aug 28, 2026
@d-burg
d-burg requested a review from matt-pharr August 28, 2026 05:42
@github-actions github-actions Bot added the test Tests only label Aug 28, 2026
…invariants

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@d-burg
d-burg requested review from ebursch and removed request for ebursch and matt-pharr August 28, 2026 20:09
@d-burg
d-burg marked this pull request as ready for review August 28, 2026 20:57
@d-burg
d-burg merged commit 987e63f into develop Aug 28, 2026
16 checks passed
@d-burg
d-burg deleted the test/slayer-reverse-shear-invariance branch August 28, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants