Skip to content

Ensure CoilCurvature and CoilTorsion are resolution independent - #2302

Merged
YigitElma merged 9 commits into
masterfrom
js/resolution-coilobjective
Sep 14, 2026
Merged

YigitElma merged 9 commits into
masterfrom
js/resolution-coilobjective

Conversation

@singh-jaydeep

Copy link
Copy Markdown
Collaborator

Resolves #2301 by replacing quad_weights with their square roots for these objectives. Also strengthens the resolution independence test for coil objectives.

@singh-jaydeep
singh-jaydeep marked this pull request as ready for review August 25, 2026 15:08
@github-actions

github-actions Bot commented Aug 25, 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.07 %    |     4.239e+03      |     4.242e+03      |     2.98     |       30.13        |       28.51        |
  test_proximal_jac_w7x_with_eq_update   |   -0.29 %    |     6.875e+03      |     6.854e+03      |    -20.26    |       152.79       |       153.54       |
  test_proximal_freeb_jac                |    0.13 %    |     1.352e+04      |     1.354e+04      |    17.18     |       81.77        |       80.84        |
  test_proximal_freeb_jac_blocked        |    0.69 %    |     7.836e+03      |     7.890e+03      |    54.03     |       69.04        |       69.85        |
  test_proximal_freeb_jac_batched        |    0.19 %    |     7.857e+03      |     7.871e+03      |    14.68     |       68.48        |       69.02        |
  test_proximal_jac_ripple               |   -0.99 %    |     3.787e+03      |     3.750e+03      |    -37.32    |       53.80        |       54.63        |
  test_proximal_jac_ripple_bounce1d      |    0.72 %    |     3.757e+02      |     3.784e+02      |     2.71     |        3.48        |        3.47        |
  test_eq_solve                          |    0.88 %    |     1.816e+03      |     1.832e+03      |    16.01     |       52.37        |       51.69        |
  test_objective_quadratic_flux_jac      |    0.63 %    |     1.887e+03      |     1.899e+03      |    11.96     |       34.89        |       34.00        |

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

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.35%. Comparing base (2031cd7) to head (e609392).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2302   +/-   ##
=======================================
  Coverage   94.35%   94.35%           
=======================================
  Files         101      101           
  Lines       29092    29092           
=======================================
+ Hits        27450    27451    +1     
+ Misses       1642     1641    -1     
Files with missing lines Coverage Δ
desc/objectives/_coils.py 99.34% <100.00%> (ø)

... and 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.

@dpanici

dpanici commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Can you also rerun the coil optimization notebook? Just so that they are up to date with master in case any minor changes have occurred

Comment thread CHANGELOG.md Outdated
Comment thread tests/test_objective_funs.py
singh-jaydeep and others added 3 commits August 25, 2026 20:13
Co-authored-by: Yigit Gunsur Elmacioglu <102380275+YigitElma@users.noreply.github.com>
@YigitElma
YigitElma requested review from a team, IssraAli, YigitElma, ddudt, dpanici, f0uriest, lkadz and rahulgaur104 and removed request for a team September 3, 2026 17:14
@review-notebook-app

review-notebook-app Bot commented Sep 3, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

YigitElma commented on 2026-09-03T19:52:21Z
----------------------------------------------------------------

Line #64.        LinkingCurrentConsistency(eq, coilset, eq_fixed=True, jac_chunk_size=5),

Any specific reason for adding additional constraint?


YigitElma commented on 2026-09-04T17:45:57Z
----------------------------------------------------------------

ok ok, nevermind, I didn't see you removed that from objectives

@review-notebook-app

review-notebook-app Bot commented Sep 3, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

YigitElma commented on 2026-09-03T19:52:22Z
----------------------------------------------------------------

I guess new constraint and weight caused this, but still this is a weirdly small number.


@review-notebook-app

review-notebook-app Bot commented Sep 3, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

YigitElma commented on 2026-09-03T19:52:23Z
----------------------------------------------------------------

These are couple orders of magnitude higher compared to before. This optimization was never intended to be a proper one (I think it is here to show MixedCoilSet optimization only), so probably fine.


@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.

Other than the additional constraint for mixed coilset optimization notebook seems to be very similar. Looks good to me. If you think the additional constraint is necessary I can approve.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Copy Markdown
Collaborator

ok ok, nevermind, I didn't see you removed that from objectives


View entire conversation on ReviewNB

@review-notebook-app

review-notebook-app Bot commented Sep 10, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

dpanici commented on 2026-09-10T19:17:03Z
----------------------------------------------------------------

Line #13.        "coil curvature": 185,  # 750/np.sqrt(101/(2*np.pi)),

I appreciate the comment here for review sake but we can remove this, no one will remember the old weight anyways


@dpanici dpanici 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.

I think notebook chnages are ~ok. Coil opt is sensitive to small things changing and we aren't going for state of the art results in the notebook.

I do want that comment in the notebook next to the weight noting the old weight removed as it is unneeded, but other than that I'll approve once its done

@YigitElma
YigitElma merged commit 82f19ca into master Sep 14, 2026
27 checks passed
@YigitElma
YigitElma deleted the js/resolution-coilobjective branch September 14, 2026 20:18
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.

Certain coil objectives depend on resolution

3 participants