Skip to content

Fix Stellarator regression failures #4406

Merged
clmould merged 2 commits into
mainfrom
divide-zero-stellarator
Jul 2, 2026
Merged

Fix Stellarator regression failures #4406
clmould merged 2 commits into
mainfrom
divide-zero-stellarator

Conversation

@timothy-nunn

@timothy-nunn timothy-nunn commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Reverts constraint 17 to pre-#4299.

The issue is that constraint 17 used to be formatted as

pradmaxpv = (
data.current_drive.p_hcd_injected_total_mw / data.physics.vol_plasma
+ data.physics.pden_alpha_total_mw * data.physics.f_p_alpha_plasma_deposited
+ data.physics.pden_non_alpha_charged_mw
+ data.physics.pden_plasma_ohmic_mw
)
return leq(
data.physics.pden_plasma_rad_mw / pradmaxpv,
data.constraints.fradpwr,
constraint_registration,
)

Importantly, it used pden_plasma_rad_mw. Now, the constraint uses f_p_plasma_separatrix_rad which is calculated as

self.data.physics.f_p_plasma_separatrix_rad = (
self.exhaust.calculate_radiation_fraction(
p_plasma_rad_mw=self.data.physics.p_plasma_rad_mw,
p_plasma_heating_mw=self.data.physics.p_plasma_heating_total_mw,
)
)

However this uses p_plasma_rad_mw which also includes the SOL radiation

self.data.physics.p_plasma_rad_mw += self.data.physics.psolradmw

which is never accounted for in pden_plasma_rad_mw. This changed the constraint, making the problem harder to solve, and led to constant failures when running the stellarator-helias test.

The diffs in the stellarator-helias test should revert it back to this file.

Thanks @clmould for identifying constraint 17 was the problem!

@timothy-nunn timothy-nunn requested a review from a team as a code owner July 2, 2026 09:20
eden_plasma_electrons_thermal_vol_avg / t_electron_energy_confinement
) / 1e6 # Convert from W/m³ to MW/m³

# import ipdb

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.

Accidentally left in?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes :D


# import ipdb

# ipdb.set_trace()

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.

Same here

@timothy-nunn timothy-nunn force-pushed the divide-zero-stellarator branch from ae83824 to bc897ec Compare July 2, 2026 09:23
@codecov-commenter

codecov-commenter commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.82%. Comparing base (024a2f2) to head (d1b7773).

Files with missing lines Patch % Lines
process/models/stellarator/stellarator.py 0.00% 4 Missing ⚠️
process/core/solver/constraints.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4406      +/-   ##
==========================================
- Coverage   48.83%   48.82%   -0.01%     
==========================================
  Files         151      151              
  Lines       29397    29405       +8     
==========================================
+ Hits        14356    14358       +2     
- Misses      15041    15047       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@clmould clmould self-assigned this Jul 2, 2026
@timothy-nunn timothy-nunn changed the title Ensure eden variables are set for Stellarator Fix Stellarator regression failures Jul 2, 2026
@clmould clmould merged commit 0519651 into main Jul 2, 2026
8 of 11 checks passed
@clmould clmould deleted the divide-zero-stellarator branch July 2, 2026 16:36
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.

4 participants