Skip to content

Measure the EFIT domain and grid: neither recovers a slice (#459) - #688

Open
HongSik-Yun-Fusion wants to merge 1 commit into
developfrom
claude/issue-459-domain-grid
Open

Measure the EFIT domain and grid: neither recovers a slice (#459)#688
HongSik-Yun-Fusion wants to merge 1 commit into
developfrom
claude/issue-459-domain-grid

Conversation

@HongSik-Yun-Fusion

Copy link
Copy Markdown
Contributor

Runs #459's EFIT 2×2 over the three reference discharges: the routine box against a reduced one, at 129×129 against 129×257. Phase 1A's capability questions are answered from the EFIT source, and the Phase 2 matrix is measured. CHEASE and TES are not touched.

What EFIT's grid contract actually is

  • nw and nh are runtime arguments, argv(1) and argv(2) (efit.F90:93-104), and nh defaults to nw. A rectangular grid needs no rebuild.
  • The Green table name encodes the grid and only the grid (table_name_ch, tables.F90:34).
  • EFIT has no notion of the box of its own. It reads rgrid/zgrid out of the table (tables.F90:158) and derives the cell size from them. The box is whatever EFUND's &in5 baked in.
  • So two tables for the same grid and different boxes have the same name, and running against the wrong one is undetectable from EFIT's output. verify_table reads the EFUND manifest and refuses a mismatch before any case runs; that refusal is tested.

EFUNDConfig already carried the box. regenerate_legacy_table.py exposed only the grid and now takes --rleft/--rright/--zbotto/--ztop.

The result, over 82 plasma slices

case box (m) grid cell (mm) produced accepted collapsed findax
A R 0.05–1.2, Z ±1.5 129×129 9.0 × 23.4 46 30 29 2
B R 0.05–1.0, Z ±1.35 129×129 7.4 × 21.1 36 23 29 13
C R 0.05–1.2, Z ±1.5 129×257 9.0 × 11.7 44 28 29 4
D R 0.05–1.0, Z ±1.35 129×257 7.4 × 10.5 36 23 29 13
  • Neither lever recovers a slice. The reduced box costs ten equilibria, the finer grid two. B and D agree on every count on every shot.
  • The reduced box fails exactly as the box predicts. findax rejects separatrix points within two cells of the edge (find_axis.F90:308-311); bringing the edge in takes those rejections from 2 to 13. The vacuum volume the proposal wanted to trim is not unused.
  • The collapse block is untouched. The same 29 slices collapse in all four cases. [EFIT] Qualify first-slice equilibrium seed sensitivity and convergence basin for VEST #588 ruled out the seed; this rules out the domain and the grid.
  • Resolution barely moves the reconstruction. Halving the vertical cell changes every global quantity by under 0.3 % (li is the largest at 0.26 %) and chi-square not at all. The axis height moves by 1.1718 cm, which is half the coarse Z cell to five digits, so that is quantisation rather than a different equilibrium.

All four cases use one acceptance envelope, case A's. aminor_min is a resolution floor and would otherwise move with the grid, leaving four cases judged against four bars.

A log-reading defect, fixed because it changed these numbers

bound can reject a slice before its first Picard iteration, which prints only the error line. parse_slices delimited slices on the iteration counter alone, so it dropped that slice and handed its error to the previous one. On 39915 a converged slice was carrying two failures that were not its own. The parser now opens a slice when a solver error names a new time, and a test pins the real log tail that exposed it.

This changes the earlier denominators: the reference set has 82 plasma slices, not 77. The baseline and seed studies' relative comparisons stand, since every row went through the same parser; their absolute counts predate the fix.

Open, and not resolved here

Case A is the routine box and grid, yet it produces 46 equilibria against the merged baseline's 31. The two runs differ in both the Green table and the mhdin.dat geometry (freshly generated vs packaged), so which one matters is not established. #194's A/B changed the table alone on four slices and found nothing; this is the first evidence that something in that pair matters on the marginal slices. The effect is larger than either lever this issue set out to test, and it needs its own controlled A/B.

Verification

  • Full offline suite: 9664 passed, 1063 skipped; one failure, test_plasma_features.py::test_a_spike_on_the_window_edge_does_not_move_the_peak, is the known parallel-only flake and passes in isolation.
  • Four tables generated with the controlled EFUND (129×129 in about 2 min, 129×257 in about 4–6 min; rv129257.ddd is 260 MB), each verified against its manifest, EFIT run over every plasma slice of 39915, 41524 and 41672.

Refs #459 (the umbrella stays open for CHEASE, TES and the multi-discharge stage).

🤖 Generated with Claude Code

The #171 baseline loses most of its plasma slices to two failures that read
as grid statements: `bound` cannot close a contour, and `findax` refuses a
separatrix point within two cells of the box edge. This runs #459's 2x2 over
the three reference discharges -- the routine box against a reduced one, at
129x129 against 129x257 -- to measure how much of that loss the domain and
the grid account for.

What EFIT's grid contract is, from the source:

- nw and nh are argv(1) and argv(2) (efit.F90:93-104); a rectangular grid
  needs no rebuild.
- The Green table name encodes the grid and only the grid (tables.F90:34).
- EFIT has no notion of the box of its own: it reads rgrid/zgrid out of the
  table (tables.F90:158). So two tables for the same grid and different boxes
  are named identically and a wrong one is undetectable from EFIT's output.
  `verify_table` reads the EFUND manifest and refuses a mismatch before any
  case runs.

Over 82 plasma slices:

  case  box                  grid     produced  accepted  collapsed  findax
  A     R .05-1.2, Z +-1.5   129x129        46        30         29       2
  B     R .05-1.0, Z +-1.35  129x129        36        23         29      13
  C     R .05-1.2, Z +-1.5   129x257        44        28         29       4
  D     R .05-1.0, Z +-1.35  129x257        36        23         29      13

Neither lever recovers a slice. The reduced box costs ten equilibria, and it
fails exactly as the box predicts: bringing the edge in takes findax's
off-grid rejections from 2 to 13. B and D agree on every count on every shot.
The 29-slice collapse block is untouched in all four cases; with #588 having
ruled out the seed, it is not a discretisation problem either. Halving the
vertical cell moves every global quantity by under 0.3%, chi-square not at
all; the axis height moves by exactly half the coarse Z cell, which is
quantisation rather than a different equilibrium.

All four cases are judged against one acceptance envelope (case A's), since
aminor_min is a resolution floor and would otherwise move with the grid.

Also fixed here, because it changed these numbers: parse_slices delimited
slices on the iteration counter alone, so a slice that `bound` rejects before
its first iteration was dropped and its error handed to the previous slice.
It now opens a slice when a solver error names a new time. The reference set
has 82 plasma slices, not the 77 the earlier studies reported; their relative
comparisons stand, their absolute counts predate this.

Open: case A produces 46 equilibria where the merged baseline produced 31.
The runs differ in both the Green table and the mhdin.dat geometry (fresh vs
packaged), so which one matters is not established; it needs its own A/B.

regenerate_legacy_table.py gains --rleft/--rright/--zbotto/--ztop; EFUNDConfig
already carried them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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