Skip to content

Fix unrelated equilibrium parameters in signed distance test - #2330

Merged
YigitElma merged 3 commits into
PlasmaControl:masterfrom
AdemVessell:codex/fix-signed-distance-current
Sep 28, 2026
Merged

YigitElma merged 3 commits into
PlasmaControl:masterfrom
AdemVessell:codex/fix-signed-distance-current

Conversation

@AdemVessell

@AdemVessell AdemVessell commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

The changing-equilibrium case in test_signed_PlasmaVesselDistance leaves flux, current, pressure and lambda coefficients free although they do not affect the distance objective. The optimizer can therefore change the initially zero current and trigger a warning that pytest treats as an error.

Fix Psi, c_l, p_l and L_lmn with FixParameters, keeping the geometry free and preserving the distance-target assertion.

Validation: the focused test, Black and Flake8 pass locally on macOS arm64. The full suite was not rerun locally.

AI assistance: Codex helped diagnose the failure, revise the patch and run the checks under the author's direction.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Memory benchmark result

|               Test Name                |      %Δ      |    Master (MB)     |      PR (MB)       |    Δ (MB)    |    Time PR (s)     |  Time Master (s)   |
| -------------------------------------- | ------------ | ------------------ | ------------------ | ------------ | ------------------ | ------------------ |
  test_objective_jac_w7x                 |    0.52 %    |     4.236e+03      |     4.258e+03      |    22.03     |       29.29        |       23.41        |
  test_proximal_jac_w7x_with_eq_update   |   -0.33 %    |     6.585e+03      |     6.563e+03      |    -21.98    |       114.04       |       117.08       |
  test_proximal_freeb_jac                |    0.02 %    |     1.344e+04      |     1.344e+04      |     2.31     |       67.47        |       67.63        |
  test_proximal_freeb_jac_blocked        |   -0.35 %    |     7.800e+03      |     7.772e+03      |    -27.54    |       65.22        |       65.88        |
  test_proximal_freeb_jac_batched        |   -0.33 %    |     7.814e+03      |     7.789e+03      |    -25.75    |       59.45        |       58.94        |
  test_proximal_jac_ripple               |   -0.11 %    |     3.745e+03      |     3.740e+03      |    -4.14     |       37.65        |       36.73        |
  test_eq_solve                          |    0.24 %    |     1.826e+03      |     1.831e+03      |     4.41     |       37.10        |       38.28        |
  test_objective_quadratic_flux_jac      |   -1.42 %    |     1.888e+03      |     1.862e+03      |    -26.73    |       26.11        |       27.03        |

For the memory plots, go to the summary of Memory Benchmarks workflow and download the artifact.

@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.37%. Comparing base (fab1026) to head (9b2d63a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2330   +/-   ##
=======================================
  Coverage   94.36%   94.37%           
=======================================
  Files         101      101           
  Lines       29132    29132           
=======================================
+ Hits        27491    27492    +1     
+ Misses       1641     1640    -1     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/test_examples.py Resolved

@YigitElma YigitElma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the contribution! I think the main problem here is that the optimization problem is ill-posed. Since changing any of the profiles has no effect on the objective, optimizer could take any step to change them. I prefer fixing all these DOF to prevent any future problem.

I also confirm that this test was failing locally on my system.

Comment thread tests/test_examples.py Resolved
Comment thread tests/test_examples.py Resolved
@AdemVessell AdemVessell changed the title Fix current profile in signed plasma-vessel distance test Fix unrelated equilibrium parameters in signed distance test Sep 28, 2026
@AdemVessell

Copy link
Copy Markdown
Contributor Author

Thanks for explaining the broader issue, and for confirming the failure on your system. I've applied your suggested FixParameters constraint and removed the current snapshot and assertion. The existing geometry test passes locally on macOS arm64, as do Black and Flake8.

@YigitElma

Copy link
Copy Markdown
Collaborator

@AdemVessell, thanks for the contribution again. If you don't have anything to add in this PR, I will go ahead and merge it once the CI completes.

@AdemVessell

Copy link
Copy Markdown
Contributor Author

Nice @YigitElma
Nothing further to add from me and thanks for the helpful review and for merging when ready!

@YigitElma
YigitElma merged commit 7dacdaf into PlasmaControl:master Sep 28, 2026
27 checks passed
andycthea pushed a commit to andycthea/DESC_Public that referenced this pull request Oct 1, 2026
…ontrol#2330)

The changing-equilibrium case in `test_signed_PlasmaVesselDistance`
leaves flux, current, pressure and lambda coefficients free although
they do not affect the distance objective. The optimizer can therefore
change the initially zero current and trigger a warning that pytest
treats as an error.

Fix `Psi`, `c_l`, `p_l` and `L_lmn` with `FixParameters`, keeping the
geometry free and preserving the distance-target assertion.

Validation: the focused test, Black and Flake8 pass locally on macOS
arm64. The full suite was not rerun locally.

AI assistance: Codex helped diagnose the failure, revise the patch and
run the checks under the author's direction.

---------

Co-authored-by: Yigit Gunsur Elmacioglu <[email protected]>
andycthea pushed a commit to andycthea/DESC_Public that referenced this pull request Oct 20, 2026
…ontrol#2330)

The changing-equilibrium case in `test_signed_PlasmaVesselDistance`
leaves flux, current, pressure and lambda coefficients free although
they do not affect the distance objective. The optimizer can therefore
change the initially zero current and trigger a warning that pytest
treats as an error.

Fix `Psi`, `c_l`, `p_l` and `L_lmn` with `FixParameters`, keeping the
geometry free and preserving the distance-target assertion.

Validation: the focused test, Black and Flake8 pass locally on macOS
arm64. The full suite was not rerun locally.

AI assistance: Codex helped diagnose the failure, revise the patch and
run the checks under the author's direction.

---------

Co-authored-by: Yigit Gunsur Elmacioglu <[email protected]>
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.

3 participants