Commit 2da9b66
committed
Address Copilot review: add flat->tensor fan-out to DDt fallback
Copilot flagged that after the shape fix, the multicomponent projector
writes into _psi_star_flat_var but update_pre_solve() never unpacks the
solved flat (1, Nc) field back into psi_star[0]. Mirrors the fan-out
already in initialise_history() (~ddt.py:1540): walk
_psi_star_indep_indices, copy flat var k-th component into
psi_star[0][:, i, j], and symmetric-fill [:, j, i] for SYM_TENSOR.
In practice the SemiLagrangian advection step at line 1016 then
modifies psi_star[0] in place, so the missing fan-out wasn't producing
an immediate symptom in this short test — but the projected flux value
was being silently discarded. Fix restores the intended semantics:
psi_star[0] reflects the current psi_fn (projected flux) before SL
advection updates it for the upstream sample.
Reverted the over-eager second test (asserting psi_star[0] non-zero
after one solve) since the SL advection masks the missing fan-out in
that observation window. Kept the ShapeError regression test which
remains a definitive guard for the original visible failure.
Underworld development team with AI support from Claude Code1 parent d299361 commit 2da9b66
2 files changed
Lines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1776 | 1776 | | |
1777 | 1777 | | |
1778 | 1778 | | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
1779 | 1790 | | |
1780 | 1791 | | |
1781 | 1792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 16 | | |
21 | 17 | | |
22 | 18 | | |
| |||
26 | 22 | | |
27 | 23 | | |
28 | 24 | | |
| 25 | + | |
29 | 26 | | |
30 | 27 | | |
31 | 28 | | |
| |||
0 commit comments