Consolidate numerical research and preserve a reproducible handoff

Document the baseline, hypotheses, measured results, failed approaches,
current policy defaults, and remaining rotating n=3 and virial limitations.
Include the authoritative LaTeX report, Pandoc-generated Markdown, compiled
PDF, source provenance, branch decisions, and consolidation validation.

Organize raw results and miscellaneous artifacts under working/ without
deleting them; version the directory guide, relocation hashes, archive
verifier, and report build/conversion checks. Keep build caches at their
original paths and clearly distinguish retained binaries from the validated
research build. Preserve experimental policies without promoting failed
trials to defaults.
This commit is contained in:
2026-09-20 09:10:27 -04:00
parent b1fe359760
commit e7e53ce682
54 changed files with 54425 additions and 6 deletions

13
.gitignore vendored
View File

@@ -5,3 +5,16 @@ build/
._DS_Store
.DSStore
.DS_Store
# Local build caches retain absolute source paths; do not relocate them.
cmake-build-*/
__pycache__/
*.pyc
test_summary.html
.cex/
.codex/
# Preserved raw campaigns, scratch files and report build intermediates.
# The directory guide and audit manifests are versioned separately.
/working/*
!/working/README.md

View File

@@ -17,7 +17,31 @@ This module is not intended for scientific use; rather, this will inform latter
- We aim to develope numerical instrumentation which will be incorporated into SERiF including, but not limited to, preconditioners, integrators, and operators
- We aim to develope utility infrastructure which will be incorporated into SERiF including, but not limited to, quadrature boost policies, domain mapping, and user experience tools.
# Current Status [as of July 15, 2026]
# Current research status (20 September 2026)
The cumulative numerical investigations have been consolidated into `main`.
The preferred research surface is the coupled degree-four real spherical
harmonic prescription with all azimuthal orders (25 coefficients), explicitly
selected by the sandbox. Density remains independent DG Q2, enthalpy and
displacement remain H1 Q3, and the library's existing default policies remain
available unchanged.
Some low-index, slowly rotating models meet their algebraic and virial targets.
A fully converged moderately rotating n=3 model, validation against ESTER, and
50% of critical rotation have **not** been demonstrated. The current research
virial acceptance target is 1e-5; the earlier 1e-6 statement above is the original
aspiration. Stellar LDU plus gravity-Schur is a promising experimental recipe,
not a promoted universal solver default. Log density and new positivity
enforcement remain deferred.
Start with the [complete research report](reports/MeanField_research_handoff_2026-09-20.md),
the [branch disposition record](reports/branch_consolidation.md), and the
[report build instructions](reports/README.md). Raw results have been preserved
and organized under [working/](working/README.md). The
[model slice guide](experiments/MODEL_SLICES.md) explains physical-plane output
including the deformed stellar surface.
# Historical status (15 July 2026)
- Integrators for all mean field equations have been written. In other code these have been validated as self-consistent and consistent with analytic solutions generated with symbolic algebra tools. These tests will be incorporated into this module
- Gravitational Potential calculations have been rigorously tested for a number of cases including uniform spherical densities, polynomial spherical densities, rational spherical densities, uniform ellipsoidal densities, and rational ellipsoidal densities. These potentials only apply the density profile and the potential at infinity boundary condition
- We have shown that we can reach sufficient self-consistency and accuracy with the gravitational field such that the gravitational field representation will not prevent us achiveing the required virial ratio or mode identification accuracy.
@@ -36,15 +60,25 @@ and no testing has been done to confirm if this works over a variety of targets.
- ninja
- cmake
once those are installed then the following commands will in theory build mean_field
Once those dependencies are installed, a fresh build on the development Mac uses:
```bash
mkdir build
cd build & cmake .. -Gninja && ninja
./build/tests
cmake -S . -B working/builds/release -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++
cmake --build working/builds/release --parallel 2 \
--target tests sandbox plateau_diagnostic
OMPI_MCA_btl=self,sm ./working/builds/release/tests --catch2
```
Adjust compiler and dependency locations for another machine. The consolidation
was validated using the isolated research worktree's Release build. Older build
directories in this checkout were preserved, and their binaries may be stale:
rebuild from the current source before using them. Do not transplant a CMake
cache from a different checkout.
should you wish to build this and you run into issues (as you likely will) you are welcome to email Emily Boudreaux (emily.boudreaux@dartmouth.edu); however, maintenance and support of this module
are not guaranteed. If SERiF has been released when you are reading this documentation we encourage you to look for that project on the 4D-STAR webpage (https://4d-star.org) as it inherits any and all scientific merit from this exploratory project.
# Funding
> 4D-STAR is funded by European Research Council (ERC) under the Horizon Europe programme (Synergy Grant agreement No. 101071505: 4D-STAR). Work for this project is funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council.
> 4D-STAR is funded by European Research Council (ERC) under the Horizon Europe programme (Synergy Grant agreement No. 101071505: 4D-STAR). Work for this project is funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

58
reports/README.md Normal file
View File

@@ -0,0 +1,58 @@
# MeanField research reports
The complete local delivery is identified by Git tag `research-handoff-2026-09-20`.
The comprehensive handoff is
[MeanField_research_handoff_2026-09-20.md](MeanField_research_handoff_2026-09-20.md).
The matching [LaTeX source](MeanField_research_handoff_2026-09-20.tex) is authoritative;
the [PDF](MeanField_research_handoff_2026-09-20.pdf) is the print version. Markdown
is generated directly from LaTeX by Pandoc, not maintained as a separate report.
A small Pandoc filter removes repeated PDF table headings from Markdown and
preserves section anchors; math uses explicit absolute-value and norm delimiters
so table separators stay intact. The builder also checks that conversion retained
table cells, equations, paths, figures, captions and working contents links.
From the repository root, run:
```sh
python3 reports/build_report.py
```
This requires Pandoc, `latexmk`, and a LaTeX installation with the packages named
in the source preamble. To regenerate Markdown alone:
```sh
python3 reports/build_report.py --markdown-only
```
Build logs and LaTeX auxiliary files go to
`working/report_builds/research_handoff/`. Selected scientific figures are
versioned under `figures/`; their original paths and hashes are in
`archive/figure_sources.json`.
- [Branch consolidation](branch_consolidation.md) explains each retained,
incorporated or intentionally excluded hypothesis.
- `archive/` preserves the pre-consolidation Git inventory, exact local edit,
file relocation/hash manifest, and unsuccessful one-way gravity experiment.
- `sources/original_audits/` holds the original formulation, solver and
preconditioner audits as unmodified reference copies.
- `prior/` preserves earlier project documentation and the optimization report.
- `validation/` records the consolidation checks, tested source and executable
hashes, physical smoke results, and document conversion audit.
- `../experiments/` contains the original study reports, experiment recipes,
diagnostics and evidence checkers.
- [The working-directory guide](../working/README.md) locates the complete raw
evidence archive, which is local and not committed to Git.
The report distinguishes code correctness checks, artifact audits, algebraic
convergence and physical validation. None should be read as a substitute for
the others. In particular, the moderately rotating n=3 and ESTER-validation
milestones remain open.
To verify the local raw archive against every recorded content hash, run:
```sh
python3 reports/verify_archive.py
```
Supply `--repository /path/to/MeanField` when checking a relocated archive.

View File

@@ -0,0 +1,148 @@
# MeanField branch consolidation audit — 20 September 2026
This is a read-only source/history audit. No source files, branch references, worktrees or artifacts were changed by the auditor; this document is its only output. No numerical test was run. Conclusions refer to integration commit `d7acb0d399aac5ac4c36d834a954c1c959042b81` unless a different revision is named.
## Recommendation
Use `research/coupled-convergence-study-20260919` (`d7acb0d`) as the integration base and advance `main` to a tested consolidation descendant. It is a descendant of current `main` (`75cc638`) and contains all successful cumulative implementation work, all current experiment infrastructure, and most unsuccessful-study records. It already incorporates most topic branches by cherry-pick or equivalent integration; blindly merging every branch would reintroduce obsolete driver versions or failed defaults and create unnecessary conflicts.
Preserve historical branches. Record their disposition in the consolidated report. A branch need not become an ancestor of main to have its useful contents incorporated; the patch/content mapping below supplies that provenance. Do not use an `ours` merge to falsely suggest discarded behavior was adopted.
Two divergent topics merit explicit treatment:
1. **Log-density assessment:** import the two final files from `research/log-density-assessment-20260919` (`90580b2`) as deferred research documentation/reference: `experiments/LOG_DENSITY_ASSESSMENT_2026-09-19.md` and `experiments/log_density_reference_model.py`. The six unique commits change only these files. There is no FEM log-density implementation to merge, and adding the historical assessment does not enable positivity enforcement or contradict the current decision to defer it.
2. **One-way material-to-gravity completion:** preserve the final README, recipe and case manifest from `research/gravity-coupling-20260916` (`db0ddd3`) in a clearly historical/archived experiment location, or retain the branch with a report link and extracted evidence. Do **not** transplant its old driver or make its prescription the default. This was a measured counterexample, not the later successful two-way LDU policy.
The failed Q4 displacement implementation remains isolated on `research/shape-field-displacement-q4-20260918`; its final report and comparison scripts are already present in the integration branch with Q3 restored. There is no scientific reason to activate Q4 during consolidation.
## Main checkout preservation
At audit start, `/Users/tboudreaux/Programming/4DSTAR/MeanField` was on `research/numerical-strategies-20260917` at `10adf7e`, not on main. The only tracked local edit was formatting in `libmeanfield/interface/quadrature/mfem.cppm`: method declaration wrapping, no signature/semantic change. Preserve it explicitly by backup/commit or an exactly reapplied patch; it is the user's work. Numerous untracked result folders, CSVs, archives, build trees, `.cex`, `.codex`, scripts and optimization report files were also present. This audit does not classify those as deletable.
`main`, `origin/main` and `local/main` all pointed to `75cc638` at audit start. Do not push remote main without further authorization; local integration is the requested action. No AGENTS.md exists in the programming checkout or its checked ancestors. The project mirror's AGENTS.md says every file under `sources/` is read-only; do not relocate or change synced sources.
## Branch-by-branch disposition
“Ancestor” means reachable from `d7acb0d`. “Patch-equivalent” means all topic commits reported by `git cherry d7acb0d <topic>` have equivalent patches in the integration history. “Semantically integrated” covers build-registration and combined cherry-picks whose exact patch IDs differ but final source was inspected. This is more discriminating than treating every plus-sign from `git cherry` as missing code.
| Branch | Tip | Status and action |
|---|---|---|
| `integration/research-consolidation-20260920` | `b1fe359` | New consolidation descendant, created during this audit: adds preserved user formatting (`6950dc6`) and six log-assessment documentation/reference commits (`549b1a7` through `b1fe359`) after `d7acb0d`. These were not represented in the base snapshot. |
| `main` | `75cc638` | Ancestor; already represented. No additional merge. |
| `research/baseline-20260916` | `80cc3d8` | Ancestor; already represented. No additional merge. |
| `research/central-constraint-20260916` | `2e19c2c` | All 4 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/combined-20260916` | `95d9fba` | Ancestor; already represented. No additional merge. |
| `research/coupled-convergence-study-20260919` | `d7acb0d` | Ancestor; already represented. No additional merge. |
| `research/coupled-shape-coarse-20260918` | `4a6c1b5` | Semantically integrated: two equivalent commits; isolated test-registration 4a6c1b5 is already in CMakeLists. Keep diagnostic-only coarse experiment; no additional merge. |
| `research/coupled-trial-correction-20260918` | `46249d0` | Ancestor; already represented. No additional merge. |
| `research/damped-coupled-trial-20260918` | `db854c0` | Ancestor; already represented. No additional merge. |
| `research/density-order-study-20260919` | `ef76e0c` | Ancestor; already represented. No additional merge. |
| `research/diagnostic-campaign-20260917` | `7a07cae` | Ancestor; already represented. No additional merge. |
| `research/experiment-harness-20260916` | `899cb18` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/gravity-compact-application-20260917` | `ff1b889` | Semantically integrated: seven equivalent patches; e599900 and 2c64a92 module/test registration already present. No additional merge. |
| `research/gravity-consistent-schur-20260918` | `c10d019` | All 2 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/gravity-coupling-20260916` | `db0ddd3` | Not integrated: failed one-way completion. Archive README/recipe/manifest and retain branch. Do not adopt old driver or policy. |
| `research/gravity-coupling-ablation-20260919` | `38c7184` | Ancestor; already represented. No additional merge. |
| `research/gravity-curvature-correction-20260917` | `3762c74` | Semantically integrated: four equivalent patches; e599900 registration already present. Keep opt-in; no additional merge. |
| `research/gravity-direction-diagnostics-20260917` | `47775a9` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/gravity-prepared-roundoff-20260917` | `782827c` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/gravity-reduced-newton-20260917` | `d25d141` | Semantically integrated: seven equivalent patches; 5952691 registration already present. Keep opt-in; no additional merge. |
| `research/gravity-trial-diagnostics-20260917` | `7f4b068` | All 2 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/krylov-20260916` | `7127383` | All 4 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/krylov-window-20260916` | `1f9184b` | Semantically integrated: documentation identical, sandbox restart is 160. 937d2f2 was integrated alongside other sandbox changes; no additional merge. |
| `research/linear-coupling-study-20260919` | `0e6688f` | Semantically integrated: core wrapper/tests identical; one patch equivalent and 1d95602 integrated as 2398118 with adjusted surrounding driver/build context. Frozen experiment only. |
| `research/log-density-assessment-20260919` | `90580b2` | Not integrated: six documentation/reference-only commits. Import final assessment and reference script as deferred research; no positivity/runtime change. |
| `research/model-slices-20260919` | `5da3f42` | Semantically integrated: seven equivalent patches; 966a4d4 integrated as 9bac57a. Slice implementation/plotter content identical. No additional merge. |
| `research/n3-compatible-family-20260919` | `1d746b0` | Ancestor; already represented. No additional merge. |
| `research/n3-linear-ablation-20260919` | `e78af98` | Ancestor; already represented. No additional merge. |
| `research/n3-live-field-feedback-20260919` | `1ed03f5` | Ancestor; already represented. No additional merge. |
| `research/negative-density-diagnosis-20260919` | `7ed4d23` | Ancestor; already represented. No additional merge. |
| `research/nonlinear-step-obstruction-20260918` | `2944dd5` | Ancestor; already represented. No additional merge. |
| `research/numerical-strategies-20260917` | `10adf7e` | Ancestor; already represented. No additional merge. |
| `research/polynomial-endpoint-certification-20260917` | `cc6f4b0` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/polynomial-positive-newton-20260917` | `9aefb36` | Semantically integrated: eight equivalent patches; a773c9a registration already present. Available explicit strategy only, not a default; do not enable. |
| `research/preconditioner-benchmarks-20260918` | `dc1da62` | Ancestor; already represented. No additional merge. |
| `research/preconditioner-cached-cross-actions-20260918` | `07769e7` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/pressure-obstruction-20260917` | `c6572d3` | All 3 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/reduced-smooth-surface-20260918` | `2171b8b` | Ancestor; already represented. No additional merge. |
| `research/shape-curvature-20260917` | `b24e6e0` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/shape-field-displacement-q4-20260918` | `785a7ae` | Implementation intentionally excluded: retain Q3. Final report/comparison scripts already identical in integration, preserving negative result. |
| `research/shape-field-weak-response-20260918` | `6ceda61` | Ancestor; already represented. No additional merge. |
| `research/spherical-harmonic-surface-20260919` | `1148c09` | Ancestor; already represented. No additional merge. |
## Verified false-positive unmerged commits
The following unique patch IDs do not indicate missing capabilities:
- `4a6c1b5`: `tests/solver/plateau_coupled_coarse.cpp` is already registered at CMakeLists line 391.
- `e599900`, `2c64a92`, `5952691`, `a773c9a`: gravity subsystem/reduction, compact gravity, polynomial admissibility modules and tests are already in CMakeLists and the exported mean_field module. Reapplying isolated registration commits would only duplicate source entries or conflict.
- `937d2f2`: sandbox explicitly uses FGMRES restart 160. The final Krylov-window report is byte-identical to the topic branch.
- `1d95602`: `plateau_surface_border_schur.hpp` and its regression tests are byte-identical to the final topic branch. Integration commits `2398118` and `522a2cf` carry the implementation and followup test changes.
- `966a4d4`: physical-plane slice headers and current plotter are byte-identical to the final topic branch. Integration starts at `9bac57a`, with final label changes at `07799bc` and `2c6523b`.
- Q4 topic `785a7ae`: `SHAPE_FIELD_WEAK_RESPONSE_2026-09-18.md`, `compare_shape_order_runs.py` and `plot_shape_surface_comparison.py` are already byte-identical to the topic tip. The source-order change from `4be1a23` is deliberately absent.
## What is active versus selectable at d7acb0d
It is essential that the consolidated report distinguish library defaults, example configuration, diagnostic-driver defaults, and recommended research candidates.
| Layer | Current behavior | Consolidation recommendation |
|---|---|---|
| Independent physical fields | Density remains independent DG Q2; enthalpy independent H1 Q3; displacement H1 Q3; gravity RT2/Q2; reference geometry Q4 | Retain. Do not import the Q4 trial or log-density runtime. |
| Density approximation configuration | `MEAN_FIELD_DENSITY_POLYNOMIAL_ORDER=2` compile-time CMake/registry option independent of other fields; uniform increment remains available | Retain configurable order and corrected closure quadrature. Default stays Q2. |
| Surface factory default | Two-argument `makeStellarDiscretization` remains `NodalRadialSurface`, with power-law radial interior and fixed-infinity radial vacuum extensions | Preserve compatibility; avoid silently changing all clients. |
| Sandbox preferred surface | Explicit `SphericalHarmonicSurface` maximum degree 4, all real m, 25 coefficients, coupled with all fields | Retain explicit preferred candidate; nodal remains selectable. |
| Harmonic surface limit | Single MPI rank; sampled basis rank and trace contracts checked. H1 nodal surface surrogate explicitly rejects harmonic coordinates | Report this limitation; do not imply general distributed harmonic support. |
| Normalization | Existing `PhysicalRieszDiagonal` in sandbox; harmonic reference trace metric adds correct primal/dual coefficient scaling | Retain. This is coordinate scaling, not an exact surface response inverse. |
| Sandbox physical model | n=1, J=0, fixed total mass/angular momentum; central density is Lane–Emden seed data only | Retain. Central constraint remains explicitly specifiable for n=3 studies, not a hidden universal constraint. |
| Library FGMRES option default | `FGMRESOptions.restartLength=50` | Unchanged by research. Do not claim it is 160 globally. |
| Sandbox FGMRES configuration | Restart 160; Newton maximum 30; relative nonlinear target 1e-8, linear target .03/cap 200 | Retain known baseline. |
| Diagnostic no-argument controls | Nodal surface, restart 40, independent preconditioner, baseline strategy; runs require output. Campaign manifests explicitly select harmonic/restart160 variants | Keep manifests authoritative; do not confuse convenient CLI defaults with the latest experimental configuration. |
| Warm-start guard | Reused linear correction is reset if its fresh full-J true residual is nonfinite or worse than the cold RHS norm | Retain correctness/performance safeguard; endpoint true-residual check remains authoritative. |
| `makePreconditioner()` | Default stellar structure: independent material/surface and gravity inverse, with generated scalar-border completion | Preserve default until matched full convergence evidence warrants promotion. |
| Default material inverse | SurfaceThenMaterialTriangular with diagonal density/enthalpy/surface solves; exact prepared h-to-density EOS cross derivative and surface-to-material actions included | Retain. Do not describe it as missing h-to-density coupling. |
| Default gravity inverse | GravityApproximateLDU; matrix-free Chebyshev order5/powerIterations20 mass inverse, three fixed AMG cycles | Preserve base comparator; refined consistent Schur remains available. |
| Consistent gravity Schur | Typed `GravityConsistentSchurLDU`, fixed number of sweeps; library policy defaults 1 sweep/relaxation1, diagnostic default relaxation .5 | Retain useful optional implementation and measured manifests; do not conflate the option defaults. |
| Live experimental recipes | `gravity-schur`, `stellar-ldu`, `stellar-ldu-gravity-schur` live in experiments owning recipe layer | Retain. LDU+gravity is currently best live candidate for the tested compatible rotating n3/gravity-curvature configuration, not established universal default. |
| Newton numerical defaults | `SampledEnthalpy`, `MonolithicGravity`, `UncorrectedTrial` | Preserve. No added positivity forcing or auxiliary corrections execute by default. |
| Optional Newton paths | Polynomial enthalpy certificate/repair, gravity-curvature, reduced gravity, fully coupled and damped second-order corrections | Preserve explicit selection and tests as experimental tools; no general convergence claim. |
| Coarse surface/scalar Schur | Experiment-only frozen wrapper; reconstruct after changed Jacobian | Retain diagnostic infrastructure. Do not promote; lower iteration counts did not generally justify setup/application expense. |
| Restart initializer | Explicit diagnostic API validates state/layout/coordinate provenance, prepares/refreshes transactionally, clears warm starts, rolls back failures | Retain. Unconverged snapshots require explicit experimental override. |
| Model slices | Optional experiment export/plot of actual mapped stellar domain; xz/xy/yz/offset options; signed fields retained | Retain. Display approximation/refinement is distinct from FEM convergence or physical validation. |
Source anchors: `sandbox.cpp`; `libmeanfield/interface/equilibrium/stellar_discretization.cppm`; `libmeanfield/interface/field/field_registry.cppm`; `libmeanfield/interface/normalization/stellar_equilibrium.cppm`; `libmeanfield/interface/preconditioning/{stellar_recipe,stellar_structure,material_surface,gravity_field}.cppm`; `libmeanfield/interface/solver/{linear_backend,newton_numerics,stellar_context}.cppm`; `experiments/plateau_diagnostic.cpp`; `experiments/plateau_newton_preconditioner.hpp`.
## Why the failed one-way branch stays historical
`db0ddd3` documents a same-state n3,J0 cold-seed control with original material/gravity subcomponents unchanged, only `MaterialThenGravityTriangular` replacing independence. At restart160/cap200/target .03, true defect improves .0402590 to .0381781 but both fail; solve cost rises 98.915 to117.712s (19%). At restart40, defect worsens .0563080 to .0715826. Direction norm doubles .757644 to1.540825; sampled admissible step tightens .152435 to .0913461. This is not an improvement sufficient for default promotion. It does not rule out the later two-way LDU with better gravity inverse.
The branch's shared harness commit `ad86e2e` includes some source changes also represented later in the main cumulative harness; it is not all useful missing code simply because patch-id differs. Importing its old `plateau_diagnostic.cpp` would erase subsequent functionality.
## Useful cumulative integration already present
- Baseline `80cc3d8` snapshots the user's optimized prepared-operator/reference-table/mapping/normalization path and diagnostics that were not in old main. The main-to-d7 diff includes this earlier user performance work; do not attribute every changed file to the subsequent AI-led numerical experiments.
- Optional central-density example cleanup, restart160 example choice and safeguarded warm starts are cumulative by `95d9fba`.
- Pressure/shape diagnostic instrumentation and typed Newton numerical strategies are integrated by `10adf7e`; prepared gravity arithmetic and compact application fixes are included.
- Consistent Schur, prepared cross-action reuse and honest full-cost frozen benchmarking are integrated by `dc1da62`.
- Coupled/damped trial tools and their bounded negative/conditional results are integrated by `db854c0`.
- Q3-restored weak-response/Q4 comparison report, reduced surface experiments and native all-m harmonic surface are integrated by `1148c09`.
- Negative-density localization, independent density-order configuration, closure quadrature repair and audited order studies are integrated by `ef76e0c`.
- Checked restart, frozen coupled coarse trials, physically compatible n3 controls, slices and final convergence/cost/virial evidence are integrated by `d7acb0d`.
## Consolidation and validation risks
1. **Do not promote experimental settings merely because they enter main.** Main can contain tested optional research modules. The final report must explicitly state which settings are defaults, preferred research candidates and failed historical alternatives.
2. **Preserve source provenance.** Campaign numerical executables were copied from specific producer commits. Main integration changes do not retroactively change the meaning of old runs. Keep original commands, metadata, hashes and branch tips, and include relocation manifests when moving results.
3. **Preserve old paths carefully.** Many tracked research reports and JSON manifests refer to evidence under workspace `diagnostics/` using worktree-relative or absolute paths. Relocation requires either stable links or a documented path mapping and adjusted browse links. Do not rewrite original run metadata/hashes simply to make them look current.
4. **Untracked build trees have absolute cache paths.** Moving them may invalidate rebuilds. Preserve them as historical artifacts or use explicit compatible links; configure a fresh consolidation build instead of treating a moved cache as portable.
5. **Do not rerun a full campaign unnecessarily.** A source-equivalent integration needs targeted build/smoke/regression checks around added files and resolved conflicts, not new scientific claims. The previous 24-case audit is a provenance check, not proof that every model converged.
6. **Harmonic support is serial.** A two-rank rejection test is not MPI solver validation. Report this accurately.
7. **No end-to-end target claim.** The latest compatible rotating n3 LDU endpoint remains unconverged; energy/h virial1.81141e-5 and both rho-pressure virials fail1e-5. No 50%-critical calibration exists. Lower finite-budget residuals are not measured mathematical floors.
8. **Documentation import is not new policy.** The log-density reference model is historical isolated analysis. Keep its label explicit and do not present it as an implemented solver option.
## Audit limits
This audit checks ancestry, patch equivalence, source content, defaults and recorded evidence. It does not constitute a new exhaustive correctness review of all 57k lines added since old main, nor a numerical rerun. Exact source comparisons established the particular equivalences above; registration line numbers refer to d7acb0d and can shift during consolidation. The parent integrator should record the final consolidation SHA, any actual conflicts/resolutions, validation results, and the eventual status of the preserved user formatting edit.
## Consolidation update
After the base-snapshot audit, the integrator preserved the user formatting change as `6950dc6` and imported all six log-density documentation/reference commits, ending at `b1fe359` on `integration/research-consolidation-20260920`. Consequently the earlier base-snapshot recommendation to import the log assessment is fulfilled. No numerical behavior was added by those seven commits. The original branch table entries otherwise describe their relationship to `d7acb0d`, not their eventual status after consolidation.

View File

@@ -0,0 +1,41 @@
main 75cc638 perf(allocations): reduced overall allocations by 95%, increaseed jacobian applicatin by 2x
research/baseline-20260916 80cc3d8 Snapshot optimized solver and audit diagnostics before numerical experiments
+ research/central-constraint-20260916 2e19c2c (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/central-constraint) docs: record combined optional-density validation
research/combined-20260916 95d9fba docs: finalize controlled solver campaign and transfer limits
+ research/coupled-convergence-study-20260919 d7acb0d (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement) Record coupled convergence results, virial limitations and validated model slices
+ research/coupled-shape-coarse-20260918 4a6c1b5 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/coupled-shape-coarse) Register isolated coupled shape coarse regression tests
research/coupled-trial-correction-20260918 46249d0 Record coupled correction benefit cost and nonlinear curvature limits
research/damped-coupled-trial-20260918 db854c0 Record audited damping and eligibility results through six Newton updates
research/density-order-study-20260919 ef76e0c Record density-order study, convergence limits, and log-density implications
research/diagnostic-campaign-20260917 7a07cae experiment: record pressure positivity and shape curvature evidence
+ research/experiment-harness-20260916 899cb18 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/measurements) docs: distinguish conservative screening from virial milestone
research/gravity-compact-application-20260917 ff1b889 Validate compact gravity application probe records
+ research/gravity-consistent-schur-20260918 c10d019 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/gravity-consistent-schur) Aggregate gravity baseline equivalence assertions
+ research/gravity-coupling-20260916 db0ddd3 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/gravity-coupling) Document controlled gravity-coupling counterexample
research/gravity-coupling-ablation-20260919 38c7184 Add gravity-only attribution for rotating higher-index gain
research/gravity-curvature-correction-20260917 3762c74 Handle null reduced actions with an absolute derivative floor
+ research/gravity-direction-diagnostics-20260917 47775a9 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/gravity-reduction) Record gravity relift work before descent rejection
research/gravity-prepared-roundoff-20260917 782827c Scale prepared gravity consistency by uncancelled field contributions
research/gravity-reduced-newton-20260917 d25d141 Resolve reduced derivative trend with a recorded four-step diagnostic grid
+ research/gravity-trial-diagnostics-20260917 7f4b068 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/gravity-correction) Update numerical strategy documentation with verified evidence
+ research/krylov-20260916 7127383 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/krylov) Document matched Krylov safeguard results and limitations
+ research/krylov-window-20260916 1f9184b (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/krylov-window) docs: record nonrotating larger-window validation
+ research/linear-coupling-study-20260919 0e6688f (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/linear-coupling-study) Test normalized unbordered adapter and report its storage scope
+ research/log-density-assessment-20260919 90580b2 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/log-density-assessment) Document stellar support contract for log density
+ research/model-slices-20260919 5da3f42 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/model-slices) Preserve slice titles and colorbar labels in saved figure bounds
research/n3-compatible-family-20260919 1d746b0 Add explicit mass-compatible rotating n3 physical-family control
research/n3-linear-ablation-20260919 e78af98 Specify matched n3 gravity-only ablation before attribution
research/n3-live-field-feedback-20260919 1ed03f5 Specify matched live field-feedback trial for rotating n3 family
research/negative-density-diagnosis-20260919 7ed4d23 Record negative density mechanism, interval audits, and resolution options
research/nonlinear-step-obstruction-20260918 2944dd5 Record audited nonlinear obstruction findings and next experiment
* research/numerical-strategies-20260917 10adf7e Record numerical strategy validation and remaining convergence limits
+ research/polynomial-endpoint-certification-20260917 cc6f4b0 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/positivity-certification) Add read-only polynomial endpoint certification mode
+ research/polynomial-positive-newton-20260917 9aefb36 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/positivity-strategy) Reject unsupported pressure traces before polynomial state certification
research/preconditioner-benchmarks-20260918 dc1da62 Finalize preconditioner measurements, physical limits, and reproduction record
+ research/preconditioner-cached-cross-actions-20260918 07769e7 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-cached-cross-actions) Reuse prepared gravity force for stellar cross preconditioning
+ research/pressure-obstruction-20260917 c6572d3 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/pressure-obstruction) Export enthalpy nodal values on limiting diagnostic elements
research/reduced-smooth-surface-20260918 2171b8b Record reduced surface study and audit frozen seed chains
+ research/shape-curvature-20260917 b24e6e0 (/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/shape-curvature) experiment: split frozen operator curvature into shape and field contributions
research/shape-field-displacement-q4-20260918 785a7ae Record audited negative displacement-order trial and physical comparison
research/shape-field-weak-response-20260918 6ceda61 Preserve completed weak-response study while retaining Q3 baseline
research/spherical-harmonic-surface-20260919 1148c09 Record coupled harmonic surface validation and preconditioner baseline

View File

@@ -0,0 +1,148 @@
# Early-history fragment evidence index
Authored fragment: `early.tex`. Scope: original 16 September audit through the bounded reduced-surface study on 18 September. The 19 September native-harmonic, negative-density, density-order, and coupled-convergence material belongs to the companion later fragment.
The fragment cites the report files below; those reports identify exact producer commits, immutable commands, manifests, states, binaries, raw vectors/CSVs, timing exclusions, and audit results. No new FEM solve or numerical result was generated for this section. Archived initial audits are referenced at their proposed final repository paths. Raw campaigns are referenced at the consolidation archive path.
## Sources and hashes
- Final reference: `libmeanfield/interface`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/libmeanfield/interface`
- Exists at consolidation review: `True`
- Final reference: `libmeanfield/impl`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/libmeanfield/impl`
- Exists at consolidation review: `True`
- Final reference: `reports/sources/original_audits/MeanField_audit_2026-09-16.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/MeanField_audit_2026-09-16.md`
- Exists at consolidation review: `True`
- SHA-256: `1249447f7957747575324d2598750f6f819a3023df2ab6fd00c64de39596759d`
- Final reference: `reports/sources/original_audits/MeanField_solver_diagnosis_2026-09-16.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/MeanField_solver_diagnosis_2026-09-16.md`
- Exists at consolidation review: `True`
- SHA-256: `d00befb23099256f8d38e57f3f9f2d5ed4192c2984afb935ec94e36e64675c0c`
- Final reference: `reports/sources/original_audits/formulation_audit_notes.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/formulation_audit_notes.md`
- Exists at consolidation review: `True`
- SHA-256: `e49441556f34295e140e4841fc95e6c9d6b675c8f2b1ff6a113d81d8f3006311`
- Final reference: `experiments/POLYTROPE_VALIDATION_FINDINGS_2026-09-09.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/POLYTROPE_VALIDATION_FINDINGS_2026-09-09.md`
- Exists at consolidation review: `True`
- SHA-256: `53c40e6c519bf1e5bf945b7cae2d4f8de0897aa3180cda4bc3876900b533078b`
- Final reference: `experiments/POLYTROPE_H_CONVERGENCE_2026-09-09.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/POLYTROPE_H_CONVERGENCE_2026-09-09.md`
- Exists at consolidation review: `True`
- SHA-256: `bdcc74edcd7b0caf48592d630dffac1fa758f576a4a2f8835f0bf3ca2fcc8bbc`
- Final reference: `experiments/NUMERICAL_CAMPAIGN_2026-09-16.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/NUMERICAL_CAMPAIGN_2026-09-16.md`
- Exists at consolidation review: `True`
- SHA-256: `ace2bc10d645e53fdbc6a6c61e2bd26ba9ab8bdffd37e918ba633a7dd3ce7b11`
- Final reference: `experiments/CENTRAL_CONSTRAINT_HYPOTHESIS_2026-09-16.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/CENTRAL_CONSTRAINT_HYPOTHESIS_2026-09-16.md`
- Exists at consolidation review: `True`
- SHA-256: `cde87179c80a71c133005ca9e28ca8152ff6d7d95cb8a12c4689407540dd1f74`
- Final reference: `experiments/KRYLOV_WINDOW_HYPOTHESIS_2026-09-16.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/KRYLOV_WINDOW_HYPOTHESIS_2026-09-16.md`
- Exists at consolidation review: `True`
- SHA-256: `0c45627584da5c6fcf6f1c2bdbe1350634467bc44214e83a8bb2c9ad4e0d647a`
- Final reference: `experiments/KRYLOV_HYPOTHESIS_2026-09-16.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/KRYLOV_HYPOTHESIS_2026-09-16.md`
- Exists at consolidation review: `True`
- SHA-256: `cf98c38da0a60f289f6ef9050f4fc6dccb805d51350eeb6ebe7f31f22cff284a`
- Final reference: `experiments/PRESSURE_AND_SHAPE_CAMPAIGN_2026-09-17.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/PRESSURE_AND_SHAPE_CAMPAIGN_2026-09-17.md`
- Exists at consolidation review: `True`
- SHA-256: `a605a69ed95a227515738be264f87f9e82110309c159df23909affbf2c78a1d0`
- Final reference: `experiments/PRESSURE_OBSTRUCTION_METHODOLOGY_2026-09-17.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/PRESSURE_OBSTRUCTION_METHODOLOGY_2026-09-17.md`
- Exists at consolidation review: `True`
- SHA-256: `b44afc0095ecc19497788ba02f71313b59c362e378d652df8a7becaa2d7bb180`
- Final reference: `experiments/POLYNOMIAL_ENTHALPY_ADMISSIBILITY_2026-09-17.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/POLYNOMIAL_ENTHALPY_ADMISSIBILITY_2026-09-17.md`
- Exists at consolidation review: `True`
- SHA-256: `232dd20d2ba3eba6139d0d80762b49b4f6d532caaeca7a3294923904a168e639`
- Final reference: `experiments/NUMERICAL_STRATEGIES_2026-09-17.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/NUMERICAL_STRATEGIES_2026-09-17.md`
- Exists at consolidation review: `True`
- SHA-256: `f06b7ca146aa77e4cb1f2a4f345463c0f6678a1965a6741944f68e3a6b88cf92`
- Final reference: `experiments/GRAVITY_SUBSYSTEM_IMPLEMENTATION_2026-09-17.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/GRAVITY_SUBSYSTEM_IMPLEMENTATION_2026-09-17.md`
- Exists at consolidation review: `True`
- SHA-256: `221660080749ac28505786df4a7c9f501e441512304116d869ec1ef660b1136f`
- Final reference: `experiments/GRAVITY_REDUCTION_IMPLEMENTATION_2026-09-17.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/GRAVITY_REDUCTION_IMPLEMENTATION_2026-09-17.md`
- Exists at consolidation review: `True`
- SHA-256: `193d33f5e219918e62dc266aeac00a59a2c44e7b917a461062f7820593763474`
- Final reference: `experiments/GRAVITY_COMPACT_APPLICATIONS_2026-09-17.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/GRAVITY_COMPACT_APPLICATIONS_2026-09-17.md`
- Exists at consolidation review: `True`
- SHA-256: `5949c6e62eb78f34af5a5a2651a8b28af6ad997cfc34d2d8b0491105917e3109`
- Final reference: `experiments/GRAVITY_PREPARED_ROUNDOFF_2026-09-17.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/GRAVITY_PREPARED_ROUNDOFF_2026-09-17.md`
- Exists at consolidation review: `True`
- SHA-256: `2383781c80b7c251859456df7a66acc323bed3a07816fe94d6d410b083effa77`
- Final reference: `experiments/PRECONDITIONER_IMPROVEMENT_2026-09-18.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/PRECONDITIONER_IMPROVEMENT_2026-09-18.md`
- Exists at consolidation review: `True`
- SHA-256: `6aecb98da933a9aaa00f071f1723b2848b0c33e36e3cd98e52b198dba3fe8353`
- Final reference: `experiments/GRAVITY_CONSISTENT_SCHUR_2026-09-18.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/GRAVITY_CONSISTENT_SCHUR_2026-09-18.md`
- Exists at consolidation review: `True`
- SHA-256: `8f54dac778a276f78fc37b724ab616b96e5197f8ace7018f0d1b9527f23e970d`
- Final reference: `experiments/PRECONDITIONER_CACHED_CROSS_ACTION_2026-09-18.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/PRECONDITIONER_CACHED_CROSS_ACTION_2026-09-18.md`
- Exists at consolidation review: `True`
- SHA-256: `79f1b1a2be1de88cd3f1aefd9905fabc86eee7370a67e160dbecba43f0963fe9`
- Final reference: `experiments/NONLINEAR_STEP_INVESTIGATION_2026-09-18.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/NONLINEAR_STEP_INVESTIGATION_2026-09-18.md`
- Exists at consolidation review: `True`
- SHA-256: `241dd723f310892761b4b11074530b70e216f39097cf7a9c4f6ffe2d54befc5d`
- Final reference: `experiments/COUPLED_TRIAL_CORRECTION_2026-09-18.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/COUPLED_TRIAL_CORRECTION_2026-09-18.md`
- Exists at consolidation review: `True`
- SHA-256: `7995e496f90e634127a30c22f0a2499b7b18b15882acec3ea2a6bf1ec7cee5c7`
- Final reference: `experiments/DAMPED_COUPLED_TRIAL_2026-09-18.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/DAMPED_COUPLED_TRIAL_2026-09-18.md`
- Exists at consolidation review: `True`
- SHA-256: `cc4d5e29b71695796fe7c2bed58346a017895daf21abb217b23bd26494bc3f22`
- Final reference: `libmeanfield/interface/field/field_registry.cppm`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/libmeanfield/interface/field/field_registry.cppm`
- Exists at consolidation review: `True`
- SHA-256: `45b54aaf7f56c11f74d6fc0f4785612b3f2aca3922e10feaedb6db5048881084`
- Final reference: `experiments/SHAPE_FIELD_WEAK_RESPONSE_2026-09-18.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/SHAPE_FIELD_WEAK_RESPONSE_2026-09-18.md`
- Exists at consolidation review: `True`
- SHA-256: `971f1dfd08a83625cb267c4be0d660dd63c4b5c894845ad69d11f7e93843696b`
- Final reference: `experiments/REDUCED_SURFACE_STUDY_2026-09-18.md`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/experiments/REDUCED_SURFACE_STUDY_2026-09-18.md`
- Exists at consolidation review: `True`
- SHA-256: `353474b9a7bc3eee0677a068cd906f1f136fc7ad73ed2fdbf710a7901210b5b6`
- Final reference: `working/research/diagnostics/reduced_surface_2026-09-18`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/diagnostics/reduced_surface_2026-09-18`
- Exists at consolidation review: `True`
## Numerical interpretation controls
- Original audit HEAD alone was not the source under test; incoming optimized changes were preserved at baseline `80cc3d8`.
- All time-to-convergence comparisons require both frozen endpoints to pass the same independently measured full-J true gate. Failed controls have no finite measured time-to-convergence.
- Nonlinear matched pairs follow evolving trajectories; fixed-update endpoint improvements are not speedups to the same solution.
- Sampled and certified positivity are distinguished; enthalpy certification never certifies independent density.
- All early J and Omega values are reference-unit inputs/results, never fractions of critical rotation.
- Q4-only displacement enrichment is a retained negative experiment, not a recommended main-branch order change.
- The L2/L4/L8 frozen reduced-surface study changes test/approximation space; reduced gates do not imply original full gates.
- Original coarse shape residuals/excluded-force results remain visible even when the reduced norm and virial improve.
- Original 40/160-restart controls, n=3 central border, initial beta/alpha grids, timer exclusions and unavailable timeout endpoint are described explicitly.
## Source limitations
This history is synthesized from the saved primary project reports and their recorded artifact measurements. It does not independently rerun every FEM measurement. Later corrections and clarifications within those reports take precedence over earlier provisional summaries. The consolidated report should retain the reports and raw campaign directories so future investigators can reproduce individual measurements.
## Consolidation precision checks
The normalization summary was checked directly against the separate value/residual registrations in `physical_riesz.cppm` (lines 408–463). The seed description was checked directly against its two `ProjectCoefficient` calls in `stellar_equilibrium_projection.cpp`; it now distinguishes coefficient initialization from solving the weak closure weighted L2 projection. Mathematical Jacobians are denoted A, while J continues to denote angular momentum.
- Final source reference: `libmeanfield/interface/normalization/physical_riesz.cppm`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/libmeanfield/interface/normalization/physical_riesz.cppm`
- SHA-256: `5f47f07687843705bc29d908dd8b96f35b3a1138c833e18d0d28b56c77d034be`
- Final source reference: `libmeanfield/impl/seed/stellar_equilibrium_projection.cpp`
- Read source: `/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/libmeanfield/impl/seed/stellar_equilibrium_projection.cpp`
- SHA-256: `c7e6c795bebccd723fea25f02c6b49fe192031d6dc58d7acf1e8a88770425152`

View File

@@ -0,0 +1,37 @@
[
{
"source": "working/research/diagnostics/coupled_convergence_2026-09-19/figures_n3_v2/n3_J0p035_K0p99_ldu_xz.png",
"report_figure": "reports/figures/n3_ldu_meridional.png",
"sha256": "3c83ed97704b81668880a63c246fb911bb42be03835342748118525dfb872f64"
},
{
"source": "working/research/diagnostics/coupled_convergence_2026-09-19/figures_n3_v2/n3_J0p035_K0p99_ldu_xy.png",
"report_figure": "reports/figures/n3_ldu_equatorial.png",
"sha256": "3d690de1b53bce5b20fceb8b070b43f8c66782ccdebff84f280a8094329b6b2b"
},
{
"source": "working/research/diagnostics/coupled_convergence_2026-09-19/figures_slices_v2/n1p5_rotating_xz_s4_s8.pdf",
"report_figure": "reports/figures/n1p5_rotating_refinement.pdf",
"sha256": "ba0fe7bc9d104119f155aeae46d9e1e61d71948cadcce24e088a6ccf370e5dd0"
},
{
"source": "working/research/diagnostics/coupled_convergence_2026-09-19/figures/linear_rates/frozen_linear_rates.pdf",
"report_figure": "reports/figures/frozen_linear_rates.pdf",
"sha256": "7d3849e7e65af6c2f0cb37607e5741b80a1c75772e8ca09488b8265494097dc3"
},
{
"source": "working/research/diagnostics/coupled_convergence_2026-09-19/figures/convergence/n2_paired_convergence.pdf",
"report_figure": "reports/figures/n2_paired_convergence.pdf",
"sha256": "aac7c7f935d3d1d46000fb08569093c2bbdf9f2c09e14b10929fdc549a9a45a2"
},
{
"source": "working/research/diagnostics/coupled_convergence_2026-09-19/figures/convergence/n3_paired_convergence.pdf",
"report_figure": "reports/figures/n3_initial_paired_convergence.pdf",
"sha256": "314d51d6848fb5369b4e89940b84f1ae9cc25deafb1980df544f65203de1498f"
},
{
"source": "working/research/diagnostics/coupled_convergence_2026-09-19/figures_slices_v2/n1p5_rotating_xz_s4_s8.png",
"report_figure": "reports/figures/n1p5_rotating_refinement.png",
"sha256": "4561b09a64ab3492bc2ed85b3ce042079435cb70ee297bdc0e838dde9673f952"
}
]

View File

@@ -0,0 +1,239 @@
d7acb0d399aac5ac4c36d834a954c1c959042b81 2026-09-19T17:09:32-04:00 Record coupled convergence results, virial limitations and validated model slices
2c6523b1ce8f080c073a818cfee58f01b737045b 2026-09-19T17:05:46-04:00 Preserve slice titles and colorbar labels in saved figure bounds
5da3f42d397355964d5fb53c5395aa04a2f2cf6d 2026-09-19T17:05:46-04:00 Preserve slice titles and colorbar labels in saved figure bounds
07799bca34ee191baeb9b56d16d6c9e7a15b1492 2026-09-19T16:25:45-04:00 Space slice colorbar labels in normalized color coordinates
91e3813838f9511f89d858ef3fc52b6de129443f 2026-09-19T16:25:45-04:00 Space slice colorbar labels in normalized color coordinates
1ed03f56833817114bc99bec4e6f12b0dfd8add6 2026-09-19T16:10:38-04:00 Specify matched live field-feedback trial for rotating n3 family
38c7184b5c32d47c4e98cdaaf7f2f782297ee49b 2026-09-19T16:01:29-04:00 Add gravity-only attribution for rotating higher-index gain
2aabfc4d35aabbda58990b6dec86dfbfb3c13e9e 2026-09-19T15:52:11-04:00 Plot audited frozen linear histories and checked endpoint gates
76ba3535913c572f8bb687e73af180763fb364a9 2026-09-19T15:52:11-04:00 Plot audited frozen linear histories and checked endpoint gates
e78af98e2b62efc84c0042dd78a357ca7a37822e 2026-09-19T15:44:25-04:00 Specify matched n3 gravity-only ablation before attribution
df86e84b76ba77282444c843e2d84257afdc2bf3 2026-09-19T15:29:16-04:00 Record audited nonlinear controls and interior diagnostics
476118cfaa87f735a7b9abd7a69fe5ebab6e417f 2026-09-19T15:11:09-04:00 Show local restart progress alongside full convergence threshold
8fc43379d5641c5ed93d1f9e94774684a5f3f37c 2026-09-19T15:11:09-04:00 Show local restart progress alongside full convergence threshold
f2c1a369a6f63fc1d105e52c17d0224d2dd1ac02 2026-09-19T15:06:17-04:00 Specify tight frozen-direction trials after gravity-path stall
a458af0a7a14b03368b80a27ae208928e2e07250 2026-09-19T14:57:43-04:00 Plot audited paired Newton convergence with actual thresholds
bb1ca336819ba7637792eed4b76349a7c3e9c17d 2026-09-19T14:57:43-04:00 Plot audited paired Newton convergence with actual thresholds
d62487f2d10789308848cebe5d1e97b9b471e195 2026-09-19T14:48:26-04:00 Add field-feedback controls and document the actual material factorization
cc22383562e9d6c41a150e74e7058cb2ce5e131a 2026-09-19T14:27:04-04:00 Target the combined rotation stall and its physical slice refinement
99eb86fedc72196b1e7bcb1e7e369b4693216f58 2026-09-19T14:19:59-04:00 Audit frozen slice replays and specify same-state refinement controls
a1df4d9f84f57f2ad4d5d6a5041b7bd3fbb64df3 2026-09-19T14:16:35-04:00 Record control outcomes and specify a matched rotating-state benchmark
6614a5bdf65aa2faee6c50991e6e910af256280b 2026-09-19T14:15:35-04:00 Compare physical slice refinement with shared scalar rendering
4b3da551abb7ab1a51af792f4d6d1fdd8aed306d 2026-09-19T14:15:35-04:00 Compare physical slice refinement with shared scalar rendering
5f8458c9cc416da8f354ebc540723cdf58c6c331 2026-09-19T14:07:40-04:00 Audit retained convergence evidence and distinguish compatible physical families
f9355bdc8f28eb5d7b5e6c059b1c970ce2763b6b 2026-09-19T14:03:31-04:00 Document curved slice conformity and refinement limits
f2d8f21d98e362c496d0b93429a8ae9d4537c56c 2026-09-19T14:03:31-04:00 Document curved slice conformity and refinement limits
1d746b028ef001782158a0a82d81b40eb933b68a 2026-09-19T13:58:08-04:00 Add explicit mass-compatible rotating n3 physical-family control
6d423cba46c6e7d2e4b3020902fd8e21f79ed4a6 2026-09-19T13:56:36-04:00 Specify gravity-path and matched Schur experiments from the measured n2 stall
9bac57a1df7bb9c6cca949b62eb40c5639d88ded 2026-09-19T13:46:11-04:00 Add physical-plane FEM model slice diagnostics and plots
7793fd91118cab950abbc0b2cfcac8023593fb31 2026-09-19T13:46:33-04:00 Keep restart input provenance separate from destination output records
522a2cfc021c8ba0b803b4d732c8e56461f10f70 2026-09-19T13:45:57-04:00 Test normalized unbordered adapter and report its storage scope
966a4d4e0583832ee0e6df9b0b4f298b71300f55 2026-09-19T13:46:11-04:00 Add physical-plane FEM model slice diagnostics and plots
0e6688f500873fb5cb3ecae783c90faa6d952159 2026-09-19T13:45:57-04:00 Test normalized unbordered adapter and report its storage scope
2398118b347b2b47b8004be8334b21cf3d11a615 2026-09-19T13:43:21-04:00 Add frozen surface and scalar Schur preconditioner experiment
53faac1cd202971bb7fc2a29898c6467a4e5b0b3 2026-09-19T13:43:49-04:00 Add checked harmonic snapshot continuation and matched linear trial diagnostics
1d956023446217802ea943a2af8bad0b25786db7 2026-09-19T13:43:21-04:00 Add frozen surface and scalar Schur preconditioner experiment
77130fa6033512e954b59f6d396d5c3eb1f5f406 2026-09-19T13:31:11-04:00 Define coupled harmonic convergence screen and evidence controls
ef76e0c7860d3972f4993e406defe9dd24dcc05b 2026-09-19T13:12:41-04:00 Record density-order study, convergence limits, and log-density implications
90580b23f9b170db7fffd3e5bb86a9a1f9927f9c 2026-09-19T13:05:53-04:00 Document stellar support contract for log density
c0a496e9d6666403a50df79869c07256380c30c3 2026-09-19T12:46:04-04:00 Preserve all trial preparation and disposition counts in reports
e054c7464c6b2942c714315eb55d4fc4092345dd 2026-09-19T12:16:56-04:00 Check non-density layouts across separately audited orders
4f7eaff5be0ccf28a805a2511a9995252df40b08 2026-09-19T12:14:07-04:00 Document MESA log density and atmosphere analogy
903615f10f45356a58fd14d5c914639baf7ecde0 2026-09-19T12:06:37-04:00 Separate uncertain density observations from plotted trends
ecde703c83badefab6a78da677d34f61633d7579 2026-09-19T12:04:27-04:00 Clarify finite precision positivity of log density
66debb6aae1dc048813204fbc44ff9994d4febbf 2026-09-19T11:22:04-04:00 Clarify local log-matrix scope and independent pressure admissibility
cd71f374f0b11db74680530bd03e273371708fca 2026-09-19T11:21:26-04:00 Audit trial rejection stages and expose line-search obstruction counts
54102b4f3c8d61360b963b7d7288d8b4c461b4d5 2026-09-19T11:15:28-04:00 Retain unbordered residual and central-border diagnostics in summaries
d34ae09fc4d790b594e88b57f70b2854941fb59a 2026-09-19T11:09:06-04:00 Audit actual stellar closure quadrature rules and support
c0e8551cbd8d54a141d3ad06ddd75a93037be146 2026-09-19T11:04:49-04:00 Summarize audited density-order results and scientific comparisons
241621ce8667647fc7fa0dfe252479139225f660 2026-09-19T10:53:34-04:00 Report sliced moment quadrature differences without identity gates
4ff1b10693255eaef5ec0f5fa6c4d81929a4ce14 2026-09-19T10:52:33-04:00 Separate surface and interval-witness enthalpy observations
e21f723fdfd43fcea834d317819488e10124d048 2026-09-19T10:51:44-04:00 Exercise rectangular gravity coupling and normalization in order-study checks
8c1cc3187409df764afa646f198b71f576e59058 2026-09-19T10:49:37-04:00 Audit density-order evidence and distinguish observation from certification
8d5ed607dc94540cb95f5b5b919a6d968e840e9a 2026-09-19T10:49:29-04:00 Clarify scope of coefficient positivity in log assessment
2ca6890a187721afff4bddb0568908302303c4e8 2026-09-19T10:48:14-04:00 Add controlled density-order projection and coupled-solve observations
dd955abca5fbe680d3769ae16718c8e0c30315b4 2026-09-19T10:47:58-04:00 Cover both density mass and EOS source in closure quadrature
47f27b2f6e6a4c7c5a511564dd39a577460aa99c 2026-09-19T10:35:48-04:00 Assess independent log density coordinates and exact vacuum
d6554cae6bd5b04673643f92fe0821aad3eeeeb6 2026-09-19T10:26:54-04:00 Reuse field and closure validation in a focused density-order test target
c7383e12ffb25892e9353ec323d63fa7d4c3c603 2026-09-19T10:25:55-04:00 Make density approximation order an independent compile-time choice
7ed4d232d0209dc209082c983f18f2e256a32742 2026-09-19T10:16:03-04:00 Record negative density mechanism, interval audits, and resolution options
d1a594808f960bbaeeb6df8a8ce6a95458765b19 2026-09-19T10:06:10-04:00 Integrate frozen negative density over polynomial root intervals
9c22934d52b369f96364e781d6a4843939ec9523 2026-09-19T09:46:52-04:00 Add frozen negative density localization and independent EOS projection diagnostics
1148c099e3c5839a63880ae13d2ad6602402b13f 2026-09-19T09:22:36-04:00 Record coupled harmonic surface validation and preconditioner baseline
7b0eb8d92d0f550f1fe3fb19cd8eecc52dc80c56 2026-09-19T08:51:42-04:00 Add native spherical harmonic surface coordinates to coupled equilibrium
2171b8b76ad78856323fdbcf3d2c537d9039201f 2026-09-18T16:14:34-04:00 Record reduced surface study and audit frozen seed chains
21cdbda22486e408adc52b65b25413f9380c7c30 2026-09-18T15:45:05-04:00 Add frozen smooth-surface restriction study with physical dual maps
6ceda61bddc0d4881d9f7ac98d170d07980a963d 2026-09-18T14:27:15-04:00 Preserve completed weak-response study while retaining Q3 baseline
785a7aedac72c810bb624c2b7be6b4f9a05ef6e8 2026-09-18T14:26:36-04:00 Record audited negative displacement-order trial and physical comparison
4be1a23c3ec2650af6a2a49528a8f5248cb001c3 2026-09-18T13:46:11-04:00 Trial Q4 displacement and surface representation with all material and gravity orders fixed
211be17190fd71ee979805b067b8c31d4bd91550 2026-09-18T13:45:27-04:00 Record audited shape-field compensation and cubic surface structure before order trial
2c4a5e05a669eadcdc02c29d08e0dc4d56010320 2026-09-18T13:31:14-04:00 Audit physical compensation artifacts and verify quartic affine displacement representation
d79db9445bfd41dc204927c91784a8bd3cddb6f3 2026-09-18T13:20:03-04:00 Add frozen physical shape-field compensation diagnostics and controlled order study plan
db854c0f7cdf5137e377273499f0ac5b6053b752 2026-09-18T12:13:53-04:00 Record audited damping and eligibility results through six Newton updates
18762298c1c4f51abfde4ada1e98374694ba7ae7 2026-09-18T11:40:36-04:00 Record independent campaign clocks and matched Newton follow-up cases
25816d4328c2da88cd476877ad682fde4676a886 2026-09-18T10:49:44-04:00 Match frozen trial metric validation to production backtracking
422c46bcbf7e19f7b52dcbb98c7e6c150249c696 2026-09-18T10:45:45-04:00 Add bounded coupled damping and prediction-based attempt selection
46249d0758e1c30f7585d35821f78cd558197cec 2026-09-18T10:21:19-04:00 Record coupled correction benefit cost and nonlinear curvature limits
0c926f40df41402812997cd67cfba2b0e4e1e116 2026-09-18T10:14:09-04:00 Generate matched scalar controls for coupled trial attribution
5aa48dcf8047cbd53dafb0c377e260629675ae9e 2026-09-18T10:07:46-04:00 Keep coupled evidence audit linear in state size and repeat raw timing
2d0d32b886407eee4b3f7f654a4507da9c0fa243 2026-09-18T09:52:30-04:00 Audit coupled trial artifacts and physical replay independently
0d87b8b919a9eecac73e23aa006f336d94194786 2026-09-18T09:41:00-04:00 Add bounded fully coupled second-order trial correction and frozen screen
2944dd5019ab8aaca60e147db010d7fded7fd916 2026-09-18T09:10:28-04:00 Record audited nonlinear obstruction findings and next experiment
db93bf73b629b7a05638245d6fb0e617c37ce6db 2026-09-18T08:59:52-04:00 Record constrained two-direction algebraic control
0b0ab9cd1836da75553673149fd15da4eb33d36f 2026-09-18T08:47:19-04:00 Plot audited nonlinear paths and matched direction controls
b8d1c6a5abc2bcd634175d45059b2da60248e00c 2026-09-18T08:37:54-04:00 Independently audit frozen nonlinear path vectors and provenance
ba057b3983ff6006e460a1fa80e3e6523ceeb4a5 2026-09-18T08:26:51-04:00 Add frozen nonlinear path and mixed curvature investigation
690c8ddc9ac339ce9ee2cc4d9ef3366121050f4a 2026-09-18T08:19:26-04:00 Clarify frozen endpoint scope and gravity target interpretation
1d98fff171e30fca5aeac8f0e3657caacd69003c 2026-09-18T08:16:27-04:00 Record frozen late-state probe and matched direction controls
d82540a13c4245cc2fc02233a13154da1b112b8b 2026-09-18T08:14:07-04:00 Record preconditioner conclusions and define next nonlinear obstruction investigation
dc1da62b2c2856112f49239c42b9020dc151cd78 2026-09-17T18:17:54-04:00 Finalize preconditioner measurements, physical limits, and reproduction record
83afd824ef49925550fe00926fc567c3b46443fc 2026-09-17T18:09:41-04:00 Record rotating linear gate success and bounded nonlinear follow-through
5298d88ed0ce98830bd900553de6a2912ff0fb95 2026-09-17T18:03:56-04:00 Document higher-index nonlinear limits after Schur refinement
031b02f3da6b9deee233ecc3b4f186d7cc95de75 2026-09-17T17:53:07-04:00 docs: clarify preconditioner experiment results and timing
30a99435a805abc9b592e1c169fae06eb0bd621f 2026-09-17T17:51:12-04:00 Document equal-accuracy gain and preserved virial regression
7b4f674ed5327d47e67854164ede181a5fd0b5b8 2026-09-17T17:36:48-04:00 Enable combined stellar LDU gravity Schur Newton experiment
107c66b192baff9a0b88b2774b9cd272d4c6ef9c 2026-09-17T17:35:21-04:00 Record complementary rotating coupling confirmation
bed1893cfbadb2946403cea26c8c8c66e0c960cf 2026-09-17T17:18:42-04:00 Record measured preconditioner screen and validation limits
4a6c1b5c26a352a8afb30feb0a2f3821aac9ee19 2026-09-17T17:18:18-04:00 Register isolated coupled shape coarse regression tests
15464da5951092f74e440b97dba6a44a04ead141 2026-09-17T16:55:20-04:00 Compile and verify radial coarse basis through existing FEM surface map
87569c03dd47d4ce3435c3410d41b0c94a94ccfe 2026-09-17T17:11:29-04:00 Record Newton and virial regressions for consistent gravity preconditioning
74d94bd275ae53679c707f1302f9a411e160be7b 2026-09-17T17:10:15-04:00 Record equal-accuracy gravity Schur confirmation cases
c2bd8fc9c9c4e79854683044d0f9aa2131cb4d16 2026-09-17T17:06:26-04:00 Document verified Schur coverage and MPI fixture limitation
fcb7833844e1636572f03c001e7fe51243789349 2026-09-17T17:05:44-04:00 Wire typed experimental preconditioners into Newton diagnostics
dc8d4b0501e2775b0d1938005e142411319d78b1 2026-09-17T16:55:20-04:00 Compile and verify radial coarse basis through existing FEM surface map
b3bd2440246ebabb2b470284c4dbd3785967a7c9 2026-09-17T16:48:14-04:00 Record matched preconditioner controls and candidate rationale
52474587ddee8bd6684668d52935b9729be946d5 2026-09-17T16:45:55-04:00 Guard coarse exactness diagnostics and report complete setup work
48cb8c527fb25e3fb82866e80d578cdb43a8c2ef 2026-09-17T16:42:22-04:00 Validate coarse preconditioner evidence and fallback comparisons
370dbbf73bd976f11cb80893ec8d6a4842e1faa3 2026-09-17T16:37:32-04:00 Compare cached coupling and checked coarse preconditioner variants
995d49b81347a1c68609e248a4d21c485bf2d9d5 2026-09-17T16:35:10-04:00 Prototype deterministic coupled shape coarse inverse for frozen benchmarks
47f76968a819a25c57997222375579edbb42d983 2026-09-17T16:35:10-04:00 Prototype deterministic coupled shape coarse inverse for frozen benchmarks
fac147774aeb965e0166d9c8629c13b5f17e7b62 2026-09-17T16:28:56-04:00 Reuse prepared gravity force for stellar cross preconditioning
07769e7c5d572964a9b159c8dbe89871a067346a 2026-09-17T16:28:56-04:00 Reuse prepared gravity force for stellar cross preconditioning
7f7d7b1cfafb74a2adafa31e09ac115f17765f9b 2026-09-17T16:28:42-04:00 Recognize zero-sweep gravity benchmark controls
30b94b75b3d90eff1d0d7fcdad5cf0e42ac41895 2026-09-17T16:24:47-04:00 Aggregate gravity baseline equivalence assertions
c10d019411fbde9dde45c4c7cadc80e0e6334dd7 2026-09-17T16:24:47-04:00 Aggregate gravity baseline equivalence assertions
61a44fc853de826a101f3f16c3af556b01808cd3 2026-09-17T16:24:42-04:00 Validate preconditioner evidence before claiming speedups
bc3c39dcfdc80a94960ddf0861296fe3ed0d1526 2026-09-17T16:23:13-04:00 Benchmark isolated and coupled gravity Schur refinements
b18f41f88f54cebc408f40b0650ce59456611a24 2026-09-17T16:19:22-04:00 Add fixed-work mass-consistent gravity Schur refinement
389a4fd7d76b9011eda28e91c5446b34b89655d1 2026-09-17T16:19:22-04:00 Add fixed-work mass-consistent gravity Schur refinement
018fc1c9924b73640074b823a9d16270de945148 2026-09-17T16:17:21-04:00 Record reproducible hard-state preconditioner screen cases
e557e6b481a49609d4f4da816f3bb4c6db5a7ce1 2026-09-17T16:16:46-04:00 Add matched frozen-state preconditioner benchmarks
10adf7ec3783b27976cb9cf52728f8269819a685 2026-09-17T12:40:48-04:00 Record numerical strategy validation and remaining convergence limits
c82e68dd7e73bdb31fa8ce9d8f80652e087203c4 2026-09-17T12:17:10-04:00 Record gravity relift work before descent rejection
47775a9aaa71874837be17b0c61a3fe1d1a491f1 2026-09-17T12:17:10-04:00 Record gravity relift work before descent rejection
b9e679499988bc7124699abe9e613dd6e1a07868 2026-09-17T12:09:57-04:00 Update numerical strategy documentation with verified evidence
7f4b068a39e45f58ba85acf84c488697aa5a8055 2026-09-17T12:09:57-04:00 Update numerical strategy documentation with verified evidence
8b307b43d37381415f466be78dcf1f5ddd5b4e66 2026-09-17T11:53:12-04:00 Retain iteration snapshots in numerical strategy campaigns
a2871e11e21527d8c7b8d8d436cb0f543bf93cd6 2026-09-17T11:01:13-04:00 Clear unavailable gravity measurements before each attempt
82568639f73efe3b7f04c10f7692f6d7d176b8a7 2026-09-17T11:01:13-04:00 Clear unavailable gravity measurements before each attempt
7e1ab69fcd191717bdf88c918c35ae6ddc725f23 2026-09-17T10:51:07-04:00 Add read-only polynomial endpoint certification mode
cc6f4b08190f1c5e4b63e13f0643e592dfae7a90 2026-09-17T10:51:07-04:00 Add read-only polynomial endpoint certification mode
b21fa4024963678cf8e0a214f62cd7767ef0f259 2026-09-17T10:29:23-04:00 Exercise combined polynomial and reduced gravity model steps
01169861c620d939e58f92b66631ccd77c6b43a2 2026-09-17T10:23:43-04:00 Validate compact gravity application probe records
ff1b889e2c316f1adc2cc4aac5aa169e665994bd 2026-09-17T10:23:43-04:00 Validate compact gravity application probe records
0bf260f04d2594f3a9063761f85579c2127f0607 2026-09-17T10:22:25-04:00 Record gravity arithmetic diagnostics and bounded model campaign
6a91cfaf067e1c4fb8c6cd05ca4c06108dfc5d7f 2026-09-17T10:21:05-04:00 Scale prepared gravity consistency by uncancelled field contributions
782827c25890d849c58acd3a27840ddea3e5fb09 2026-09-17T10:21:05-04:00 Scale prepared gravity consistency by uncancelled field contributions
f77c7d2b292882bce362206d5154225d046d21c0 2026-09-17T10:19:17-04:00 Compare compact gravity applications against full FEM blocks
3307191f2df60d1e60b411516447ed3d61087985 2026-09-17T10:17:19-04:00 Keep unrecognized physical runtimes on gravity fallback
497de707f59ceba2cf6e76ef4c0a14c2fcd86e21 2026-09-17T10:17:19-04:00 Keep unrecognized physical runtimes on gravity fallback
071417f0c11fe87bd1cd189f2951b3763961ad59 2026-09-17T10:15:57-04:00 Reject unsupported pressure traces before polynomial state certification
6e812aeca29e7af69efbd6ec515ac2df5b09f6b3 2026-09-17T10:15:35-04:00 Apply canonical gravity blocks without full root work
2c64a9259838a494effd32aeb08ed33539da5fa4 2026-09-17T10:16:14-04:00 Register compact gravity tests on isolated branch
9aefb364a42440ddb38d68df9e64c61761131113 2026-09-17T10:15:57-04:00 Reject unsupported pressure traces before polynomial state certification
842bd9bf808e19292edabdc6905938e1ec29ca48 2026-09-17T10:15:35-04:00 Apply canonical gravity blocks without full root work
b7ea1bdcf8e75e6e663ee7fbc20c08323c1424db 2026-09-17T10:09:24-04:00 Resolve reduced derivative trend with a recorded four-step diagnostic grid
d25d14147110fb4aa0485c5a0920f8d88390a1ad 2026-09-17T10:09:24-04:00 Resolve reduced derivative trend with a recorded four-step diagnostic grid
2e319172693f5a29d0e371bf260852b29b70c6e4 2026-09-17T10:09:22-04:00 Distinguish strategy failures and expose the actual trial tangent
5f3eb0b18cc0e0173851fe17681913632ebda225 2026-09-17T10:00:46-04:00 Mark unvisited enthalpy repair checks as unresolved
6b10e68ed3889996bfb896028089844185b97ac7 2026-09-17T09:54:34-04:00 Use nondeprecated subnormal prerequisite for C++23 certificates
485e80245374843b184fbeb13d7ea9cc0bfcffd8 2026-09-17T09:50:21-04:00 Make zero-correction strategy fixture independent of equality stopping
cc738b0b906edd76ff4e74500d9ea9efeaaca9ad 2026-09-17T10:00:46-04:00 Mark unvisited enthalpy repair checks as unresolved
6485da95c042a52be3848b039a7634eb93a97be3 2026-09-17T09:54:34-04:00 Use nondeprecated subnormal prerequisite for C++23 certificates
7f8b6fb72d30aae9918cfe64b7552bb8f563279c 2026-09-17T09:50:21-04:00 Make zero-correction strategy fixture independent of equality stopping
4ae2f3f13494f95f3589d7ad21ef2c730f0a07f2 2026-09-17T09:45:56-04:00 Handle null reduced actions with an absolute derivative floor
3762c74f033941e8e97f4dee1748ee8f3fb49c36 2026-09-17T09:45:56-04:00 Handle null reduced actions with an absolute derivative floor
c393847c6f6d7730d6964632b9cd506384ed0bf6 2026-09-17T09:45:05-04:00 Integrate typed Newton strategies with checked trial gravity and feasibility
a7d646d04979692f780cdaf00d6c1ec7310323fc 2026-09-17T09:44:04-04:00 Check frozen numerical strategies without conflating incomplete evidence with success
e5999007f5b75b9d579d92e741cb871fc87f7b03 2026-09-17T09:44:38-04:00 Register isolated gravity-correction module and tests
b32ec078d4b09e7b0dd6fe31ff515035595e3ca0 2026-09-17T09:44:04-04:00 Check frozen numerical strategies without conflating incomplete evidence with success
237485de5102d70ea72e82720456c7decfabb553 2026-09-17T09:39:39-04:00 Expose cached gravity target for prepared trial verification
be9da74dc98c59b5a1ea9ab97aced798a4a12520 2026-09-17T09:39:39-04:00 Expose cached gravity target for prepared trial verification
5e03188816a13247fb480e3b1f36f1b0425ac9cb 2026-09-17T09:37:35-04:00 Test reduced Newton equivalence within the intended root basin
a773c9a0943677b12f884976851c0895501eb321 2026-09-17T09:38:42-04:00 Register isolated polynomial positivity modules and tests
595269117366d2ac7750111babf204303340285d 2026-09-17T09:38:33-04:00 Register gravity reduction modules and tests on isolated branch
23f8a3c8f92b0446b1f751ebbee1a32a2d4a3430 2026-09-17T09:37:35-04:00 Test reduced Newton equivalence within the intended root basin
fc944c1bfeea06b4720af0bfeed2f7488eb2d31b 2026-09-17T09:35:59-04:00 Enforce floating arithmetic prerequisites for polynomial certificates
4418b25d4535b07a5c22ac08a1654a7dd839b923 2026-09-17T09:32:41-04:00 Preserve nonfinite input rejection at feasible-repair application boundary
97204a3253c36edfdbd51cbcb344c1239d772da6 2026-09-17T09:31:31-04:00 Add frozen polynomial positivity probes and tighten certificate diagnostics
dfba40b1f5938ae5f8cfc3a818c6f0c1f7ead63f 2026-09-17T09:35:24-04:00 Exercise typed stellar numerical strategies and rollback contracts
a7f080f2655fbd3d11f4bcde49877ac4a83db6a6 2026-09-17T09:30:12-04:00 Probe FEM gravity strategies and make reduced contracts collective
f8037238f930d9d827918a2f41a561b74516a342 2026-09-17T09:35:59-04:00 Enforce floating arithmetic prerequisites for polynomial certificates
f9af1d9fabc4f027034d0c1d29c66d48babe37a0 2026-09-17T09:35:24-04:00 Exercise typed stellar numerical strategies and rollback contracts
ee5b2f3f0333d49790756b22659dfdb99662e6a5 2026-09-17T09:32:41-04:00 Preserve nonfinite input rejection at feasible-repair application boundary
870427fb379a73cb53911c732da495b9022071bd 2026-09-17T09:31:31-04:00 Add frozen polynomial positivity probes and tighten certificate diagnostics
9831031564ddc888d320fd403b610d2451d1e17d 2026-09-17T09:30:12-04:00 Probe FEM gravity strategies and make reduced contracts collective
9e0e1bc42af6cf11986db113dfbeed694fdf4132 2026-09-17T09:28:01-04:00 Integrate polynomial feasibility with typed stellar enthalpy strategy
3f844061849034917b76ab0048800eb6ed440681 2026-09-17T09:28:01-04:00 Integrate polynomial feasibility with typed stellar enthalpy strategy
8e0ed800d707c77f77c97e2e5db1e03e2b8a279a 2026-09-17T09:27:12-04:00 Add prepared gravity subsystem and second-order trial correction
6628e237d3c4d837b4931e8f952b49cd9c5a66bf 2026-09-17T09:23:19-04:00 Add prepared Schur gravity reduction and contract tests
2fa83db8ab8fadb394cd96063a12236ebcde5c38 2026-09-17T09:27:12-04:00 Add prepared gravity subsystem and second-order trial correction
882e8feef76d848a027c4c8dfd85614ba2656e2b 2026-09-17T09:27:12-04:00 Add prepared gravity subsystem and second-order trial correction
2c084b1c621912680e999b5c4b2faa6b90f6ad2d 2026-09-17T09:23:19-04:00 Add certified polynomial enthalpy bounds and feasible direction repair
cc6e31d95595155a5579ff4ce7475a18977564a6 2026-09-17T09:23:19-04:00 Add certified polynomial enthalpy bounds and feasible direction repair
4ebd50f2bef4883f4bddb318269373847e760270 2026-09-17T09:23:19-04:00 Add prepared Schur gravity reduction and contract tests
7a07caeee33e2addb897b89682678b4cc41b1f3e 2026-09-17T08:55:55-04:00 experiment: record pressure positivity and shape curvature evidence
4280c532e3620f587a346269fc549384e04e2ba0 2026-09-17T08:40:24-04:00 Export enthalpy nodal values on limiting diagnostic elements
c6572d34c33f59085b62e3eb420b4687572f6a38 2026-09-17T08:40:24-04:00 Export enthalpy nodal values on limiting diagnostic elements
9c975422c1033092c790430066e09252b0a62e83 2026-09-17T08:35:49-04:00 experiment: inspect surface carrier and isolate closure bound crossing
b1dc2acf35c4a2b339f61a3dd7d6ebc84318d22f 2026-09-17T08:34:49-04:00 Add preparation-free surface carrier trace diagnostics
ae93c21d844b014cc61be1cda8513034c9a139ec 2026-09-17T08:34:49-04:00 Add preparation-free surface carrier trace diagnostics
b24e6e0c859d98e90648dfe38e467ec4b5d62561 2026-09-17T08:18:09-04:00 experiment: split frozen operator curvature into shape and field contributions
9e1b65dbde2c609b60c2ff8c2637df51646004b8 2026-09-17T08:18:09-04:00 experiment: replay captured candidates and run focused frozen probes
c10725beceff7787828102ff5e9d61f03a566820 2026-09-17T08:18:09-04:00 experiment: split frozen operator curvature into shape and field contributions
6d24c2399f40e80b3086547d1a9a7996eb9edb78 2026-09-17T08:16:37-04:00 experiment: localize pressure preparation admissibility boundaries
6753cc5ddc79933ee7f7b8f0d36951a60e4ae934 2026-09-17T08:16:37-04:00 experiment: localize pressure preparation admissibility boundaries
fd08f7b0e935883a77e2c85c88d26efd31f8bb04 2026-09-17T08:06:37-04:00 experiment: capture frozen live Newton trials without changing solver policy
95d9fbafe893257e85685ccaecde3ab4254eba71 2026-09-16T16:04:49-04:00 docs: finalize controlled solver campaign and transfer limits
5714a9b22271e93c266b476a0e507246834dd105 2026-09-16T15:59:28-04:00 docs: distinguish conservative screening from virial milestone
9e0ffaf1feedd33059881ed635afab53847e81d3 2026-09-16T15:59:28-04:00 docs: record nonrotating larger-window validation
084859037724c5d3de88f0509051cffc2cd624a8 2026-09-16T15:59:27-04:00 docs: record combined optional-density validation
899cb18f2c77171a5cde4d173471199d54affd26 2026-09-16T15:59:28-04:00 docs: distinguish conservative screening from virial milestone
1f9184b7cc217a0c31573675d5d425c0f56a2c84 2026-09-16T15:59:28-04:00 docs: record nonrotating larger-window validation
2e19c2c48c37408a08932268aeb5a164ca8a258b 2026-09-16T15:59:27-04:00 docs: record combined optional-density validation
c88baa19c30a33e837e353c6fc405e018cb86ef8 2026-09-16T15:47:23-04:00 Add a stronger-rotation transfer check for the combined solver
2eab110bef5ae915f75e2322d90ca697af0dcc4d 2026-09-16T15:46:09-04:00 Document matched Krylov safeguard results and limitations
71273836ed20c884c5f3872f85e646cbb06122ec 2026-09-16T15:46:09-04:00 Document matched Krylov safeguard results and limitations
b3a752b16b781d735c24ee57d37dab615e06e639 2026-09-16T15:43:38-04:00 Record controlled numerical outcomes and remaining operator questions
da38801b31307366771fb091ab9b8b822db1d3c2 2026-09-16T14:49:47-04:00 Define matched live controls for the Krylov safeguard
61174cf19225a6b81e29bd83b939392399288069 2026-09-16T14:49:47-04:00 Safeguard reused FGMRES guesses against the current true residual
21b2c2b38e224a6a9bcb3800bd9e749edd50e5ce 2026-09-16T15:20:01-04:00 Define the nonrotating combined-example validation case
db0ddd3454a2c33cfe3ee9edb90177d6b68b655e 2026-09-16T15:19:36-04:00 Document controlled gravity-coupling counterexample
5f83bcba749636aed92f7e5c3639cf6809819cd4 2026-09-16T15:04:21-04:00 Use the validated wider Krylov window in the stellar example
4ec1db230f793be118ebd49452512765b87250e4 2026-09-16T15:04:33-04:00 Record matched central-constraint control results
a1d7d4e67948d47d9ddd7a38320bf57ede306664 2026-09-16T14:39:55-04:00 Keep central density as seed data in the n1 sandbox
0470e3b2a16836ebc37d6d349ab36e10b48bb5dd 2026-09-16T15:17:38-04:00 Gate saved models on solver convergence and the virial milestone
5167744b7a2dc9f40eebcb23389d0fdea8e3e6a8 2026-09-16T15:04:33-04:00 Record matched central-constraint control results
937d2f2d56467995c231c5c7ddebf440aa0baadf 2026-09-16T15:04:21-04:00 Use the validated wider Krylov window in the stellar example
8c1f823da22eac200de101e0393155b7bfcb90aa 2026-09-16T14:51:36-04:00 Define a matched n3 seed test for gravity completion
1911a26a9a283eed7e53b03fc3481ee894e61bfb 2026-09-16T14:49:47-04:00 Define matched live controls for the Krylov safeguard
80d5dfed47d8dcfc92794726350fc1fb8dc67190 2026-09-16T14:42:41-04:00 Record reproducible plateau campaigns and selected-direction probes
ed758307c0da15fa25c26b7c84435b38e5e93879 2026-09-16T14:49:47-04:00 Safeguard reused FGMRES guesses against the current true residual
f9c74aae1054c4001361b96b08721ac410c8091a 2026-09-16T14:42:41-04:00 Record reproducible plateau campaigns and selected-direction probes
ad86e2e21e923fa078c167ccc6569942547af2d2 2026-09-16T14:42:41-04:00 Record reproducible plateau campaigns and selected-direction probes
9bd4af699650e2a6bbe795c618e6ef3fbcb48e12 2026-09-16T14:42:41-04:00 Record reproducible plateau campaigns and selected-direction probes
d34a9c3dffe147331933e548bd1f923d09d9a813 2026-09-16T14:39:55-04:00 Keep central density as seed data in the n1 sandbox
a8e0abf4610f217909037d54afce6e510ec1d0e2 2026-09-16T14:39:15-04:00 Experiment with default-block material-to-gravity completion
80cc3d83d752bd43b7be23cee3d7be6e67cd985f 2026-09-16T14:34:06-04:00 Snapshot optimized solver and audit diagnostics before numerical experiments
75cc63873992984966ea20011cc04d9984f54be4 2026-09-10T06:50:56-04:00 perf(allocations): reduced overall allocations by 95%, increaseed jacobian applicatin by 2x
b3c04d507a1d7bc321ba6edd9dde33f6713345c1 2026-09-08T06:36:39-04:00 feat(newton): first newton solver implementation
76818f2f828ca12606a495a0b84f5d6ce4b78dc6 2026-09-06T10:15:00-04:00 feat(libmeanfield): variadic refactor
71423d543f1775d3b943d9c0361f49edd56b59c1 2026-09-04T07:54:10-04:00 feat(preconditioner): major work on preconditioner system
25510008ddf9810eaf9821149734d526c76b087a 2026-09-02T17:01:50-04:00 perf(jacobian-action): major updates to jacobian action application by removing redudant quadrature work. ~5x increase in speed
85500fef3bbd38ae2342ca4c942c6a454f8308fd 2026-09-01T11:50:13-04:00 feat(surface): surface deformation prescriptions
0a7f18c5c72aa562c020feeab6845e853bfe5217 2026-08-30T16:41:14-04:00 feat(surface): major work on implementing surface constraints in a presciption agnostic manner
36adfa11745cf3eb97d89f836609f1d791a9f8d8 2026-08-29T08:56:36-04:00 feat(FieldDofMap): Completed FieldDofMap migration
177ae8b38aa34d88c07203376961145c5403ccaa 2026-08-24T15:44:24-04:00 feat(support): continued migration to new field dof support system
0f3ca8050b78f0c5c1ef98d485b9fbc2ba06183c 2026-08-23T10:13:53-04:00 feat(field-support): added field support system, mid migration
dc912fd15e51038c999625d7fb0ebfb909f7079a 2026-08-04T14:24:55-04:00 feat(libmeanfield): centrifugal + pressure
9bc4f2758a3325962148d8fbf36719ba3a693fc1 2026-07-15T09:44:43-04:00 feat(mean_field): added initial implementation

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,357 @@
[
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/accuracy_budget.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/accuracy_budget.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/application_optimizations_01",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/application_optimizations_01",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/central_density_homology_coupling.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/central_density_homology_coupling.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/coupled_gauge_modes.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/coupled_gauge_modes.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/final_optimizations_01",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/final_optimizations_01",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/geom_tests_2",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/geom_tests_2",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/geometry_quality_results",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/geometry_quality_results",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/geometry_quality_results_2026-09-08_baseline",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/geometry_quality_results_2026-09-08_baseline",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/geometry_quality_results_2026-09-08_profile",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/geometry_quality_results_2026-09-08_profile",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/geometry_quality_results_2026-09-08_vertices",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/geometry_quality_results_2026-09-08_vertices",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/gravity_completed_null_space.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/gravity_completed_null_space.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/gravity_completed_null_space_restricted.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/gravity_completed_null_space_restricted.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/hdiv_isolation_01",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/hdiv_isolation_01",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/homology_mass_h0_p0.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/homology_mass_h0_p0.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/homology_mass_h0_p1.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/homology_mass_h0_p1.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/homology_mass_h1_p0.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/homology_mass_h1_p0.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield.zip",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/libmeanfield.zip",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/linear_derivatives_01",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/linear_derivatives_01",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/new.patch",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/new.patch",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/output",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/output",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/package-lock.json",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/package-lock.json",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/package.json",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/package.json",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/performance_optimization_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/performance_optimization_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/performance_profile_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/performance_profile_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/phase_h_reduced_surface_modes.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/phase_h_reduced_surface_modes.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_analytic_checked_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/polytrope_analytic_checked_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_analytic_mesh_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/polytrope_analytic_mesh_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_h1_analytic_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/polytrope_h1_analytic_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_h1_mesh_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/polytrope_h1_mesh_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_h1_solution_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/polytrope_h1_solution_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_replay_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/polytrope_replay_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_replay_angular24_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/polytrope_replay_angular24_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_replay_dense_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/polytrope_replay_dense_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_self_checks_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/polytrope_self_checks_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_solution_2026-09-09",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/polytrope_solution_2026-09-09",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p0_identity.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p0_identity.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p0_identity_extended.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p0_identity_extended.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p0_identity_extended_v2.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p0_identity_extended_v2.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p10_full_stellar.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p10_full_stellar.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p10_gravity_backend_finalists.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p10_gravity_backend_finalists.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p10_gravity_backend_finalists_v2.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p10_gravity_backend_finalists_v2.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p10_physical_newton.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p10_physical_newton.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p4_followup.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p4_followup.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p4_gravity.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p4_gravity.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p4_gravity_chebyshev_sweep.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p4_gravity_chebyshev_sweep.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p4_gravity_chebyshev_sweep_v2.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p4_gravity_chebyshev_sweep_v2.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p9_material_surface_baseline.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p9_material_surface_baseline.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p9_material_surface_h1.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p9_material_surface_h1.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p9_material_surface_refinement.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p9_material_surface_refinement.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p9_surface_calibration_objectives.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p9_surface_calibration_objectives.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preconditioning_p9_surface_h1_tuning.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/preconditioning_p9_surface_h1_tuning.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/preparation_optimizations_01",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/preparation_optimizations_01",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/rebuilt_homology_results.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/rebuilt_homology_results.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/results.txt",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/results.txt",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/runtime_optimizations_01",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/runtime_optimizations_01",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/stellar_derivatives_01",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/stellar_derivatives_01",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/stellar_null_space.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/stellar_null_space.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/surface_frequency_limits.csv",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_results/tables/surface_frequency_limits.csv",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/test_summary.html",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/test_summary.html",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/testing.sh",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/testing.sh",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/tests.zip",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/tests.zip",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/field.zip",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/source_archives/field.zip",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/quadrature.zip",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/source_archives/quadrature.zip",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/scripts",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_misc/scripts",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/docs/optimization_and_mpi_report.aux",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/report_builds/prior/optimization_and_mpi_report.aux",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/docs/optimization_and_mpi_report.log",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/report_builds/prior/optimization_and_mpi_report.log",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/docs/optimization_and_mpi_report.out",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/report_builds/prior/optimization_and_mpi_report.out",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/docs/optimization_and_mpi_report.pdf",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_documents/prior/optimization_and_mpi_report.pdf",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/docs/optimization_and_mpi_report.tex",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/legacy_documents/prior/optimization_and_mpi_report.tex",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/Programming/4DSTAR/MeanField/docs/optimization_and_mpi_report.toc",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/report_builds/prior/optimization_and_mpi_report.toc",
"compatibility_symlink": false
},
{
"source": "/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/diagnostics",
"destination": "/Users/tboudreaux/Programming/4DSTAR/MeanField/working/research/diagnostics",
"compatibility_symlink": true
}
]

View File

@@ -0,0 +1,3 @@
# Historical one-way material-to-gravity completion
Extracted unchanged from `research/gravity-coupling-20260916`, commit `db0ddd3`. These files document a negative experiment. They are excluded from the active build; the old driver and default-policy change were not adopted. The later stellar LDU experiments are different algorithms. The branch is retained for complete reconstruction.

View File

@@ -0,0 +1,17 @@
[
{
"id": "n3_J0_seed_probe160",
"arguments": [
"--index",
"3",
"--angular-momentum",
"0",
"--max-newton",
"0",
"--probes",
"--probe-restart",
"160"
],
"notes": "Fresh matched n3 seed, central homology phase retained. Compare both cold windows and test the restart160 correction without committing trials."
}
]

View File

@@ -0,0 +1,115 @@
# Material–gravity coupling candidate
This branch changes only the plateau experiment's preconditioner prescription.
The numerical baseline is commit `80cc3d83d752bd43b7be23cee3d7be6e67cd985f` with
independent material/surface and gravity subsystems; the matched run below uses
the shared diagnostic harness on top of it. The candidate uses the existing
`MaterialThenGravityTriangular` policy and copies the control's default material
and gravity descriptors verbatim: surface-then-material with its uncalibrated
diagonals, gravity approximate LDU, Chebyshev order 5, and three fixed AMG cycles.
The scalar border is prepared anew around the candidate. Its physical model,
normalization, Jacobian, and Newton acceptance rules are unchanged.
For structure blocks `[A B; C D]`, the candidate computes
```
m = Atilde^-1 b_material
g = Dtilde^-1 (b_gravity - C m)
```
The hypothesis is that completing the material correction's gravitational source
will reduce the Poisson-dominated defect seen on actual frozen Newton right-hand
sides. `C` includes both density and shape contributions, so success would support
their combined completion, not establish a density-only cause. Reverse gravity
feedback into hydrostatic and surface balance remains approximate; the added cross
action can also cost more than it saves.
## Controlled outcome: retain as a counterexample, do not promote
The Release executable compiled successfully with Homebrew Clang 22.1.8. On
16 September 2026 the candidate at
`8c1f823da22eac200de101e0393155b7bfcb90aa` was compared with the independent control
at `9bd4af699650e2a6bbe795c618e6ef3fbcb48e12`. Both used a fresh n=3, J=0 seed,
the central constraint, M=R_reference=G=1, K=0.36393905995216302,
rho_c=12.935114545826922, and:
```sh
plateau_diagnostic --index 3 --angular-momentum 0 --max-newton 0 \
--probes --probe-restart 160 --output /absolute/path/to/new-results
```
Each run performed cold window-40 and window-160 solves, with cap 200 and true
relative target 0.03. Each policy's own window-160 correction was then tested
without committing trials. This was a **frozen probe, not live Newton convergence**.
The seed-only driver exit code was 3; it did not indicate a build failure.
Build settings, mesh, root layout, seed physical measurements, initial residual
block norms, and accepted physical snapshot were identical. Mesh SHA-256 was
`ce11ae99e21e6c3bbfbee402acd2e191c1da0d8261d2227b4203f73f2f337a74`; snapshot SHA-256
was `a620600e2a8c7c5d54b628b7919749db47ef7c90822fa940925ae6cd99a68630`.
| Cold solve | Control true defect / RHS | Candidate true defect / RHS | Control / candidate seconds |
|---|---:|---:|---:|
| Window 40, 200 iterations | 0.0563080093 | 0.0715826233 | 98.873 / 117.956 |
| Window 160, 200 iterations | 0.0402590213 | 0.0381780551 | 98.915 / 117.712 |
Neither candidate solve passed. Window 160 improves the defect only 5.17% for
19.0% more solve time; window 40 worsens it by 27.1%. These are single-run solve
times, excluding setup and nonlinear diagnostics. At window 160, the candidate
reduces the gradient-relation defect substantially, but Poisson remains 87.96%
of its squared defect; hydrostatic and surface defects increase.
The selected correction norm grows from 0.757644 to 1.540825. Its sampled
thermodynamic alpha limit tightens from 0.152435 to 0.0913461, making the
candidate's alpha=0.1 trial inadmissible. The control's alpha=0.1 trial reduces F
from 0.0031005934 to 0.0029951212. The candidate's largest sampled admissible step,
alpha=0.01, gives F=0.0030693165. The sampling does not identify either direction's
optimal step. On admissible segments, the measured Taylor remainder follows
approximately 0.111780 alpha² for the control and 0.267383 alpha² for the
candidate; the larger candidate direction therefore has more finite-step
curvature. This is not evidence of a derivative inconsistency.
The candidate and control R160 corrections have normalized cosine 0.996157.
Their difference has norm 0.788889. For defects `r=Jp+F` on this identical system,
```
J(p_candidate-p_control) = r_candidate-r_control
||J(p_candidate-p_control)|| / ||p_candidate-p_control||
<= (||r_candidate||+||r_control||) / ||p_candidate-p_control||
<= 3.083e-4.
```
This identifies a weak direction in the current normalized coordinates, not a
particular symmetry, a physical error, or the full Jacobian condition number.
The old control R40 direction points nearly opposite to both R160 directions;
its comparison with the candidate gives cosine -0.987233 and a response upper
bound 1.571e-4. These bounds use existing true defects, not additional Jv probes.
No gauge or centering change follows from this evidence alone.
The scalar Schur is unchanged, as expected because this one-way completion adds
only gravity coordinates while the present scalar constraints depend on material.
Completed border columns show mixed density-source response: the central-column
Poisson defect falls from 315020.6 to 65499.5, while the Bernoulli-column defect
grows from 47.3016 to 56.3085. Both columns have q=0 and unchanged rho/h, isolating
density completion in those probes. Improving one column does not establish
improved full-system performance.
No state was advanced. The shared seed's P(h) energy/force virial errors remain
5.32642e-5 and 8.34070e-5, above the 1e-5 milestone. Trial virials and interior
errors were not measured. This result rejects promotion of this particular
one-way composition; it does not rule out two-way coupling, a better gravity
inverse, or a more accurate coupled Schur approximation.
Raw outputs remain outside the repository in the audit workspace under
`diagnostics/numerical_campaign_2026-09-16/{baseline_n3,gravity}/n3_J0_seed_probe160`.
The companion `coupling_comparison.md/.json`, `coupling_baseline_analysis.md`,
and `coupling_direction_comparisons.json` retain detailed analysis.
The existing diagnostic flags and output rules are described in
[the plateau README](plateau_diagnostic_README.md). `metadata.txt` identifies this
candidate as `material_then_gravity_triangular_default_subcomponents`.
The prescription is local to this experiment and uses the existing owning-value
and ADL preparation API. Production defaults and the physics-facing public API
are unchanged. No source-completion probes or additional policy variants are
included in this first candidate.

View File

@@ -0,0 +1,28 @@
#pragma once
// Experiment-only prescription. Include after `import mean_field;`.
#include <concepts>
#include <utility>
namespace experiment::material_gravity_candidate {
namespace pc = mean_field::preconditioning;
inline constexpr char Name[] = "material_then_gravity_triangular_default_subcomponents";
struct Prescription final : pc::StellarPreconditionerPrescriptionTag {};
// ADL binds this owning prescription to a prepared problem. Copy the default
// descriptors so that only the structure coupling policy changes. Preparing a
// new border also rebuilds its cached structure responses and scalar Schur.
template <pc::DefaultStellarPreconditionerAvailableFor Problem>
[[nodiscard]] auto prepareStellarPreconditioner(Prescription, const Problem &problem) {
auto defaults = pc::stellarStructureBlock(problem);
static_assert(std::same_as<typename decltype(defaults)::Factorization, pc::IndependentStellarSubsystems>,
"This experiment expects an independent-subsystems baseline.");
auto structure = pc::stellarStructureBlock(
problem, defaults.materialSurfaceComponent(), defaults.gravityComponent(),
pc::MaterialThenGravityTriangular{});
auto block = pc::specificationBorderBlock(problem, std::move(structure), pc::backend::DenseDirect{});
return pc::prepare(problem, std::move(block));
}
} // namespace experiment::material_gravity_candidate

View File

@@ -0,0 +1,67 @@
"""Execute the reviewed move plan without deleting or rewriting evidence."""
from pathlib import Path
import hashlib
import json
import os
import subprocess
import time
HERE = Path(__file__).resolve().parent
REPO = Path('/Users/tboudreaux/Programming/4DSTAR/MeanField')
def inventory(path):
entries = []
paths = [path] if not path.is_dir() else sorted(path.rglob('*'))
for item in paths:
relative = '.' if item == path else str(item.relative_to(path))
if item.is_symlink():
entries.append({'path': relative, 'kind': 'symlink', 'target': os.readlink(item)})
elif item.is_file():
digest = hashlib.sha256()
with item.open('rb') as stream:
for block in iter(lambda: stream.read(1024 * 1024), b''):
digest.update(block)
entries.append({'path': relative, 'kind': 'file', 'bytes': item.stat().st_size,
'sha256': digest.hexdigest()})
elif item.is_dir():
entries.append({'path': relative, 'kind': 'directory'})
else:
raise RuntimeError(f'Unsupported evidence type: {item}')
return entries
plan = json.loads((HERE / 'move_plan.json').read_text())
tracked = [REPO / x for x in subprocess.check_output(
['git', 'ls-files', '-z'], cwd=REPO).decode().split('\0') if x]
for move in plan:
source, destination = Path(move['source']), Path(move['destination'])
if not source.exists() or source.is_symlink():
raise RuntimeError(f'Missing/already-moved source: {source}')
if destination.exists() or destination.is_symlink():
raise RuntimeError(f'Destination already exists: {destination}')
if any(x == source or source in x.parents for x in tracked):
raise RuntimeError(f'Plan would move tracked source: {source}')
manifest = {'started_at_unix': time.time(), 'moves': []}
record = HERE / 'move_manifest.json'
for move in plan:
source, destination = Path(move['source']), Path(move['destination'])
before = inventory(source)
entry = {**move, 'entries': before, 'verified': False}
manifest['moves'].append(entry)
record.write_text(json.dumps(manifest, indent=2) + '\n')
destination.parent.mkdir(parents=True, exist_ok=True)
# Atomic rename preserves contents, permissions and directory structure.
source.rename(destination)
if move['compatibility_symlink']:
source.symlink_to(destination, target_is_directory=destination.is_dir())
if inventory(destination) != before:
raise RuntimeError(f'Post-move evidence mismatch: {destination}')
entry['verified'] = True
record.write_text(json.dumps(manifest, indent=2) + '\n')
print(f'Preserved and verified: {source.name} ({len(before)} entries)', flush=True)
manifest['completed_at_unix'] = time.time()
manifest['all_verified'] = all(x['verified'] for x in manifest['moves'])
record.write_text(json.dumps(manifest, indent=2) + '\n')
print('All moves verified; no artifacts deleted.', flush=True)

View File

@@ -0,0 +1,75 @@
M libmeanfield/interface/quadrature/mfem.cppm
?? .cex/
?? .codex/
?? accuracy_budget.csv
?? application_optimizations_01/
?? central_density_homology_coupling.csv
?? cmake-build-profile-homebrew-llvm/
?? cmake-build-profile-homebrew/
?? cmake-build-profile-ninja/
?? cmake-build-release-homebrew-p1/
?? coupled_gauge_modes.csv
?? docs/optimization_and_mpi_report.aux
?? docs/optimization_and_mpi_report.log
?? docs/optimization_and_mpi_report.out
?? docs/optimization_and_mpi_report.pdf
?? docs/optimization_and_mpi_report.tex
?? docs/optimization_and_mpi_report.toc
?? final_optimizations_01/
?? geom_tests_2/
?? geometry_quality_results_2026-09-08_baseline/
?? geometry_quality_results_2026-09-08_profile/
?? geometry_quality_results_2026-09-08_vertices/
?? gravity_completed_null_space.csv
?? gravity_completed_null_space_restricted.csv
?? hdiv_isolation_01/
?? homology_mass_h0_p0.csv
?? homology_mass_h0_p1.csv
?? homology_mass_h1_p0.csv
?? libmeanfield.zip
?? libmeanfield/interface/field.zip
?? libmeanfield/interface/quadrature.zip
?? linear_derivatives_01/
?? new.patch
?? package-lock.json
?? package.json
?? performance_optimization_2026-09-09/
?? performance_profile_2026-09-09/
?? phase_h_reduced_surface_modes.csv
?? polytrope_analytic_checked_2026-09-09/
?? polytrope_analytic_mesh_2026-09-09/
?? polytrope_h1_analytic_2026-09-09/
?? polytrope_h1_mesh_2026-09-09/
?? polytrope_h1_solution_2026-09-09/
?? polytrope_replay_2026-09-09/
?? polytrope_replay_angular24_2026-09-09/
?? polytrope_replay_dense_2026-09-09/
?? polytrope_self_checks_2026-09-09/
?? polytrope_solution_2026-09-09/
?? preconditioning_p0_identity.csv
?? preconditioning_p0_identity_extended.csv
?? preconditioning_p0_identity_extended_v2.csv
?? preconditioning_p10_full_stellar.csv
?? preconditioning_p10_gravity_backend_finalists.csv
?? preconditioning_p10_gravity_backend_finalists_v2.csv
?? preconditioning_p10_physical_newton.csv
?? preconditioning_p4_followup.csv
?? preconditioning_p4_gravity.csv
?? preconditioning_p4_gravity_chebyshev_sweep.csv
?? preconditioning_p4_gravity_chebyshev_sweep_v2.csv
?? preconditioning_p9_material_surface_baseline.csv
?? preconditioning_p9_material_surface_h1.csv
?? preconditioning_p9_material_surface_refinement.csv
?? preconditioning_p9_surface_calibration_objectives.csv
?? preconditioning_p9_surface_h1_tuning.csv
?? preparation_optimizations_01/
?? rebuilt_homology_results.csv
?? results.txt
?? runtime_optimizations_01/
?? scripts/
?? stellar_derivatives_01/
?? stellar_null_space.csv
?? surface_frequency_limits.csv
?? test_summary.html
?? testing.sh
?? tests.zip

View File

@@ -0,0 +1,27 @@
diff --git a/libmeanfield/interface/quadrature/mfem.cppm b/libmeanfield/interface/quadrature/mfem.cppm
index 21560a3..37003ae 100644
--- a/libmeanfield/interface/quadrature/mfem.cppm
+++ b/libmeanfield/interface/quadrature/mfem.cppm
@@ -16,16 +16,16 @@ export namespace mean_field::quadrature {
class RuleFactory {
public:
explicit RuleFactory(Policy policy);
- MfemRule
- get(const Query &query,
- mfem::Geometry::Type geometry) const;
- MfemRule
- get(Term term,
+ MfemRule get(const Query &query, mfem::Geometry::Type geometry) const;
+
+ MfemRule get(
+ Term term,
QuadratureRole role,
mfem::Geometry::Type geometry,
int base_order,
utils::DOMAINS domain = utils::DOMAINS::ALL,
- MappingKind mapping = MappingKind::none) const;
+ MappingKind mapping = MappingKind::none
+ ) const;
Resolution configure_gravity_hdiv_mass(
mfem::VectorFEMassIntegrator &integrator,

View File

@@ -0,0 +1,167 @@
# Sources and integration notes for recent.tex
The fragment covers native harmonics (Sept. 19), negative-density localization,
density-only Q2/Q3/Q4 and log assessment, final coupled-convergence controls,
compatible rotating n3 family, pressure/gravity consistency, physical slices,
and the resulting next priorities. It is approximately 7,700 words, with 14
small wrapped longtables and two figures. It deliberately does not duplicate
the preceding Sep. 18 reduced-surface study except to explain the transition
from an affine restricted diagnostic to a native prescription.
## Integration
- Required standard packages: `amsmath`, `longtable`, `graphicx`, `hyperref` (as
already planned). No custom command definitions are required. Grouped tables
set tab spacing to 3 pt and explicitly wrap columns; total prescribed column
widths are <=147 mm before internal tab spacing.
- Figure references assume compilation and Pandoc conversion with `reports/`
as the resource directory: `figures/n3_ldu_meridional.png` and
`figures/n1p5_rotating_refinement.pdf`.
- The third planned figure `figures/frozen_linear_rates.pdf` can be added by the
root in the frozen-comparison section or an appendix; its multiple-panel layout
may merit a full page.
- Sections describe Sept. 19 state and producer commits, not the still-pending
final main integration. Root must separately write the exact selected branch
disposition and final main commit.
- All internal labels begin `recent-`, avoiding likely collision with the early
report fragment.
- No fresh FEM runs or audits were performed for this report fragment; it is a
synthesis of the immutable studied outputs and their existing audits.
- The old negative-density report's recommendation for derived density is
explicitly identified as historical and superseded by the user's decision to
keep density independent. The later preference to defer positivity is also
explicit. Do not silently carry that old recommendation forward.
- Important no-overclaim rules are repeated where they matter: finite-budget
endpoints are not floors; equal-update trajectories are not same-model
speedups; quadrature agreement is not mesh convergence; sampled positivity
is not global positivity; the n3 force/h virial alone passing does not meet
the overall milestone; raw J or angular velocity is not a critical fraction.
## Primary repository reports read
Original source checkout root:
`/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement`
1. `experiments/SPHERICAL_HARMONIC_SURFACE_2026-09-19.md`
- Native all-m L4 prescription, typed contracts, fixed reference basis,
Q4/Q3 geometry/displacement, scalar trace-mass normalization, single-rank
scope, five six-update live controls, excluded-force and local diagnostics.
- Producer: `7b0eb8d92d0f550f1fe3fb19cd8eecc52dc80c56`.
2. `experiments/NEGATIVE_DENSITY_INVESTIGATION_2026-09-19.md`
- Four frozen states, independent closure projection identity, all 96 outer
cells, root-sliced measures, positive nodal values, seed-vs-root mechanism,
exact one-dimensional quadratic projections, interpretive scope.
- Producers: `9c22934d52b369f96364e781d6a4843939ec9523` and
`d1a594808f960bbaeeb6df8a8ce6a95458765b19`.
3. `experiments/DENSITY_ORDER_STUDY_2026-09-19.md`
- Frozen common-q26 and error-q30 controls; all 12 live density-order cases;
selected quadrature rules, block sizes, cost scopes, central forcing and
initializer distinctions; 48 contract tests per order.
- Producers: frozen `241621c`; coupled Q2 `c0e8551`; Q3 `cd71f37`;
Q4 `e054c74`; final comparison generator `c0a496e`.
4. `experiments/COUPLED_CONVERGENCE_STUDY_2026-09-19.md`
- Five initial nonlinear controls, matched gravity-path pair, all 11 frozen
inverse pairs, weak coupled direction analysis, compatible n3 pair,
display refinement, validation and next priorities.
- Final integration/report commit: `d7acb0d399aac5ac4c36d834a954c1c959042b81`.
5. `experiments/N3_COMPATIBLE_FAMILY_2026-09-19.md`
- Explicit K factor, independent Lane–Emden compatibility check, exact
shared specifications and caveats for the live pair.
6. `experiments/FIELD_COUPLING_REVIEW_2026-09-19.md`
- Actual material triangular structure contains the exact h-to-rho action;
independent vs LDU feedback, possible exact DG mass and H1 mass improvements,
optional future EOS-aware field Schur and closure affine-target trial path.
7. `experiments/MODEL_SLICES.md`
- Physical-plane cut and source immutability; element-owned DG traces,
independent outlines, field raster before colormap, display errors/limits,
use/replay parameters and geometry/plotting checks.
8. `experiments/REDUCED_SURFACE_STUDY_2026-09-18.md`
- Read for bridge/context only; preceding early-history fragment should
contain its detailed restricted-vs-full system results.
Separate source checkout:
`/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/log-density-assessment`
9. `experiments/LOG_DENSITY_ASSESSMENT_2026-09-19.md`
- Mathematical distinction between exponentiating coefficients and pointwise
exponential, vacuum singularity, independent vanishing factor, 1D moment
fits, weighted-mass response/conditioning, general-EOS and support contracts.
- Separate assessment branch at `90580b2`; no coupled stellar log solve.
## Raw evidence and concise analysis read
Archive target supplied by root:
`working/research/diagnostics/<campaign>/` in the main repository.
Original workspace `diagnostics/` will remain a symlink to that archived path.
Campaign names:
- `spherical_harmonic_surface_2026-09-19/`
- `negative_density_2026-09-19/`
- `density_order_2026-09-19/`
- `log_density_2026-09-19/`
- `coupled_convergence_2026-09-19/`
- `n3_mass_compatibility_2026-09-19/`
Additional analyses read directly:
- `coupled_convergence_2026-09-19/N3_COMPATIBLE_RESULTS.md`
- `coupled_convergence_2026-09-19/PRESSURE_MOMENT_NOTE.md`
High-value existing evidence links for root's archive appendix:
- `coupled_convergence_2026-09-19/STUDY_INDEX.json`
- `coupled_convergence_2026-09-19/CONTROL_RESULTS.md` and `.json`
- `coupled_convergence_2026-09-19/linear_analysis/FINAL_INTERPRETATION.md`
- `coupled_convergence_2026-09-19/n3_direction_difference/README.md`
- `coupled_convergence_2026-09-19/SLICE_REFINEMENT_SUMMARY.json`
- `coupled_convergence_2026-09-19/validation/validation.json`
- `coupled_convergence_2026-09-19/figures_n3_v2/slice_tests.log`
- `density_order_2026-09-19/final_analysis/coupled_outcomes.csv`
- `density_order_2026-09-19/final_analysis/trial_stages.csv`
- `negative_density_2026-09-19/regions_campaign_audit_v1.json`
- `spherical_harmonic_surface_2026-09-19/campaign_audit.json`
## Figure sources
All below are relative to original workspace diagnostics, or to the archive's
`working/research/diagnostics/` after reorganization.
- Report `figures/n3_ldu_meridional.png`:
`coupled_convergence_2026-09-19/figures_n3_v2/n3_J0p035_K0p99_ldu_xz.png`
- Report `figures/n1p5_rotating_refinement.pdf`:
`coupled_convergence_2026-09-19/figures_slices_v2/n1p5_rotating_xz_s4_s8.pdf`
- Optional report `figures/frozen_linear_rates.pdf`:
`coupled_convergence_2026-09-19/figures/linear_rates/frozen_linear_rates.pdf`
- Additional useful density-order figure:
`density_order_2026-09-19/final_analysis/density_order_comparison.png`
- Additional sign-location figure:
`negative_density_2026-09-19/figures/surface_density_traces.png`
## External primary-source context retained from the studied reports
The numeric results and equations in the fragment are primarily local evidence
and explicit derivations. If adding a bibliography, these are the primary
sources referenced by the underlying reports (no new online verification in
this report-writing subtask):
- Cheng, Cheng and Lin, *Expanding solutions near unstable Lane–Emden stars*,
equations (1.14)–(1.15) and Theorem 3.1:
https://arxiv.org/html/2305.10218#S3.SS1
This supplies the sharp energy bound and Lane–Emden mass relation. The beta
bound is our inference with the steady virial identity, not a quoted theorem.
- MESA `star/private/star_utils.f90`:
https://github.com/MESAHub/mesa/blob/main/star/private/star_utils.f90
- MESA T(tau) atmosphere documentation:
https://docs.mesastar.org/en/latest/atm/t-tau.html
- Vijaywargiya and Fu, *Two Finite Element Approaches for the Porous Medium
Equation That Are Positivity Preserving and Energy Stable* (2024):
https://link.springer.com/article/10.1007/s10915-024-02642-x
- Fu and Xu, *High-order space-time finite element methods for the
Poisson–Nernst–Planck equations: Positivity and unconditional energy stability*:
https://arxiv.org/abs/2105.01163
- Zhang and Shu review (historical alternative only, not currently adopted):
https://www.math.purdue.edu/~zhan1966/research/paper/review.pdf
The condensed fragment mentions MESA only as context and does not import PDE
positivity theorems as guarantees for this steady stellar system.

View File

@@ -0,0 +1,45 @@
75cc63873992984966ea20011cc04d9984f54be4 refs/heads/main
80cc3d83d752bd43b7be23cee3d7be6e67cd985f refs/heads/research/baseline-20260916
2e19c2c48c37408a08932268aeb5a164ca8a258b refs/heads/research/central-constraint-20260916
95d9fbafe893257e85685ccaecde3ab4254eba71 refs/heads/research/combined-20260916
d7acb0d399aac5ac4c36d834a954c1c959042b81 refs/heads/research/coupled-convergence-study-20260919
4a6c1b5c26a352a8afb30feb0a2f3821aac9ee19 refs/heads/research/coupled-shape-coarse-20260918
46249d0758e1c30f7585d35821f78cd558197cec refs/heads/research/coupled-trial-correction-20260918
db854c0f7cdf5137e377273499f0ac5b6053b752 refs/heads/research/damped-coupled-trial-20260918
ef76e0c7860d3972f4993e406defe9dd24dcc05b refs/heads/research/density-order-study-20260919
7a07caeee33e2addb897b89682678b4cc41b1f3e refs/heads/research/diagnostic-campaign-20260917
899cb18f2c77171a5cde4d173471199d54affd26 refs/heads/research/experiment-harness-20260916
ff1b889e2c316f1adc2cc4aac5aa169e665994bd refs/heads/research/gravity-compact-application-20260917
c10d019411fbde9dde45c4c7cadc80e0e6334dd7 refs/heads/research/gravity-consistent-schur-20260918
db0ddd3454a2c33cfe3ee9edb90177d6b68b655e refs/heads/research/gravity-coupling-20260916
38c7184b5c32d47c4e98cdaaf7f2f782297ee49b refs/heads/research/gravity-coupling-ablation-20260919
3762c74f033941e8e97f4dee1748ee8f3fb49c36 refs/heads/research/gravity-curvature-correction-20260917
47775a9aaa71874837be17b0c61a3fe1d1a491f1 refs/heads/research/gravity-direction-diagnostics-20260917
782827c25890d849c58acd3a27840ddea3e5fb09 refs/heads/research/gravity-prepared-roundoff-20260917
d25d14147110fb4aa0485c5a0920f8d88390a1ad refs/heads/research/gravity-reduced-newton-20260917
7f4b068a39e45f58ba85acf84c488697aa5a8055 refs/heads/research/gravity-trial-diagnostics-20260917
71273836ed20c884c5f3872f85e646cbb06122ec refs/heads/research/krylov-20260916
1f9184b7cc217a0c31573675d5d425c0f56a2c84 refs/heads/research/krylov-window-20260916
0e6688f500873fb5cb3ecae783c90faa6d952159 refs/heads/research/linear-coupling-study-20260919
90580b23f9b170db7fffd3e5bb86a9a1f9927f9c refs/heads/research/log-density-assessment-20260919
5da3f42d397355964d5fb53c5395aa04a2f2cf6d refs/heads/research/model-slices-20260919
1d746b028ef001782158a0a82d81b40eb933b68a refs/heads/research/n3-compatible-family-20260919
e78af98e2b62efc84c0042dd78a357ca7a37822e refs/heads/research/n3-linear-ablation-20260919
1ed03f56833817114bc99bec4e6f12b0dfd8add6 refs/heads/research/n3-live-field-feedback-20260919
7ed4d232d0209dc209082c983f18f2e256a32742 refs/heads/research/negative-density-diagnosis-20260919
2944dd5019ab8aaca60e147db010d7fded7fd916 refs/heads/research/nonlinear-step-obstruction-20260918
10adf7ec3783b27976cb9cf52728f8269819a685 refs/heads/research/numerical-strategies-20260917
cc6f4b08190f1c5e4b63e13f0643e592dfae7a90 refs/heads/research/polynomial-endpoint-certification-20260917
9aefb364a42440ddb38d68df9e64c61761131113 refs/heads/research/polynomial-positive-newton-20260917
dc1da62b2c2856112f49239c42b9020dc151cd78 refs/heads/research/preconditioner-benchmarks-20260918
07769e7c5d572964a9b159c8dbe89871a067346a refs/heads/research/preconditioner-cached-cross-actions-20260918
c6572d34c33f59085b62e3eb420b4687572f6a38 refs/heads/research/pressure-obstruction-20260917
2171b8b76ad78856323fdbcf3d2c537d9039201f refs/heads/research/reduced-smooth-surface-20260918
b24e6e0c859d98e90648dfe38e467ec4b5d62561 refs/heads/research/shape-curvature-20260917
785a7aedac72c810bb624c2b7be6b4f9a05ef6e8 refs/heads/research/shape-field-displacement-q4-20260918
6ceda61bddc0d4881d9f7ac98d170d07980a963d refs/heads/research/shape-field-weak-response-20260918
1148c099e3c5839a63880ae13d2ad6602402b13f refs/heads/research/spherical-harmonic-surface-20260919
75cc63873992984966ea20011cc04d9984f54be4 refs/remotes/local/HEAD
75cc63873992984966ea20011cc04d9984f54be4 refs/remotes/local/main
75cc63873992984966ea20011cc04d9984f54be4 refs/remotes/origin/HEAD
75cc63873992984966ea20011cc04d9984f54be4 refs/remotes/origin/main

View File

@@ -0,0 +1,462 @@
[
{
"name": ".DS_Store",
"directory": false,
"symlink": false
},
{
"name": ".cex",
"directory": true,
"symlink": false
},
{
"name": ".codex",
"directory": true,
"symlink": false
},
{
"name": ".git",
"directory": true,
"symlink": false
},
{
"name": ".gitignore",
"directory": false,
"symlink": false
},
{
"name": ".idea",
"directory": true,
"symlink": false
},
{
"name": "CMakeLists.txt",
"directory": false,
"symlink": false
},
{
"name": "DEFERRED_REMOVAL_REGISTRY.md",
"directory": false,
"symlink": false
},
{
"name": "FIELD_DOF_MIGRATION_HANDOFF.md",
"directory": false,
"symlink": false
},
{
"name": "LICENSE.txt",
"directory": false,
"symlink": false
},
{
"name": "MeanField_Solver_MVP_Geometry_Preflight_Handoff_2026-09-08.md",
"directory": false,
"symlink": false
},
{
"name": "SURFACE_DEFORMATION_PRESCRIPTION_DESIGN.md",
"directory": false,
"symlink": false
},
{
"name": "accuracy_budget.csv",
"directory": false,
"symlink": false
},
{
"name": "application_optimizations_01",
"directory": true,
"symlink": false
},
{
"name": "central_density_homology_coupling.csv",
"directory": false,
"symlink": false
},
{
"name": "clang-format-styles",
"directory": true,
"symlink": false
},
{
"name": "cmake-build-debug-homebrew",
"directory": true,
"symlink": false
},
{
"name": "cmake-build-profile-homebrew",
"directory": true,
"symlink": false
},
{
"name": "cmake-build-profile-homebrew-llvm",
"directory": true,
"symlink": false
},
{
"name": "cmake-build-profile-ninja",
"directory": true,
"symlink": false
},
{
"name": "cmake-build-release-homebrew",
"directory": true,
"symlink": false
},
{
"name": "cmake-build-release-homebrew-p1",
"directory": true,
"symlink": false
},
{
"name": "coupled_gauge_modes.csv",
"directory": false,
"symlink": false
},
{
"name": "docs",
"directory": true,
"symlink": false
},
{
"name": "experiments",
"directory": true,
"symlink": false
},
{
"name": "extension_example",
"directory": true,
"symlink": false
},
{
"name": "final_optimizations_01",
"directory": true,
"symlink": false
},
{
"name": "format",
"directory": false,
"symlink": false
},
{
"name": "generate_mesh.py",
"directory": false,
"symlink": false
},
{
"name": "geom_tests_2",
"directory": true,
"symlink": false
},
{
"name": "geometry_quality_results",
"directory": true,
"symlink": false
},
{
"name": "geometry_quality_results_2026-09-08_baseline",
"directory": true,
"symlink": false
},
{
"name": "geometry_quality_results_2026-09-08_profile",
"directory": true,
"symlink": false
},
{
"name": "geometry_quality_results_2026-09-08_vertices",
"directory": true,
"symlink": false
},
{
"name": "gravity_completed_null_space.csv",
"directory": false,
"symlink": false
},
{
"name": "gravity_completed_null_space_restricted.csv",
"directory": false,
"symlink": false
},
{
"name": "hdiv_isolation_01",
"directory": true,
"symlink": false
},
{
"name": "homology_mass_h0_p0.csv",
"directory": false,
"symlink": false
},
{
"name": "homology_mass_h0_p1.csv",
"directory": false,
"symlink": false
},
{
"name": "homology_mass_h1_p0.csv",
"directory": false,
"symlink": false
},
{
"name": "libmeanfield",
"directory": true,
"symlink": false
},
{
"name": "libmeanfield.zip",
"directory": false,
"symlink": false
},
{
"name": "linear_derivatives_01",
"directory": true,
"symlink": false
},
{
"name": "new.patch",
"directory": false,
"symlink": false
},
{
"name": "output",
"directory": true,
"symlink": false
},
{
"name": "package-lock.json",
"directory": false,
"symlink": false
},
{
"name": "package.json",
"directory": false,
"symlink": false
},
{
"name": "performance_optimization_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "performance_profile_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "phase_h_reduced_surface_modes.csv",
"directory": false,
"symlink": false
},
{
"name": "polytrope_analytic_checked_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "polytrope_analytic_mesh_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "polytrope_h1_analytic_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "polytrope_h1_mesh_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "polytrope_h1_solution_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "polytrope_replay_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "polytrope_replay_angular24_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "polytrope_replay_dense_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "polytrope_self_checks_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "polytrope_solution_2026-09-09",
"directory": true,
"symlink": false
},
{
"name": "preconditioning_p0_identity.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p0_identity_extended.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p0_identity_extended_v2.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p10_full_stellar.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p10_gravity_backend_finalists.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p10_gravity_backend_finalists_v2.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p10_physical_newton.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p4_followup.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p4_gravity.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p4_gravity_chebyshev_sweep.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p4_gravity_chebyshev_sweep_v2.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p9_material_surface_baseline.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p9_material_surface_h1.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p9_material_surface_refinement.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p9_surface_calibration_objectives.csv",
"directory": false,
"symlink": false
},
{
"name": "preconditioning_p9_surface_h1_tuning.csv",
"directory": false,
"symlink": false
},
{
"name": "preparation_optimizations_01",
"directory": true,
"symlink": false
},
{
"name": "readme.md",
"directory": false,
"symlink": false
},
{
"name": "rebuilt_homology_results.csv",
"directory": false,
"symlink": false
},
{
"name": "results.txt",
"directory": false,
"symlink": false
},
{
"name": "runtime_optimizations_01",
"directory": true,
"symlink": false
},
{
"name": "sandbox.cpp",
"directory": false,
"symlink": false
},
{
"name": "sandbox.smesh",
"directory": false,
"symlink": false
},
{
"name": "scripts",
"directory": true,
"symlink": false
},
{
"name": "stellar_derivatives_01",
"directory": true,
"symlink": false
},
{
"name": "stellar_null_space.csv",
"directory": false,
"symlink": false
},
{
"name": "surface_frequency_limits.csv",
"directory": false,
"symlink": false
},
{
"name": "test_summary.html",
"directory": false,
"symlink": false
},
{
"name": "testing.sh",
"directory": false,
"symlink": false
},
{
"name": "tests",
"directory": true,
"symlink": false
},
{
"name": "tests.zip",
"directory": false,
"symlink": false
},
{
"name": "tools",
"directory": true,
"symlink": false
}
]

View File

@@ -0,0 +1,76 @@
worktree /Users/tboudreaux/Programming/4DSTAR/MeanField
HEAD 10adf7ec3783b27976cb9cf52728f8269819a685
branch refs/heads/research/numerical-strategies-20260917
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/central-constraint
HEAD 2e19c2c48c37408a08932268aeb5a164ca8a258b
branch refs/heads/research/central-constraint-20260916
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/coupled-shape-coarse
HEAD 4a6c1b5c26a352a8afb30feb0a2f3821aac9ee19
branch refs/heads/research/coupled-shape-coarse-20260918
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/gravity-consistent-schur
HEAD c10d019411fbde9dde45c4c7cadc80e0e6334dd7
branch refs/heads/research/gravity-consistent-schur-20260918
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/gravity-correction
HEAD 7f4b068a39e45f58ba85acf84c488697aa5a8055
branch refs/heads/research/gravity-trial-diagnostics-20260917
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/gravity-coupling
HEAD db0ddd3454a2c33cfe3ee9edb90177d6b68b655e
branch refs/heads/research/gravity-coupling-20260916
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/gravity-reduction
HEAD 47775a9aaa71874837be17b0c61a3fe1d1a491f1
branch refs/heads/research/gravity-direction-diagnostics-20260917
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/krylov
HEAD 71273836ed20c884c5f3872f85e646cbb06122ec
branch refs/heads/research/krylov-20260916
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/krylov-window
HEAD 1f9184b7cc217a0c31573675d5d425c0f56a2c84
branch refs/heads/research/krylov-window-20260916
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/linear-coupling-study
HEAD 0e6688f500873fb5cb3ecae783c90faa6d952159
branch refs/heads/research/linear-coupling-study-20260919
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/log-density-assessment
HEAD 90580b23f9b170db7fffd3e5bb86a9a1f9927f9c
branch refs/heads/research/log-density-assessment-20260919
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/measurements
HEAD 899cb18f2c77171a5cde4d173471199d54affd26
branch refs/heads/research/experiment-harness-20260916
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/model-slices
HEAD 5da3f42d397355964d5fb53c5395aa04a2f2cf6d
branch refs/heads/research/model-slices-20260919
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/positivity-certification
HEAD cc6f4b08190f1c5e4b63e13f0643e592dfae7a90
branch refs/heads/research/polynomial-endpoint-certification-20260917
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/positivity-strategy
HEAD 9aefb364a42440ddb38d68df9e64c61761131113
branch refs/heads/research/polynomial-positive-newton-20260917
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-cached-cross-actions
HEAD 07769e7c5d572964a9b159c8dbe89871a067346a
branch refs/heads/research/preconditioner-cached-cross-actions-20260918
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement
HEAD d7acb0d399aac5ac4c36d834a954c1c959042b81
branch refs/heads/research/coupled-convergence-study-20260919
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/pressure-obstruction
HEAD c6572d34c33f59085b62e3eb420b4687572f6a38
branch refs/heads/research/pressure-obstruction-20260917
worktree /Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/shape-curvature
HEAD b24e6e0c859d98e90648dfe38e467ec4b5d62561
branch refs/heads/research/shape-curvature-20260917

View File

@@ -0,0 +1,185 @@
# Completed branch consolidation — 20 September 2026
The complete local delivery is identified by `research-handoff-2026-09-20`.
`main` contains the tested descendant of `d7acb0d` assembled on
`integration/research-consolidation-20260920`. No remote branch was pushed and
no research branch or worktree was deleted.
The useful changes from the hypothesis branches were already largely combined
in the cumulative research history, often through cherry-picks. Consolidation
verified their final contents instead of forcing every historical tip into the
ancestry or reintroducing old driver versions.
- Retained the optimized baseline, safeguards, optional central constraint,
typed numerical policies, gravity-Schur refinement, cached cross actions,
native all-m harmonic surface, density-order controls, checked restarts,
physical diagnostics, model slices, tests and experiment recipes.
- Preserved the existing user quadrature formatting edit in `6950dc6`.
- Imported the missing log-density assessment and standalone reference script
through `b1fe359`. They remain deferred research; density is still an
independent Q2 field and no log-density runtime or new positivity policy was
enabled.
- Kept Q3 displacement. The failed Q4 change remains isolated; its findings are
included in the report.
- Archived the unsuccessful one-way material-to-gravity recipe under
`archive/one_way_gravity_completion/`; its old driver/default change was not
adopted. Experimental corrections/coarse solvers remain explicit options.
- Preserved existing library defaults. All-m L4/restart160 are explicit sandbox
choices; stellar LDU plus gravity-Schur is a measured research candidate.
The report's consolidation-validation section and `validation/` records give
this delivery's actual checks. The exact original audit is preserved in
`archive/branch_audit_initial.md`. The table and source audit below describe the
**pre-consolidation d7acb0d comparison**; in particular, old main=75cc638 and the
then-missing log assessment are historical states, not the completed result.
---
# MeanField branch consolidation audit — 20 September 2026
This is a read-only source/history audit. No source files, branch references, worktrees or artifacts were changed by the auditor; this document is its only output. No numerical test was run. Conclusions refer to integration commit `d7acb0d399aac5ac4c36d834a954c1c959042b81` unless a different revision is named.
## Recommendation
Use `research/coupled-convergence-study-20260919` (`d7acb0d`) as the integration base and advance `main` to a tested consolidation descendant. It is a descendant of current `main` (`75cc638`) and contains all successful cumulative implementation work, all current experiment infrastructure, and most unsuccessful-study records. It already incorporates most topic branches by cherry-pick or equivalent integration; blindly merging every branch would reintroduce obsolete driver versions or failed defaults and create unnecessary conflicts.
Preserve historical branches. Record their disposition in the consolidated report. A branch need not become an ancestor of main to have its useful contents incorporated; the patch/content mapping below supplies that provenance. Do not use an `ours` merge to falsely suggest discarded behavior was adopted.
Two divergent topics merit explicit treatment:
1. **Log-density assessment:** import the two final files from `research/log-density-assessment-20260919` (`90580b2`) as deferred research documentation/reference: `experiments/LOG_DENSITY_ASSESSMENT_2026-09-19.md` and `experiments/log_density_reference_model.py`. The six unique commits change only these files. There is no FEM log-density implementation to merge, and adding the historical assessment does not enable positivity enforcement or contradict the current decision to defer it.
2. **One-way material-to-gravity completion:** preserve the final README, recipe and case manifest from `research/gravity-coupling-20260916` (`db0ddd3`) in a clearly historical/archived experiment location, or retain the branch with a report link and extracted evidence. Do **not** transplant its old driver or make its prescription the default. This was a measured counterexample, not the later successful two-way LDU policy.
The failed Q4 displacement implementation remains isolated on `research/shape-field-displacement-q4-20260918`; its final report and comparison scripts are already present in the integration branch with Q3 restored. There is no scientific reason to activate Q4 during consolidation.
## Main checkout preservation
At audit start, `/Users/tboudreaux/Programming/4DSTAR/MeanField` was on `research/numerical-strategies-20260917` at `10adf7e`, not on main. The only tracked local edit was formatting in `libmeanfield/interface/quadrature/mfem.cppm`: method declaration wrapping, no signature/semantic change. Preserve it explicitly by backup/commit or an exactly reapplied patch; it is the user's work. Numerous untracked result folders, CSVs, archives, build trees, `.cex`, `.codex`, scripts and optimization report files were also present. This audit does not classify those as deletable.
`main`, `origin/main` and `local/main` all pointed to `75cc638` at audit start. Do not push remote main without further authorization; local integration is the requested action. No AGENTS.md exists in the programming checkout or its checked ancestors. The project mirror's AGENTS.md says every file under `sources/` is read-only; do not relocate or change synced sources.
## Branch-by-branch disposition
“Ancestor” means reachable from `d7acb0d`. “Patch-equivalent” means all topic commits reported by `git cherry d7acb0d <topic>` have equivalent patches in the integration history. “Semantically integrated” covers build-registration and combined cherry-picks whose exact patch IDs differ but final source was inspected. This is more discriminating than treating every plus-sign from `git cherry` as missing code.
| Branch | Tip | Status and action |
|---|---|---|
| `integration/research-consolidation-20260920` | `b1fe359` | New consolidation descendant, created during this audit: adds preserved user formatting (`6950dc6`) and six log-assessment documentation/reference commits (`549b1a7` through `b1fe359`) after `d7acb0d`. These were not represented in the base snapshot. |
| `main` | `75cc638` | Ancestor; already represented. No additional merge. |
| `research/baseline-20260916` | `80cc3d8` | Ancestor; already represented. No additional merge. |
| `research/central-constraint-20260916` | `2e19c2c` | All 4 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/combined-20260916` | `95d9fba` | Ancestor; already represented. No additional merge. |
| `research/coupled-convergence-study-20260919` | `d7acb0d` | Ancestor; already represented. No additional merge. |
| `research/coupled-shape-coarse-20260918` | `4a6c1b5` | Semantically integrated: two equivalent commits; isolated test-registration 4a6c1b5 is already in CMakeLists. Keep diagnostic-only coarse experiment; no additional merge. |
| `research/coupled-trial-correction-20260918` | `46249d0` | Ancestor; already represented. No additional merge. |
| `research/damped-coupled-trial-20260918` | `db854c0` | Ancestor; already represented. No additional merge. |
| `research/density-order-study-20260919` | `ef76e0c` | Ancestor; already represented. No additional merge. |
| `research/diagnostic-campaign-20260917` | `7a07cae` | Ancestor; already represented. No additional merge. |
| `research/experiment-harness-20260916` | `899cb18` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/gravity-compact-application-20260917` | `ff1b889` | Semantically integrated: seven equivalent patches; e599900 and 2c64a92 module/test registration already present. No additional merge. |
| `research/gravity-consistent-schur-20260918` | `c10d019` | All 2 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/gravity-coupling-20260916` | `db0ddd3` | Not integrated: failed one-way completion. Archive README/recipe/manifest and retain branch. Do not adopt old driver or policy. |
| `research/gravity-coupling-ablation-20260919` | `38c7184` | Ancestor; already represented. No additional merge. |
| `research/gravity-curvature-correction-20260917` | `3762c74` | Semantically integrated: four equivalent patches; e599900 registration already present. Keep opt-in; no additional merge. |
| `research/gravity-direction-diagnostics-20260917` | `47775a9` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/gravity-prepared-roundoff-20260917` | `782827c` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/gravity-reduced-newton-20260917` | `d25d141` | Semantically integrated: seven equivalent patches; 5952691 registration already present. Keep opt-in; no additional merge. |
| `research/gravity-trial-diagnostics-20260917` | `7f4b068` | All 2 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/krylov-20260916` | `7127383` | All 4 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/krylov-window-20260916` | `1f9184b` | Semantically integrated: documentation identical, sandbox restart is 160. 937d2f2 was integrated alongside other sandbox changes; no additional merge. |
| `research/linear-coupling-study-20260919` | `0e6688f` | Semantically integrated: core wrapper/tests identical; one patch equivalent and 1d95602 integrated as 2398118 with adjusted surrounding driver/build context. Frozen experiment only. |
| `research/log-density-assessment-20260919` | `90580b2` | Not integrated: six documentation/reference-only commits. Import final assessment and reference script as deferred research; no positivity/runtime change. |
| `research/model-slices-20260919` | `5da3f42` | Semantically integrated: seven equivalent patches; 966a4d4 integrated as 9bac57a. Slice implementation/plotter content identical. No additional merge. |
| `research/n3-compatible-family-20260919` | `1d746b0` | Ancestor; already represented. No additional merge. |
| `research/n3-linear-ablation-20260919` | `e78af98` | Ancestor; already represented. No additional merge. |
| `research/n3-live-field-feedback-20260919` | `1ed03f5` | Ancestor; already represented. No additional merge. |
| `research/negative-density-diagnosis-20260919` | `7ed4d23` | Ancestor; already represented. No additional merge. |
| `research/nonlinear-step-obstruction-20260918` | `2944dd5` | Ancestor; already represented. No additional merge. |
| `research/numerical-strategies-20260917` | `10adf7e` | Ancestor; already represented. No additional merge. |
| `research/polynomial-endpoint-certification-20260917` | `cc6f4b0` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/polynomial-positive-newton-20260917` | `9aefb36` | Semantically integrated: eight equivalent patches; a773c9a registration already present. Available explicit strategy only, not a default; do not enable. |
| `research/preconditioner-benchmarks-20260918` | `dc1da62` | Ancestor; already represented. No additional merge. |
| `research/preconditioner-cached-cross-actions-20260918` | `07769e7` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/pressure-obstruction-20260917` | `c6572d3` | All 3 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/reduced-smooth-surface-20260918` | `2171b8b` | Ancestor; already represented. No additional merge. |
| `research/shape-curvature-20260917` | `b24e6e0` | All 1 unique topic commits patch-equivalent; already represented. No additional merge. |
| `research/shape-field-displacement-q4-20260918` | `785a7ae` | Implementation intentionally excluded: retain Q3. Final report/comparison scripts already identical in integration, preserving negative result. |
| `research/shape-field-weak-response-20260918` | `6ceda61` | Ancestor; already represented. No additional merge. |
| `research/spherical-harmonic-surface-20260919` | `1148c09` | Ancestor; already represented. No additional merge. |
## Verified false-positive unmerged commits
The following unique patch IDs do not indicate missing capabilities:
- `4a6c1b5`: `tests/solver/plateau_coupled_coarse.cpp` is already registered at CMakeLists line 391.
- `e599900`, `2c64a92`, `5952691`, `a773c9a`: gravity subsystem/reduction, compact gravity, polynomial admissibility modules and tests are already in CMakeLists and the exported mean_field module. Reapplying isolated registration commits would only duplicate source entries or conflict.
- `937d2f2`: sandbox explicitly uses FGMRES restart 160. The final Krylov-window report is byte-identical to the topic branch.
- `1d95602`: `plateau_surface_border_schur.hpp` and its regression tests are byte-identical to the final topic branch. Integration commits `2398118` and `522a2cf` carry the implementation and followup test changes.
- `966a4d4`: physical-plane slice headers and current plotter are byte-identical to the final topic branch. Integration starts at `9bac57a`, with final label changes at `07799bc` and `2c6523b`.
- Q4 topic `785a7ae`: `SHAPE_FIELD_WEAK_RESPONSE_2026-09-18.md`, `compare_shape_order_runs.py` and `plot_shape_surface_comparison.py` are already byte-identical to the topic tip. The source-order change from `4be1a23` is deliberately absent.
## What is active versus selectable at d7acb0d
It is essential that the consolidated report distinguish library defaults, example configuration, diagnostic-driver defaults, and recommended research candidates.
| Layer | Current behavior | Consolidation recommendation |
|---|---|---|
| Independent physical fields | Density remains independent DG Q2; enthalpy independent H1 Q3; displacement H1 Q3; gravity RT2/Q2; reference geometry Q4 | Retain. Do not import the Q4 trial or log-density runtime. |
| Density approximation configuration | `MEAN_FIELD_DENSITY_POLYNOMIAL_ORDER=2` compile-time CMake/registry option independent of other fields; uniform increment remains available | Retain configurable order and corrected closure quadrature. Default stays Q2. |
| Surface factory default | Two-argument `makeStellarDiscretization` remains `NodalRadialSurface`, with power-law radial interior and fixed-infinity radial vacuum extensions | Preserve compatibility; avoid silently changing all clients. |
| Sandbox preferred surface | Explicit `SphericalHarmonicSurface` maximum degree 4, all real m, 25 coefficients, coupled with all fields | Retain explicit preferred candidate; nodal remains selectable. |
| Harmonic surface limit | Single MPI rank; sampled basis rank and trace contracts checked. H1 nodal surface surrogate explicitly rejects harmonic coordinates | Report this limitation; do not imply general distributed harmonic support. |
| Normalization | Existing `PhysicalRieszDiagonal` in sandbox; harmonic reference trace metric adds correct primal/dual coefficient scaling | Retain. This is coordinate scaling, not an exact surface response inverse. |
| Sandbox physical model | n=1, J=0, fixed total mass/angular momentum; central density is Lane–Emden seed data only | Retain. Central constraint remains explicitly specifiable for n=3 studies, not a hidden universal constraint. |
| Library FGMRES option default | `FGMRESOptions.restartLength=50` | Unchanged by research. Do not claim it is 160 globally. |
| Sandbox FGMRES configuration | Restart 160; Newton maximum 30; relative nonlinear target 1e-8, linear target .03/cap 200 | Retain known baseline. |
| Diagnostic no-argument controls | Nodal surface, restart 40, independent preconditioner, baseline strategy; runs require output. Campaign manifests explicitly select harmonic/restart160 variants | Keep manifests authoritative; do not confuse convenient CLI defaults with the latest experimental configuration. |
| Warm-start guard | Reused linear correction is reset if its fresh full-J true residual is nonfinite or worse than the cold RHS norm | Retain correctness/performance safeguard; endpoint true-residual check remains authoritative. |
| `makePreconditioner()` | Default stellar structure: independent material/surface and gravity inverse, with generated scalar-border completion | Preserve default until matched full convergence evidence warrants promotion. |
| Default material inverse | SurfaceThenMaterialTriangular with diagonal density/enthalpy/surface solves; exact prepared h-to-density EOS cross derivative and surface-to-material actions included | Retain. Do not describe it as missing h-to-density coupling. |
| Default gravity inverse | GravityApproximateLDU; matrix-free Chebyshev order5/powerIterations20 mass inverse, three fixed AMG cycles | Preserve base comparator; refined consistent Schur remains available. |
| Consistent gravity Schur | Typed `GravityConsistentSchurLDU`, fixed number of sweeps; library policy defaults 1 sweep/relaxation1, diagnostic default relaxation .5 | Retain useful optional implementation and measured manifests; do not conflate the option defaults. |
| Live experimental recipes | `gravity-schur`, `stellar-ldu`, `stellar-ldu-gravity-schur` live in experiments owning recipe layer | Retain. LDU+gravity is currently best live candidate for the tested compatible rotating n3/gravity-curvature configuration, not established universal default. |
| Newton numerical defaults | `SampledEnthalpy`, `MonolithicGravity`, `UncorrectedTrial` | Preserve. No added positivity forcing or auxiliary corrections execute by default. |
| Optional Newton paths | Polynomial enthalpy certificate/repair, gravity-curvature, reduced gravity, fully coupled and damped second-order corrections | Preserve explicit selection and tests as experimental tools; no general convergence claim. |
| Coarse surface/scalar Schur | Experiment-only frozen wrapper; reconstruct after changed Jacobian | Retain diagnostic infrastructure. Do not promote; lower iteration counts did not generally justify setup/application expense. |
| Restart initializer | Explicit diagnostic API validates state/layout/coordinate provenance, prepares/refreshes transactionally, clears warm starts, rolls back failures | Retain. Unconverged snapshots require explicit experimental override. |
| Model slices | Optional experiment export/plot of actual mapped stellar domain; xz/xy/yz/offset options; signed fields retained | Retain. Display approximation/refinement is distinct from FEM convergence or physical validation. |
Source anchors: `sandbox.cpp`; `libmeanfield/interface/equilibrium/stellar_discretization.cppm`; `libmeanfield/interface/field/field_registry.cppm`; `libmeanfield/interface/normalization/stellar_equilibrium.cppm`; `libmeanfield/interface/preconditioning/{stellar_recipe,stellar_structure,material_surface,gravity_field}.cppm`; `libmeanfield/interface/solver/{linear_backend,newton_numerics,stellar_context}.cppm`; `experiments/plateau_diagnostic.cpp`; `experiments/plateau_newton_preconditioner.hpp`.
## Why the failed one-way branch stays historical
`db0ddd3` documents a same-state n3,J0 cold-seed control with original material/gravity subcomponents unchanged, only `MaterialThenGravityTriangular` replacing independence. At restart160/cap200/target .03, true defect improves .0402590 to .0381781 but both fail; solve cost rises 98.915 to117.712s (19%). At restart40, defect worsens .0563080 to .0715826. Direction norm doubles .757644 to1.540825; sampled admissible step tightens .152435 to .0913461. This is not an improvement sufficient for default promotion. It does not rule out the later two-way LDU with better gravity inverse.
The branch's shared harness commit `ad86e2e` includes some source changes also represented later in the main cumulative harness; it is not all useful missing code simply because patch-id differs. Importing its old `plateau_diagnostic.cpp` would erase subsequent functionality.
## Useful cumulative integration already present
- Baseline `80cc3d8` snapshots the user's optimized prepared-operator/reference-table/mapping/normalization path and diagnostics that were not in old main. The main-to-d7 diff includes this earlier user performance work; do not attribute every changed file to the subsequent AI-led numerical experiments.
- Optional central-density example cleanup, restart160 example choice and safeguarded warm starts are cumulative by `95d9fba`.
- Pressure/shape diagnostic instrumentation and typed Newton numerical strategies are integrated by `10adf7e`; prepared gravity arithmetic and compact application fixes are included.
- Consistent Schur, prepared cross-action reuse and honest full-cost frozen benchmarking are integrated by `dc1da62`.
- Coupled/damped trial tools and their bounded negative/conditional results are integrated by `db854c0`.
- Q3-restored weak-response/Q4 comparison report, reduced surface experiments and native all-m harmonic surface are integrated by `1148c09`.
- Negative-density localization, independent density-order configuration, closure quadrature repair and audited order studies are integrated by `ef76e0c`.
- Checked restart, frozen coupled coarse trials, physically compatible n3 controls, slices and final convergence/cost/virial evidence are integrated by `d7acb0d`.
## Consolidation and validation risks
1. **Do not promote experimental settings merely because they enter main.** Main can contain tested optional research modules. The final report must explicitly state which settings are defaults, preferred research candidates and failed historical alternatives.
2. **Preserve source provenance.** Campaign numerical executables were copied from specific producer commits. Main integration changes do not retroactively change the meaning of old runs. Keep original commands, metadata, hashes and branch tips, and include relocation manifests when moving results.
3. **Preserve old paths carefully.** Many tracked research reports and JSON manifests refer to evidence under workspace `diagnostics/` using worktree-relative or absolute paths. Relocation requires either stable links or a documented path mapping and adjusted browse links. Do not rewrite original run metadata/hashes simply to make them look current.
4. **Untracked build trees have absolute cache paths.** Moving them may invalidate rebuilds. Preserve them as historical artifacts or use explicit compatible links; configure a fresh consolidation build instead of treating a moved cache as portable.
5. **Do not rerun a full campaign unnecessarily.** A source-equivalent integration needs targeted build/smoke/regression checks around added files and resolved conflicts, not new scientific claims. The previous 24-case audit is a provenance check, not proof that every model converged.
6. **Harmonic support is serial.** A two-rank rejection test is not MPI solver validation. Report this accurately.
7. **No end-to-end target claim.** The latest compatible rotating n3 LDU endpoint remains unconverged; energy/h virial1.81141e-5 and both rho-pressure virials fail1e-5. No 50%-critical calibration exists. Lower finite-budget residuals are not measured mathematical floors.
8. **Documentation import is not new policy.** The log-density reference model is historical isolated analysis. Keep its label explicit and do not present it as an implemented solver option.
## Audit limits
This audit checks ancestry, patch equivalence, source content, defaults and recorded evidence. It does not constitute a new exhaustive correctness review of all 57k lines added since old main, nor a numerical rerun. Exact source comparisons established the particular equivalences above; registration line numbers refer to d7acb0d and can shift during consolidation. The parent integrator should record the final consolidation SHA, any actual conflicts/resolutions, validation results, and the eventual status of the preserved user formatting edit.
## Consolidation update
After the base-snapshot audit, the integrator preserved the user formatting change as `6950dc6` and imported all six log-density documentation/reference commits, ending at `b1fe359` on `integration/research-consolidation-20260920`. Consequently the earlier base-snapshot recommendation to import the log assessment is fulfilled. No numerical behavior was added by those seven commits. The original branch table entries otherwise describe their relationship to `d7acb0d`, not their eventual status after consolidation.

67
reports/build_report.py Normal file
View File

@@ -0,0 +1,67 @@
#!/usr/bin/env python3
"""Build the handoff's Markdown with Pandoc and its PDF with LaTeX.
The LaTeX is authoritative. Generated Markdown is deliberately not post-edited,
so a reader can regenerate both delivery formats from the same research record.
"""
from pathlib import Path
import argparse
import hashlib
import json
import shutil
import subprocess
import sys
import time
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--markdown-only', action='store_true')
args = parser.parse_args()
reports = Path(__file__).resolve().parent
stem = 'MeanField_research_handoff_2026-09-20'
source = reports / (stem + '.tex')
build = reports.parent / 'working/report_builds/research_handoff'
build.mkdir(parents=True, exist_ok=True)
commands = [[
'pandoc', '--from=latex', '--to=gfm-tex_math_gfm+tex_math_dollars', '--standalone',
'--toc', '--toc-depth=2', '--lua-filter=pandoc_tables.lua',
'--wrap=none', '--output=' + stem + '.md', source.name,
], [sys.executable, 'check_report_conversion.py',
'--output', str(build / 'conversion_audit.json')]]
if not args.markdown_only:
commands.append([
'latexmk', '-pdf', '-interaction=nonstopmode', '-halt-on-error',
'-outdir=' + str(build), source.name,
])
record = {'source_sha256': hashlib.sha256(source.read_bytes()).hexdigest(),
'commands': [], 'outputs': {}}
for index, command in enumerate(commands):
executable = shutil.which(command[0])
if executable is None:
raise SystemExit(f'Required program is unavailable: {command[0]}')
command[0] = executable
start = time.monotonic()
log = build / f'build_{index}.log'
with log.open('w') as stream:
result = subprocess.run(command, cwd=reports, stdout=stream,
stderr=subprocess.STDOUT)
record['commands'].append({'command': command, 'returncode': result.returncode,
'seconds': time.monotonic() - start})
(build / 'build_manifest.json').write_text(json.dumps(record, indent=2) + '\n')
if result.returncode:
raise SystemExit(f'Report build failed; inspect {log}')
if not args.markdown_only:
shutil.copy2(build / (stem + '.pdf'), reports / (stem + '.pdf'))
for suffix in ['.tex', '.md'] + ([] if args.markdown_only else ['.pdf']):
path = reports / (stem + suffix)
record['outputs'][path.name] = {
'sha256': hashlib.sha256(path.read_bytes()).hexdigest(),
'bytes': path.stat().st_size,
}
(build / 'build_manifest.json').write_text(json.dumps(record, indent=2) + '\n')
print('Generated ' + ', '.join(record['outputs']))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,305 @@
#!/usr/bin/env python3
"""Check the handoff's LaTeX-to-Markdown conversion without modifying inputs.
Pandoc's parsed tables preserve cell boundaries, which catches both lost values
and accidental columns caused by vertical bars in mathematical expressions.
Figure captions need a separate comparison because GFM stores them as raw HTML.
Only the explicitly requested JSON record is written; no report is rebuilt.
"""
from pathlib import Path
from collections import Counter
from html.parser import HTMLParser
import argparse
import copy
import datetime
import hashlib
import json
import re
import shutil
import subprocess
import sys
STEM = 'MeanField_research_handoff_2026-09-20'
MARKDOWN_FORMAT = 'gfm-tex_math_gfm+tex_math_dollars'
def nodes(value, skip_figures=False):
if isinstance(value, dict):
if skip_figures and value.get('t') == 'Figure':
return
yield value
for child in value.values():
yield from nodes(child, skip_figures)
elif isinstance(value, list):
for child in value:
yield from nodes(child, skip_figures)
def semantic_tokens(value):
"""Keep values and math distinct; disregard layout-only whitespace."""
if isinstance(value, dict):
kind = value.get('t')
if kind == 'Str':
return [('text', value['c'])]
if kind == 'Code':
return [('code', value['c'][1])]
if kind == 'Math':
return [('math', value['c'][0]['t'],
re.sub(r'\s+', ' ', value['c'][1]).strip())]
return [token for child in value.values()
for token in semantic_tokens(child)]
if isinstance(value, list):
return [token for child in value for token in semantic_tokens(child)]
return []
def row_values(row):
# Retaining spans and cell boundaries rejects values shifted into a neighbor.
return [(cell[2], cell[3], semantic_tokens(cell[4])) for cell in row[1]]
def table_values(table, omit_empty_head=False):
content = table['c']
head = [row_values(row) for row in content[3][1]]
if omit_empty_head and all(not cell[2] for row in head for cell in row):
head = []
body = [row_values(row) for group in content[4]
for row in group[2] + group[3]]
foot = [row_values(row) for row in content[5][1]]
return {'columns': len(content[2]), 'caption': semantic_tokens(content[1]),
'head': head, 'body': body, 'foot': foot}
def expected_filtered_table(table):
result = copy.deepcopy(table)
head, bodies = result['c'][3][1], result['c'][4]
removed = False
if len(head) == 1 and bodies and bodies[0][3]:
head_contents = [cell[4] for cell in head[0][1]]
first_contents = [cell[4] for cell in bodies[0][3][0][1]]
if head_contents == first_contents:
bodies[0][3].pop(0)
removed = True
return result, removed
class HTMLInventory(HTMLParser):
"""Compare rendered captions, including their inline mathematical markup."""
def __init__(self):
super().__init__(convert_charrefs=True)
self.ids = []
self.figures = []
self.figure = None
self.in_caption = False
def handle_starttag(self, tag, attrs):
attrs = dict(attrs)
if 'id' in attrs:
self.ids.append(attrs['id'])
if tag == 'figure':
self.figure = {'id': attrs.get('id', ''), 'images': [],
'caption_count': 0, 'caption': []}
if self.figure is None:
return
if tag == 'img':
self.figure['images'].append(
{'src': attrs.get('src', ''), 'alt': attrs.get('alt', '')})
if tag == 'figcaption':
self.in_caption = True
self.figure['caption_count'] += 1
elif self.in_caption:
self.figure['caption'].append(
('start', tag, sorted(attrs.items())))
def handle_startendtag(self, tag, attrs):
self.handle_starttag(tag, attrs)
if tag not in {'img', 'br', 'hr', 'input', 'meta', 'link'}:
self.handle_endtag(tag)
def handle_endtag(self, tag):
if self.figure is None:
return
if tag == 'figcaption':
self.in_caption = False
elif tag == 'figure':
self.figures.append(self.figure)
self.figure = None
elif self.in_caption:
self.figure['caption'].append(('end', tag))
def handle_data(self, data):
if self.in_caption:
self.figure['caption'].extend(('text', word) for word in data.split())
def math_counts(blocks):
return Counter((node['c'][0]['t'], re.sub(r'\s+', ' ', node['c'][1]).strip())
for node in nodes(blocks, skip_figures=True)
if node.get('t') == 'Math')
def counter_entries(counter):
return [{'value': value, 'count': count} for value, count in sorted(counter.items())]
def file_record(path):
data = path.read_bytes()
return {'path': str(path), 'sha256': hashlib.sha256(data).hexdigest(),
'bytes': len(data)}
def check(args, record):
pandoc = shutil.which('pandoc')
if pandoc is None:
raise RuntimeError('Pandoc is required but was not found on PATH.')
record['pandoc_version'] = subprocess.check_output(
[pandoc, '--version'], text=True).splitlines()[0]
def convert(text, source_format, target_format, filtered=False):
command = [pandoc, '--from=' + source_format, '--to=' + target_format]
if filtered:
command.append('--lua-filter=' + str(args.lua_filter))
return subprocess.run(command, input=text, text=True, capture_output=True,
check=True, cwd=args.tex.parent).stdout
inputs = [args.tex, args.markdown, args.lua_filter]
record['inputs'] = [file_record(path) for path in inputs]
tex_text, markdown_text = args.tex.read_text(), args.markdown.read_text()
raw = json.loads(convert(tex_text, 'latex', 'json'))
source = json.loads(convert(tex_text, 'latex', 'json', filtered=True))
markdown = json.loads(convert(markdown_text, MARKDOWN_FORMAT, 'json'))
errors = record['errors']
# The generated TOC is not document content. Verify its membership before
# excluding it from the independent body-math comparison.
expected_toc = [node['c'][1][0] for node in nodes(source['blocks'])
if node.get('t') == 'Header' and node['c'][0] <= args.toc_depth]
toc_blocks = []
if markdown['blocks'] and markdown['blocks'][0].get('t') == 'BulletList':
toc_blocks = [markdown['blocks'].pop(0)]
toc_targets = [node['c'][2][0][1:] for node in nodes(toc_blocks)
if node.get('t') == 'Link' and node['c'][2][0].startswith('#')]
if toc_targets != expected_toc:
errors.append('Generated TOC entries differ from the source headings.')
tables = lambda ast: [node for node in nodes(ast['blocks'])
if node.get('t') == 'Table']
raw_tables, source_tables, markdown_tables = map(tables, (raw, source, markdown))
record['table_counts'] = {'source': len(raw_tables), 'filtered': len(source_tables),
'markdown': len(markdown_tables)}
if len({len(raw_tables), len(source_tables), len(markdown_tables)}) != 1:
errors.append('Table counts differ between source, filtered source and Markdown.')
record['tables'] = []
for index, (original, filtered, actual) in enumerate(
zip(raw_tables, source_tables, markdown_tables), start=1):
expected, removed = expected_filtered_table(original)
# GFM requires a header separator even when LaTeX has no header. Its
# resulting empty row carries no data and is the sole allowed addition.
expected_values = table_values(filtered)
actual_values = table_values(actual, omit_empty_head=not expected_values['head'])
unchanged = expected == filtered
equivalent = expected_values == actual_values
record['tables'].append({
'index': index, 'removed_duplicate_header': removed,
'filter_changes_exactly_expected': unchanged,
'all_cell_values_and_math_preserved': equivalent,
'body_rows': len(expected_values['body']),
'numeric_tokens': sum(any(char.isdigit() for char in token[-1])
for token in semantic_tokens(filtered)),
})
if not unchanged:
errors.append(f'Table {index}: unexpected Lua-filter mutation.')
if not equivalent:
errors.append(f'Table {index}: cell values, boundaries, math or caption changed.')
source_math, markdown_math = map(math_counts,
(source['blocks'], markdown['blocks']))
record['body_math'] = {
'source_count': sum(source_math.values()),
'markdown_count': sum(markdown_math.values()),
'source_only': counter_entries(source_math - markdown_math),
'markdown_only': counter_entries(markdown_math - source_math),
}
if source_math != markdown_math:
errors.append('Body mathematics differs; figure-caption math is checked separately.')
paths = re.findall(r'\\(?:nolinkurl|path)\{([^}]*)\}', tex_text)
code_counts = lambda ast: Counter(node['c'][1] for node in nodes(ast['blocks'])
if node.get('t') == 'Code')
source_code, markdown_code = map(code_counts, (source, markdown))
path_differences = [{'path': path, 'source_count': source_code[path],
'markdown_count': markdown_code[path]}
for path in sorted(set(paths))
if path not in markdown_text or source_code[path] != markdown_code[path]]
record['paths'] = {'source_occurrences': len(paths), 'distinct': len(set(paths)),
'differences': path_differences}
if path_differences:
errors.append('Repository path text or occurrence counts changed.')
inventories = []
for ast in (source, markdown):
inventory = HTMLInventory()
inventory.feed(convert(json.dumps(ast), 'json', 'html5'))
inventory.close()
inventories.append(inventory)
expected_html, actual_html = inventories
record['figures'] = {
'source_count': len(expected_html.figures),
'markdown_count': len(actual_html.figures),
'images_ids_and_captions_preserved': expected_html.figures == actual_html.figures,
'source': expected_html.figures,
'markdown': actual_html.figures,
}
if expected_html.figures != actual_html.figures:
errors.append('Figure identifiers, image paths or rendered captions differ.')
missing_targets = [target for target in toc_targets if target not in actual_html.ids]
record['toc'] = {'expected_entries': len(expected_toc), 'entries': len(toc_targets),
'matches_source_headings': toc_targets == expected_toc,
'missing_targets': missing_targets}
if missing_targets:
errors.append('Some generated TOC links have no Markdown destination.')
record['inputs_unchanged'] = record['inputs'] == [file_record(path) for path in inputs]
if not record['inputs_unchanged']:
errors.append('An input changed during the audit; rerun against a stable report.')
def main():
reports = Path(__file__).resolve().parent
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--tex', type=Path, default=reports / (STEM + '.tex'))
parser.add_argument('--markdown', type=Path, default=reports / (STEM + '.md'))
parser.add_argument('--lua-filter', type=Path, default=reports / 'pandoc_tables.lua')
parser.add_argument('--toc-depth', type=int, default=2)
parser.add_argument('--output', type=Path, required=True,
help='Explicit destination for the JSON audit record.')
args = parser.parse_args()
for name in ['tex', 'markdown', 'lua_filter', 'output']:
setattr(args, name, getattr(args, name).resolve())
if args.output.suffix.lower() != '.json':
parser.error('--output must name a JSON file; source documents are read-only.')
if args.output in {args.tex, args.markdown, args.lua_filter, Path(__file__).resolve()}:
parser.error('--output cannot overwrite an input or the checker.')
record = {'checked_utc': datetime.datetime.now(datetime.timezone.utc).isoformat(),
'checker': file_record(Path(__file__).resolve()), 'errors': []}
try:
check(args, record)
except (OSError, RuntimeError, ValueError, KeyError, IndexError,
subprocess.CalledProcessError) as error:
record['errors'].append(str(error))
if isinstance(error, subprocess.CalledProcessError):
record['pandoc_error'] = error.stderr
record['passed'] = not record['errors']
args.output.parent.mkdir(parents=True, exist_ok=True)
args.output.write_text(json.dumps(record, indent=2) + '\n')
status = 'PASS' if record['passed'] else 'FAIL'
print(f'{status}: report conversion audit saved to {args.output}')
for error in record['errors']:
print(error, file=sys.stderr)
return 0 if record['passed'] else 1
if __name__ == '__main__':
sys.exit(main())

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 KiB

28
reports/pandoc_tables.lua Normal file
View File

@@ -0,0 +1,28 @@
-- LaTeX longtables repeat their heading on a new PDF page. Pandoc also exposes
-- that repeated heading as the first body row; Markdown needs it only once.
local function row_signature(row)
local cells = {}
for _, cell in ipairs(row.cells) do
cells[#cells + 1] = pandoc.write(pandoc.Pandoc(cell.contents), 'native')
end
return table.concat(cells, '\n--cell--\n')
end
function Table(value)
if #value.head.rows ~= 1 or #value.bodies == 0 then return value end
local rows = value.bodies[1].body
if #rows > 0 and row_signature(rows[1]) == row_signature(value.head.rows[1]) then
table.remove(rows, 1)
end
return value
end
-- GFM headings cannot carry LaTeX's explicit section labels. Preserve those
-- anchors so Pandoc's generated contents links still resolve in the Markdown.
function Header(value)
if value.identifier:find(':', 1, true) then
local id = value.identifier:gsub('&', '&amp;'):gsub('"', '&quot;'):gsub('<', '&lt;'):gsub('>', '&gt;')
return {pandoc.RawBlock('html', '<a id="' .. id .. '"></a>'), value}
end
return value
end

Binary file not shown.

View File

@@ -0,0 +1,534 @@
\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{listings}
\hypersetup{
colorlinks=true,
linkcolor=blue!55!black,
urlcolor=blue!55!black
}
\lstset{
basicstyle=\ttfamily\small,
breaklines=true,
columns=fullflexible,
frame=single,
keepspaces=true,
showstringspaces=false
}
\title{MeanField Single-Core and Distributed Performance Optimization Report}
\author{Implementation based on repository checkpoint
\texttt{25510008ddf9810eaf9821149734d526c76b087a}}
\date{2 September 2026}
\begin{document}
\maketitle
\begin{abstract}
This report describes a performance-focused revision of the MeanField code base.
The work starts from checkpoint
\texttt{25510008ddf9810eaf9821149734d526c76b087a} and treats the existing code as
authoritative whenever it differs from the earlier optimization audit. The
changes add bounded and MPI-aware profiling tools, remove avoidable allocation
and mapping work, introduce a primal-only gravity preparation path, enable
release interprocedural optimization, and correct true-degree-of-freedom versus
local-degree-of-freedom handling in MFEM partial-assembly operators. The
preconditioner was deliberately left unchanged.
The unchanged gravity virial consistency test now takes approximately
205.84 seconds on one MPI rank, 118.93 seconds on two ranks, and 65.21 seconds
on four ranks. The centrifugal h-refinement test fell from a historical
525.60 seconds to 254.98 seconds. The complete release suite passes all
410 test cases and 5,086,850 assertions without changing a tolerance,
resolution, or existing user-facing call signature.
\end{abstract}
\tableofcontents
\section{Scope and invariants}
The optimization audit was used as technical input, not as an instruction
source. Repository behavior and the user's requirements governed every
decision. In particular, this work preserved the following invariants:
\begin{itemize}
\item numerical tolerances and spatial or quadrature resolutions were not
weakened;
\item existing user-facing entry points and call signatures were preserved;
\item compile-time physical structure and typed field/domain contracts were
retained;
\item error conditions remain explicit rather than silently falling back;
\item the preconditioner algorithm was not modified, because it is reserved
for a subsequent optimization effort;
\item \texttt{./format} was run immediately before every compilation; and
\item all unrelated files and pre-existing working-tree changes were left
intact.
\end{itemize}
Several low-level prepared-operator classes received additive inspection and
primal-preparation methods. These additions do not alter existing calls or
semantics; they expose the distinction between primal data and derivative data
to internal orchestration and tests.
\section{Measurement methodology}
\subsection{Two build modes}
Two separate release-style configurations were used so instrumentation could
not be confused with production performance:
\begin{description}
\item[Optimized release.] Profiling is compiled out and interprocedural
optimization (IPO/LTO) is enabled. This build supplies the authoritative
wall-time measurements.
\item[Profiling release.] Profiling is enabled and IPO is disabled. This
build identifies proportions and call counts. Its absolute wall time is not
compared directly with the optimized release build.
\end{description}
The CMake options are
\texttt{MEAN\_FIELD\_ENABLE\_PROFILING} (default \texttt{OFF}) and
\texttt{MEAN\_FIELD\_ENABLE\_IPO} (default \texttt{ON}). CMake checks IPO
support and fails with an explicit diagnostic when it is requested but not
supported.
\subsection{Bounded runner}
The new \path{tools/profile_tests.py} runner executes Catch2 filters on one or
more MPI rank counts. Each run has:
\begin{itemize}
\item an independent combined stdout/stderr log;
\item a wall-clock timeout;
\item process-group termination, followed by forced termination after a
configurable grace period;
\item one durable CSV row written immediately after each repetition; and
\item an exact JSON representation of the command that was measured.
\end{itemize}
Starting each child in a new process session is important for MPI: a timeout
can terminate the launcher and all of its workers rather than leaving orphaned
ranks. Both successful smoke runs and an intentionally forced timeout were
used to verify cleanup. Runner options may appear on either side of the test
filter; additional Catch2 arguments are placed after \texttt{--}.
\subsection{In-process instrumentation}
The profiling registry records named regions, warmup observations, work-unit
counters, minimum/maximum durations, and total duration. Call-site-static
\texttt{Region} objects cache registration indices so the timed path does not
repeatedly allocate or look up a string. The registry is mutex protected for
well-defined use from multiple host threads.
When profiling is disabled, all scope timers and counters expand to no-ops at
preprocessing time. Labels are not evaluated, registry locks are not taken,
and no timer object is constructed. The production build therefore does not
pay a runtime branch for disabled instrumentation.
MPI aggregation first exchanges and unions the complete set of labels. It
then performs every reduction in the same globally sorted label order. This
matters when a region is visited on only a subset of ranks: iterating each
rank's local map directly would issue different collective sequences and can
deadlock. A dedicated MPI test deliberately registers one rank-local label
per process and verifies that aggregation terminates and reports the expected
sample ranges.
\section{Implemented optimizations}
\subsection{Identity field maps}
\texttt{FieldDofMap} now has direct paths for identity maps in
\texttt{gather}, \texttt{scatter}, \texttt{scatter\_into}, and
\texttt{scatter\_add}. The common all-domain gravity fields no longer traverse
an index indirection one scalar at a time. The optimized operations become an
MFEM vector assignment or scaled add, while the general supported-domain path
is unchanged.
This change is intentionally located at the mapping abstraction rather than at
individual physics call sites. Every consumer benefits, and the compile-time
field/domain descriptions still determine whether a map is an identity.
\subsection{Primal-only gravity preparation}
The reduced gravity solve needs a mapped mass action and mapped source action,
but it does not apply derivatives with respect to displacement. Previously,
construction of every reduced solve also built derivative-only element data:
displacement DOF tables, inverse element Jacobians, and mass-variation caches.
The geometry context now distinguishes two preparation modes:
\begin{description}
\item[Primal preparation] builds only data required by residual/operator
application.
\item[Linearization preparation] additionally builds all displacement
variation data.
\end{description}
The reduced operator requests primal preparation. A later request for a
linearization at the same discretization and displacement revisions upgrades
the context in place rather than incorrectly treating it as already complete.
Derivative entry points explicitly reject use after primal-only preparation.
Tests cover initial primal preparation, no-op re-preparation, same-revision
upgrade, and the availability of derivative data after upgrade.
This moves work from an unconditional runtime setup path to the path that
actually requests the corresponding mathematical operation. It also reduces
peak retained data for primal-only solves.
\subsection{Prepared gravity-source workspaces}
The mapped gravity source operator previously created several MFEM vectors on
every application and on every transpose application. Density/potential local
vectors, element inputs, quadrature actions, element actions, and local output
vectors are now persistent workspaces owned by the prepared operator.
\texttt{SetSize} can therefore reuse allocated capacity across calls.
Identity potential maps write directly into the caller's output vector instead
of first producing a full true-DOF vector and gathering it back. Primal-only
preparation also omits displacement transformations and inverse-Jacobian tables
that are used solely by derivative actions.
\subsection{Gravity operator workspace and hot branches}
\texttt{GravityFieldOperator} now owns reusable vectors for potential,
gradient, divergence, and transpose-divergence actions. When both gravity
field maps are identities---the dominant production case---the operator passes
the existing views directly to the mass and divergence operators. The general
reduced-map path remains available.
The identity and one-rank paths use C++ branch-likelihood annotations. This
does not change semantics, but it gives the optimizer useful layout guidance:
the common straight-line path is kept contiguous and exceptional mapping work
is placed off the hot path.
\subsection{MFEM true/local DOF correctness and MPI performance}
The largest distributed correctness defect was a contract mismatch. MFEM
\texttt{ParBilinearForm} and \texttt{ParMixedBilinearForm} partial-assembly
\texttt{Mult} operations consume rank-local DOF vectors. The production code
was supplying true-DOF vectors. Those sizes and layouts coincide on one rank,
which hid the defect; with multiple ranks, the mapped H(div) mass action became
nonlinear and nonsymmetric, the divergence transpose identity failed, and
MINRES did not converge.
The mapped H(div) mass operator now performs, for multiple ranks:
\begin{enumerate}
\item one true-to-local prolongation;
\item the stellar and vacuum partial-assembly actions on local vectors;
\item local addition of the two domain contributions; and
\item one local-to-true transpose-prolongation.
\end{enumerate}
Persistent local buffers avoid allocating on each call. A communicator-size
test controls the fast path. It is deliberately not based on a rank-local
comparison of vector sizes: such a condition can differ across ranks and send
processes through different collective sequences.
The divergence form is wrapped by a final
\texttt{TrueDofParMixedBilinearFormOperator}. Forward and transpose operations
perform the corresponding trial/test true-to-local and local-to-true transfers,
validate dimensions, and require congruent communicators. The one-rank path
calls the local form directly.
An attempted fusion of the stellar and vacuum H(div) partial-assembly forms was
rejected. Although its operator action matched, 35,856 diagonal assertions
failed because MFEM's marker-specific diagonal assembly masks accumulated
entries after each integrator. The separate forms were retained; preserving
the diagonal contract is more important than a speculative reduction in one
operator call.
\subsection{Analysis and virial traversals}
Center-of-mass, quadrupole, and mesh-volume traversals now reuse mapping context
and scratch objects rather than reconstructing them at every quadrature point.
Mass and first moments are packed into one MPI reduction. The virial helper
similarly packs six reductions into three arrays: energy sums, status counts,
and determinant extrema. This lowers synchronization overhead without changing
the mathematical reductions.
The profiler also records mapping-evaluation counts. In the principal virial
test, center of mass, quadrupole, and energy integration each perform 1,605,632
mapping evaluations over the seven deformation amplitudes. The counts make it
possible to distinguish a faster kernel from an accidentally skipped traversal.
\subsection{Centrifugal mapping evaluation}
The centrifugal residual and Jacobian used to request quadrature geometry and
physical position through separate mapping calls at the same point. A single
\texttt{EvaluateVolume} now provides both the quadrature weight and physical
position, with an explicit invalid-mapping error. Scratch contexts are reused
through the element loop.
Independent test/reference traversals were updated in the same manner: each
quadrature point is mapped once, and nodal positions use one reusable point
context. This does not weaken the reference calculation; it removes duplicate
geometry work from the test itself. The stable 2.06-fold reduction in the
h-refinement test wall time confirms that this was a distinct mapping hot path.
\subsection{Interprocedural optimization}
IPO/LTO is enabled for the release versions of the main library, test support,
tests, MPI tests, and experiment executables. Applying IPO only to the static
library is insufficient: call sites in the final executables must participate
for cross-module inlining, devirtualization where provable, dead-code removal,
and scalar replacement to cross archive boundaries.
Direct initialization is retained around profiled factory expressions so
mandatory copy elision remains available. The profiling macro used for
expressions returns \texttt{decltype(auto)}; when profiling is disabled, it
collapses directly to the wrapped expression.
\section{MPI regression suite}
A separate \texttt{mpi\_tests} executable avoids running hundreds of unrelated
serial tests independently on every rank. CTest registers two jobs,
\texttt{mpi\_2\_ranks} and \texttt{mpi\_4\_ranks}, under the
\texttt{mpi;distributed} labels. The jobs share a resource lock, advertise
their processor counts, and have a 180-second test timeout. The
\texttt{check\_mpi} target builds the MPI executable and runs this label set.
The suite verifies:
\begin{itemize}
\item world and split-communicator membership;
\item exact global mesh-partition coverage and nonempty local partitions;
\item mapped H(div) mass linearity and symmetry;
\item divergence/transpose-divergence adjointness;
\item finite distributed center-of-mass and quadrupole analysis;
\item a complete gravity solve at relative tolerance \(10^{-12}\), absolute
tolerance \(10^{-15}\), and at most 1000 iterations; and
\item profiling aggregation when ranks have different local region labels.
\end{itemize}
The ordinary Catch2 runner now broadcasts rank zero's random seed after MPI
initialization. Before this change, ranks could randomly execute tests in
different orders and enter incompatible collectives. Only rank zero emits the
custom progress report, while all ranks still execute every assertion.
The measurements in this report used multiple MPI processes on one physical
machine. They validate distributed ownership and communication semantics and
the same suite can run under a multi-node launcher, but inter-host fabric and
scheduler behavior were not measurable on the available host. Therefore the
report calls these ``multi-rank'' results rather than claiming a physical
multi-node hardware validation.
\section{Performance results}
\subsection{Release wall times}
\begin{table}[htbp]
\centering
\begin{tabular}{lrrr}
\toprule
Measurement & Before (s) & After (s) & Result \\
\midrule
Prepared spectral-mode Jacobian application & $\sim 3.98$ & 3.965 & maintained \\
Gravity virial consistency, one rank & 215.93 & 205.84 & 1.049$\times$ \\
Centrifugal virial h refinement & 525.60 & 254.98 & 2.061$\times$ \\
\bottomrule
\end{tabular}
\caption{Representative optimized-release wall times. The approximately
23-second Jacobian time belongs to the earlier pre-checkpoint phase; checkpoint
\texttt{25510008} had already reached approximately 3.98 seconds.}
\end{table}
The new work did not regress the previously optimized Jacobian path: the first
prepared application measured 3.964707 seconds. The original loose one-second
goal remains unmet, but the present work intentionally focused on other paths.
\subsection{MPI scaling}
\begin{table}[htbp]
\centering
\begin{tabular}{rrrr}
\toprule
MPI ranks & Virial wall (s) & Speedup & Parallel efficiency \\
\midrule
1 & 205.843 & 1.00$\times$ & 100.0\% \\
2 & 118.926 & 1.73$\times$ & 86.5\% \\
4 & 65.210 & 3.16$\times$ & 78.9\% \\
\bottomrule
\end{tabular}
\caption{Unchanged gravity virial test in the IPO-enabled release build.}
\end{table}
Two focused mapped-H(div) measurements show similar scaling:
\begin{table}[htbp]
\centering
\begin{tabular}{lrrr}
\toprule
Test & 1 rank (s) & 2 ranks (s) & 4 ranks (s) \\
\midrule
Operator identities & 3.461 & 1.907 & 1.115 \\
Prepared versus stateless kernel & 9.516 & 5.724 & 2.841 \\
\bottomrule
\end{tabular}
\caption{Focused distributed mapped-H(div) regressions.}
\end{table}
The registered release MPI suite passed in 18.12 seconds on two ranks and
10.11 seconds on four ranks.
\subsection{Full regression result}
The full IPO-enabled release suite completed in 2,807.831 seconds:
\begin{center}
\begin{tabular}{lr}
\toprule
Test cases & 410 passed, 0 failed \\
Assertions & 5,086,850 passed, 0 failed \\
\bottomrule
\end{tabular}
\end{center}
The original baseline contained 406 test cases and 5,086,800 assertions. The
additional assertions cover profiling behavior and the primal/linearization
preparation distinction. MPI cases are exercised separately at two and four
ranks.
\section{Why the virial test remains long}
The virial test is not dominated by the coupled spectral-mode Jacobian. It
constructs and solves seven reduced gravity systems. The final profiling build
reported:
\begin{longtable}{lrrr}
\toprule
Region & Calls & Mean per call & Total \\
\midrule
\endhead
Gravity solve & 7 & 27.502 s & 192.512 s \\
MINRES & 7 & 24.625 s & 172.375 s \\
Reduced gravity operator \texttt{Mult} & 4,617 & 20.651 ms & 95.344 s \\
Mapped H(div) mass \texttt{Mult} & 4,617 & 15.279 ms & 70.543 s \\
Reduced-operator construction & 7 & 2.277 s & 15.937 s \\
H(div) primal preparation & 7 & 1.472 s & 10.303 s \\
Source primal preparation & 7 & 0.800 s & 5.599 s \\
Preconditioner construction & 7 & 0.583 s & 4.080 s \\
Center of mass & 7 & 0.471 s & 3.294 s \\
Quadrupole & 7 & 0.474 s & 3.316 s \\
Virial energy integration & 7 & 0.975 s & 6.823 s \\
\bottomrule
\end{longtable}
MINRES performed 4,611 iterations across the seven systems. Consequently, a
20.65-millisecond matrix-free application becomes roughly 95 seconds of work,
and the H(div) mass action alone is about 74\% of each reduced operator call.
The remaining MINRES time includes the deliberately unchanged preconditioner,
vector operations, reductions, and Krylov recurrence bookkeeping.
This explains the apparent disconnect between the approximately four-second
coupled Jacobian application and the approximately 206-second virial test:
they exercise different operators with radically different call counts. A
future preconditioner improvement that materially reduces iteration count has
much greater leverage on the virial test than another small reduction in
analysis integration time. That work was explicitly excluded from this
revision.
\section{Known distributed boundary}
The lower-level gravity analysis and solve now operate correctly and scale on
multiple MPI ranks. The complete spectral equilibrium experiment still cannot
start on more than one rank. It stops during problem construction with the
existing explicit error:
\begin{quote}
\ttfamily
Logical radial surface interpolation currently supports one MPI rank; shared
interpolation-row ownership remains deferred.
\end{quote}
This is not a preconditioner or gravity-kernel failure. Supporting the path
requires a distributed ownership design for projected radial-surface
interpolation rows, including rows whose supporting boundary element and basis
DOFs live on another rank. A safe implementation needs a global surface-DOF
identity, deterministic ownership at partition interfaces, distributed row
construction, and transpose-consistent communication. That is an architectural
extension, so it was not improvised in a performance patch under the stated
``no architectural rewrite'' constraint.
\section{Recommended next work}
The measurements suggest the following order for subsequent work:
\begin{enumerate}
\item Improve the reduced-gravity preconditioner and measure iteration-count
reduction. This is the highest-leverage virial optimization and is
intentionally reserved for the next agent.
\item Profile the divergence and transpose-divergence portions of the
remaining 5.37 milliseconds per reduced application. Determine
whether true/local transfers can be safely hoisted or combined across
the two block actions.
\item If a custom mapped-H(div) kernel is justified, fuse the stellar and
vacuum domain passes while reproducing MFEM's marker-specific diagonal
semantics exactly. The failed generic-form fusion demonstrates that
operator equivalence alone is insufficient.
\item Design distributed radial-surface interpolation ownership as a separate
feature. Add forward/transpose virtual-work tests before enabling the
multi-rank spectral experiment.
\item Run the existing rank sweep on actual multi-node hardware, ideally with
CPU affinity and at least three repetitions, to separate network
scaling from same-host memory-bandwidth effects.
\end{enumerate}
\section{Reproduction commands}
The practical command guide is also recorded in
\path{docs/profiling_and_mpi.md}. The essential sequence is:
\begin{lstlisting}[language=bash]
# Profiling build: format immediately before configure/build.
./format
cmake -S . -B cmake-build-profile-homebrew-llvm -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DMEAN_FIELD_ENABLE_PROFILING=ON \
-DMEAN_FIELD_ENABLE_IPO=OFF
./format
cmake --build cmake-build-profile-homebrew-llvm --target tests mpi_tests -j 6
# Bounded serial and rank-sweep measurements.
python3 tools/profile_tests.py \
--executable cmake-build-profile-homebrew-llvm/tests \
--ranks 1 --timeout 360 \
"Gravity Field Virial Consistency Across Volume Preserving Deformation" \
-- --reporter console
python3 tools/profile_tests.py \
--executable cmake-build-release-homebrew/tests \
--ranks 1,2,4 --timeout 360 \
"Gravity Field Virial Consistency Across Volume Preserving Deformation"
# Registered MPI regressions.
ctest --test-dir cmake-build-release-homebrew \
--label-regex mpi --output-on-failure --timeout 180
\end{lstlisting}
\section{Conclusion}
This revision improves a separate centrifugal hot path by roughly a factor of
two, modestly improves single-rank virial time, and---more importantly---turns
the distributed reduced-gravity path from numerically invalid into a tested,
scaling implementation. Profiling is now reproducible, bounded, and safe for
rank-local label sets, while compiling to zero instrumentation in production.
The remaining virial cost is well localized: thousands of Krylov iterations
repeatedly invoke a mass-dominated reduced operator. That evidence provides a
clear handoff to the planned preconditioner work without weakening any physical
or numerical invariant.
\end{document}

View File

@@ -0,0 +1,50 @@
# mean_field C++ module
## Emily M. Boudreaux
### July 15, 2026
### Dartmouth College
> Funded by the European Research Council: No. 101071505: 4D-STAR
This is a simple module testing the numerical implementation of mean_field eqautions of stellar structure in 3D using
Finite Elements.
This module is not intended for scientific use; rather, this will inform latter development of SERiF
# Key Goals
- Validation of discritization, truncation, and projection errors in MFEM in the context of pulsation mode identification. More specifically, we aim to confirm that a solution to the mean field equations may be found on a reasonably sized and ordered mesh such that the uncertainties introduced into mode identification by our model are below the order of accuracy of the forthcoming PLATO instrument.
- Further, we aim to validate that, when solved with a polytropic equation of state, a model in this framework can virialize to within one part in 10^6
- We aim to develope numerical instrumentation which will be incorporated into SERiF including, but not limited to, preconditioners, integrators, and operators
- We aim to develope utility infrastructure which will be incorporated into SERiF including, but not limited to, quadrature boost policies, domain mapping, and user experience tools.
# Current Status [as of July 15, 2026]
- Integrators for all mean field equations have been written. In other code these have been validated as self-consistent and consistent with analytic solutions generated with symbolic algebra tools. These tests will be incorporated into this module
- Gravitational Potential calculations have been rigorously tested for a number of cases including uniform spherical densities, polynomial spherical densities, rational spherical densities, uniform ellipsoidal densities, and rational ellipsoidal densities. These potentials only apply the density profile and the potential at infinity boundary condition
- We have shown that we can reach sufficient self-consistency and accuracy with the gravitational field such that the gravitational field representation will not prevent us achiveing the required virial ratio or mode identification accuracy.
# Building
Unlike the rest of the SERiF ecosystem this project is built with CMake (due to some experimentation with C++ modules, which are not well supported by meson). Note that
this project is developed for internal 4D-STAR testing and has not been developed with the intention of being portable. Numerous packages are required to be preinstalled
and no testing has been done to confirm if this works over a variety of targets. Broadly one must install
- stroid
- CLI11
- mfem (with MPI, Hypre, and UMFPack)
- libconfig
- cmake
- a recent version of clang or gcc which supports modules (note the default clang on mac will not work, you must use homebrew clang)
- ninja
- cmake
once those are installed then the following commands will in theory build mean_field
```bash
mkdir build
cd build & cmake .. -Gninja && ninja
./build/tests
```
should you wish to build this and you run into issues (as you likely will) you are welcome to email Emily Boudreaux (emily.boudreaux@dartmouth.edu); however, maintenance and support of this module
are not guaranteed. If SERiF has been released when you are reading this documentation we encourage you to look for that project on the 4D-STAR webpage (https://4d-star.org) as it inherits any and all scientific merit from this exploratory project.
# Funding
> 4D-STAR is funded by European Research Council (ERC) under the Horizon Europe programme (Synergy Grant agreement No. 101071505: 4D-STAR). Work for this project is funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council.

View File

@@ -0,0 +1,934 @@
# EOS relation architecture and migration plan
**Status:** design proposal for review
**Date:** 2026-08-29
**Scope:** equation-of-state architecture required before improving the surface prescription and wiring it into the nonlinear residual/Jacobian
**Implementation status:** no MeanField source code has been changed by this document
## Executive decision
Replace the current universal virtual `EquationOfState` interface with a two-layer design built from one EOS declaration:
1. A **compile-time relation catalog** gives concrete EOS types strongly typed thermodynamic quantities and explicitly lists the relations they support.
2. A **generated runtime view** type-erases any conforming concrete EOS and exposes the same catalog through checked runtime queries and evaluation.
The compile-time catalog is the source of truth. The runtime capability table and dispatch logic are generated from it; an EOS author does not maintain a second virtual interface by hand.
For the surface, the user-facing condition remains physically isobaric:
```cpp
using Isobaric = ConstantSurface<eos::quantity::Pressure>;
```
The current formulation identifies enthalpy as the carrier field whose boundary row can be replaced. A generic surface compiler asks the EOS for a relation that solves that carrier in terms of the prescribed pressure and any other required local state quantities. For a polytrope, the declared relation is
\[
h = h(P),
\]
so the compiled residual happens to be \(h-h(P_*)\). For a more general EOS it may be
\[
h = h(P,s,Y_e),
\]
so the compiled residual is
\[
h-h(P_*,s,Y_e),
\]
and the surface enthalpy is not constant. There is therefore no public `ConstantEnthalpy` condition and no semantically misleading `targetEnthalpy` in the resolved surface data.
Only one surface-enforcement mechanism is proposed now: **replacement of the existing boundary rows associated with the selected carrier field**. No `SurfaceEnforcementKind` enum and no Lagrange-multiplier placeholder should be introduced.
## Design goals
The design must provide all of the following:
- A constant-pressure surface is represented as such in the type system.
- Passing a density where a pressure is expected is a compile-time error.
- A templated algorithm can require a particular EOS relation or derivative at compile time.
- A heterogeneous algorithm can accept different EOS implementations through one runtime type.
- Runtime consumers can inspect capabilities before evaluation and receive structured errors when a capability or input is invalid.
- The runtime contract cannot drift from the compile-time contract.
- Multi-input relations are first-class; the architecture must not assume that pressure, density, and enthalpy are globally related by unary functions.
- Current polytropic formulas, exterior continuation, validation behavior, and derivative behavior are preserved during migration.
- Hot quadrature paths can continue to use statically dispatched concrete EOS code.
- The EOS migration can be completed and tested before surface assembly or nonlinear-solver wiring changes.
## Non-goals for this migration
- Adding temperature-, entropy-, or composition-dependent production EOS implementations.
- Introducing a units library. Quantity types will prevent category mistakes, but their stored scalar remains the code's current `double` in the existing unit convention.
- Choosing between Lagrange multipliers, penalties, Nitsche terms, or other surface enforcement schemes.
- Wiring surface rows into `PreparedStellarEquilibriumOperator`.
- Changing the six-field nonlinear block layout.
- Generalizing every prepared operator to every possible EOS in the first patch series.
- Implementing automatic relation composition through arbitrary graph paths. Exact declared relations are sufficient and easier to diagnose.
## Current state and why it needs to change
### Current EOS contract
`libmeanfield/interface/eos/eos_base.cppm` defines one abstract class with eight virtual methods. Five are value relations and three are derivatives. The interface assumes that every EOS can provide unary, globally single-valued transformations such as `enthalpy_from_pressure(double)` and `pressure_from_enthalpy(double)`.
That is true for the current barotropic polytrope, but it is not a valid universal EOS contract. A general EOS may require entropy, temperature, composition, or another branch coordinate. For example, `h(P)` may not exist while `h(P,s,Y_e)` does.
The use of raw `double` also means that the compiler cannot distinguish pressure, density, and enthalpy arguments.
### Current static and dynamic usage
Most numerical production code already takes `const eos::Polytrope&` directly:
- barotropic-closure kernels and their prepared operator,
- pressure-force kernels and their prepared operator,
- displacement and stellar-equilibrium preparation.
The virtual base is concentrated in:
- `StructureBase::equationOfState()`,
- `StellarModel::equationOfState()`,
- `SurfaceBase::validate(...)` and `SurfaceBase::resolve(...)`.
This is favorable for migration. The hot numerical paths can adopt typed relation calls without first adopting runtime dispatch. The model and surface boundaries can then move to the generated runtime view or retain concrete types as appropriate.
### Current surface resolution
`Isobaric` stores a target pressure, but resolves it immediately through the virtual `enthalpy_from_pressure` method. `ResolvedSurfaceCondition` then stores only `targetEnthalpy` and exposes
\[
R_\mathrm{surface}=h-h_*, \qquad J_\mathrm{surface}\,\delta h=\delta h.
\]
This loses the physical identity of the prescription and assumes there is one scalar surface enthalpy. That assumption does not survive a general EOS.
The root prepared operator currently consumes the target mass from `StellarModel`, but it does not consume or assemble the resolved surface condition. The enthalpy space retains stellar-surface degrees of freedom and an isobaric surface quadrature term exists, but surface DOF selection, boundary-row replacement, residual insertion, and Jacobian insertion are not yet wired.
## Layer 1: strongly typed thermodynamic quantities
### Quantity tags and values
Define quantity identity separately from scalar storage:
```cpp
namespace mean_field::eos::quantity {
struct Density;
struct Pressure;
struct SpecificEnthalpy;
struct Entropy;
template<class Species>
struct MassFraction;
}
template<class Quantity>
class Value final {
public:
explicit constexpr Value(double value) noexcept : m_value(value) {}
[[nodiscard]] constexpr double value() const noexcept { return m_value; }
private:
double m_value;
};
using DensityValue = Value<quantity::Density>;
using PressureValue = Value<quantity::Pressure>;
using EnthalpyValue = Value<quantity::SpecificEnthalpy>;
```
The constructor should not impose a universal sign or finiteness rule. Domain rules belong to individual relations. This matters because the current polytrope intentionally extends `rho(h)` and `P(h)` into the exterior by returning zero for finite `h <= 0`, while negative density and pressure inputs are rejected.
The initial migration can use explicit `.value()` extraction at interfaces to MFEM and XAD. A future units system can replace the scalar representation without changing relation identity.
### Typed derivatives
Derivative results should retain both numerator and denominator quantities:
```cpp
template<class OutputQuantity, class InputQuantity>
class PartialDerivative final {
public:
explicit constexpr PartialDerivative(double value) noexcept;
[[nodiscard]] constexpr double value() const noexcept;
};
```
This makes `dP/dh`, `dP/drho`, and `drho/dh` different C++ types. It prevents a derivative with the right numerical representation but the wrong physical meaning from being substituted accidentally.
## Layer 2: the compile-time relation catalog
### Relation signatures
A relation describes an output quantity and an ordered list of input quantities:
```cpp
template<class OutputQuantity, class... InputQuantities>
struct Relation final {
using Output = OutputQuantity;
using Inputs = TypeList<InputQuantities...>;
};
template<class... Relations>
struct RelationSet final {};
```
Useful aliases make diagnostics and implementation readable:
```cpp
using PressureFromDensity =
Relation<quantity::Pressure, quantity::Density>;
using PressureFromEnthalpy =
Relation<quantity::Pressure, quantity::SpecificEnthalpy>;
using EnthalpyFromPressure =
Relation<quantity::SpecificEnthalpy, quantity::Pressure>;
```
Multi-input relations use the same representation:
```cpp
using EnthalpyFromPressureEntropyComposition = Relation<
quantity::SpecificEnthalpy,
quantity::Pressure,
quantity::Entropy,
quantity::MassFraction<Electron>
>;
```
Inputs are ordered because evaluation needs a stable calling convention. Composition components should use species-specific quantity tags, so a relation never needs two indistinguishable generic `MassFraction` arguments.
### Concrete EOS declaration
`Polytrope` declares exactly the value relations it supports and implements typed overloads selected by relation tag:
```cpp
class Polytrope final {
public:
using Relations = RelationSet<
Relation<quantity::Pressure, quantity::Density>,
Relation<quantity::Pressure, quantity::SpecificEnthalpy>,
Relation<quantity::SpecificEnthalpy, quantity::Density>,
Relation<quantity::SpecificEnthalpy, quantity::Pressure>,
Relation<quantity::Density, quantity::SpecificEnthalpy>
>;
[[nodiscard]] PressureValue
evaluate(PressureFromDensity, DensityValue density) const;
[[nodiscard]] PartialDerivative<quantity::Pressure, quantity::Density>
partial(PressureFromDensity, Wrt<quantity::Density>, DensityValue density) const;
// Remaining declared relation and derivative overloads follow the same form.
};
```
The public customization point is concise at call sites:
```cpp
const PressureValue pressure =
eos::evaluate<eos::quantity::Pressure>(equationOfState, density);
const auto derivative =
eos::partial<eos::quantity::Pressure, eos::quantity::SpecificEnthalpy>(
equationOfState,
enthalpy
);
```
The customization point constructs the exact `Relation<Output, Inputs...>` from its typed arguments, verifies that the relation appears once in `EOS::Relations`, and dispatches to the matching member overload.
There is no name such as `IsobaricReduction<Polytrope>`. The EOS declares thermodynamic relations only. It has no dependency on the surface subsystem.
### EOS and algorithm concepts
The base EOS concept checks structural consistency:
```cpp
template<class Candidate>
concept EquationOfStateModel = requires {
typename std::remove_cvref_t<Candidate>::Relations;
} && ValidRelationSet<typename std::remove_cvref_t<Candidate>::Relations>
&& ImplementsEveryDeclaredRelation<std::remove_cvref_t<Candidate>>;
```
The relation set validator should reject:
- duplicate signatures,
- non-quantity types,
- missing `evaluate` overloads,
- incorrect output types.
C++ cannot generally reflect over arbitrary extra member overloads. An EOS may therefore contain an undeclared implementation detail, but the public customization point and runtime adapter must refuse to expose it unless its signature appears in `Relations`. The catalog, rather than the set of discoverable member names, defines the public capability set.
Derivatives are capabilities of individual relations, not a requirement imposed on every EOS relation. Algorithms state what they need:
```cpp
template<class EOS>
concept BarotropicClosureEOS =
EquationOfStateModel<EOS> &&
HasRelation<EOS, Relation<quantity::Density, quantity::SpecificEnthalpy>> &&
HasPartial<EOS,
Relation<quantity::Density, quantity::SpecificEnthalpy>,
quantity::SpecificEnthalpy>;
```
Likewise, the pressure-force operator can require `P(h)` and `dP/dh`, while seed construction can require `h(rho)`. A concrete EOS that lacks one of those capabilities can still satisfy the general `EquationOfStateModel` concept and be used by algorithms whose requirements it meets.
This is the core compile-time enforcement: requirements are local to consumers rather than falsely universal.
### Evaluation errors and numerical domains
Type correctness does not imply that a numerical input lies in a relation's domain. Introduce one EOS-domain exception family for statically dispatched code and a corresponding structured error for runtime calls:
```cpp
enum class EosErrorCode {
unsupported_relation,
unsupported_derivative,
wrong_input_count,
wrong_input_quantity,
nonfinite_input,
outside_domain,
nonfinite_result
};
```
Typed `evaluate`/`partial` may throw a specific `EosEvaluationError` carrying this code. This preserves the current convenient kernel API and existing exception semantics. The runtime view catches only the standardized EOS exception and returns `std::expected<..., EosError>`; unrelated exceptions remain programming failures and are not silently reclassified.
The first migration must preserve these current polytropic domain choices exactly:
- finite negative density: rejected,
- finite negative pressure: rejected,
- nonfinite inputs: rejected,
- finite `h <= 0` for `rho(h)` and `P(h)`: zero exterior continuation,
- derivative values at `h = 0`, including the special `n = 1` behavior: unchanged.
## Layer 3: generated runtime EOS view
### Why a generated type-erased view
A monolithic virtual base makes every virtual member a promise made by every EOS. That recreates the current problem as soon as a general EOS lacks a unary transformation.
Instead, use a small non-owning `EquationOfStateView`, analogous to `std::span` or `std::function_ref`. It can refer to any concrete type satisfying the compile-time EOS concept:
```cpp
class EquationOfStateView final {
public:
template<EquationOfStateModel EOS>
EquationOfStateView(EOS& eos) noexcept; // lvalues only; stores a const view
[[nodiscard]] std::span<const RelationDescriptor> relations() const noexcept;
template<class OutputQuantity, class... InputQuantities>
[[nodiscard]] bool supports() const noexcept;
template<class OutputQuantity, class... InputQuantities>
[[nodiscard]] std::expected<Value<OutputQuantity>, EosError>
tryEvaluate(Value<InputQuantities>... inputs) const;
template<class OutputQuantity, class WrtQuantity, class... InputQuantities>
[[nodiscard]] std::expected<PartialDerivative<OutputQuantity, WrtQuantity>, EosError>
tryPartial(Value<InputQuantities>... inputs) const;
};
```
This lets one ordinary function accept different EOS types:
```cpp
std::expected<PressureValue, EosError>
pressureAtDensity(EquationOfStateView eos, DensityValue density) {
return eos.tryEvaluate<quantity::Pressure>(density);
}
```
The function remains strongly typed at its own boundary. The only check deferred to runtime is whether the erased concrete EOS supports `P(rho)`.
### Runtime identity and descriptors
Runtime descriptors use stable quantity identifiers, not `typeid` names:
```cpp
enum class QuantityId {
density,
pressure,
specific_enthalpy,
entropy,
// Explicitly registered composition quantities follow.
};
struct RelationDescriptor final {
QuantityId output;
std::span<const QuantityId> inputs;
std::uint64_t availablePartialMask; // bit i corresponds to input i
};
```
`QuantityTraits<Q>::id` provides the compile-time-to-runtime mapping. These identifiers should be treated as stable public values if they are ever serialized or exposed in diagnostics.
The erased implementation stores:
- a `const void*` to the concrete EOS,
- a pointer to a static generated descriptor table,
- generated function pointers for relation evaluation and partial evaluation.
The dispatcher compares an exact relation key, reconstructs typed values, and invokes the same `eos::evaluate` or `eos::partial` customization point used by static code.
### One source of truth
The adapter for `EquationOfStateView{polytrope}` is generated by iterating `Polytrope::Relations`. It must not contain a second handwritten list of supported functions. Consequently:
- a declared-but-unimplemented relation fails compilation,
- an undeclared relation is not exposed by the public customization point or runtime view,
- runtime descriptors exactly match compile-time declarations,
- runtime dispatch cannot claim a relation the static EOS does not have,
- derivative availability is generated with `requires` checks against each relation/input pair.
This is the most important runtime-contract guarantee.
### Ownership
Start with the non-owning view only. It is sufficient for the current model, which owns its structure prescription and keeps the contained EOS at a stable address. The view's lifetime contract must be explicit and tested.
If heterogeneous EOS ownership becomes necessary, add `AnyEquationOfState` later as an owning wrapper whose view uses the same generated adapter. It should not be required for the first migration.
### Where to use static and runtime dispatch
Use concrete EOS types and compile-time concepts in:
- quadrature kernels,
- prepared closure and pressure operators,
- surface-constraint compilation,
- derivative-sensitive nonlinear and preconditioner code.
Use `EquationOfStateView` in:
- heterogeneous collections,
- logging, diagnostics, inspection, and configuration boundaries,
- non-templated model views,
- functions that genuinely need to accept unrelated EOS concrete types through one ABI.
Runtime erasure should not be forced into every quadrature-point evaluation merely to make an outer API non-templated.
## Surface architecture enabled by the EOS relations
### Physical prescription type
Represent a constant thermodynamic surface by the quantity being prescribed:
```cpp
template<class Quantity>
class ConstantSurface final {
public:
using PhysicalQuantity = Quantity;
explicit ConstantSurface(Value<Quantity> target);
[[nodiscard]] Value<Quantity> target() const noexcept;
};
using Isobaric = ConstantSurface<eos::quantity::Pressure>;
```
Thus `Isobaric` is a pressure prescription at compile time and continues to store a pressure value at runtime. A pressure target cannot be constructed from an `EnthalpyValue` accidentally.
No public constant-enthalpy surface is introduced as part of this work.
### The formulation chooses the carrier; the EOS supplies the relation
The current nonlinear formulation already has an enthalpy unknown and a hydrostatic residual row. The planned row-replacement enforcement therefore identifies the enthalpy field as the **carrier field** for a scalar thermodynamic surface condition.
This is a property of the equation formulation and its block layout, not a property of an isobaric condition and not a property of a polytrope.
Given:
- a physical condition `ConstantSurface<Pressure>`,
- carrier quantity `SpecificEnthalpy`,
- the surface field bindings available in the formulation,
- a concrete EOS relation catalog,
the generic compiler searches for one declared relation satisfying all of these conditions:
1. Its output is the carrier quantity.
2. The prescribed physical quantity occurs exactly once among its inputs.
3. Every other input is bound to a field or parameter available on the surface.
4. Every other state-dependent input has the partial derivative needed for the Jacobian.
5. Exactly one relation matches.
The selection rule is independent of the names `Isobaric` and `Polytrope`.
For the current polytrope, the match is `h(P)`. For a general EOS it could be `h(P,s,Y_e)`. If there is no match, the model is not compatible with this formulation and compilation fails with a diagnostic listing the missing relation. If multiple relations match, compilation fails as ambiguous; the formulation must supply a more specific set of bindings or an explicit coordinate policy.
The first implementation should not silently fall back to the direct equation `P(state)-P*`. At `P*=0` the current polytrope has `dP/dh = rho = 0`, producing a degenerate Newton row. Requiring a relation that solves for the carrier gives the intended identity pivot without inventing an enforcement-mode hierarchy.
### Compiled constraint data
Use the name `CompiledConstantSurfaceConstraint`, not `ConstantTraceConstraint`. “Trace” is a finite-element term for restricting a volume field to a boundary. It may appear in low-level MFEM implementation comments, but it should not define the public physical API.
A representative typed result is:
```cpp
template<
class PhysicalQuantity,
class CarrierField,
class SelectedRelation,
class Dependencies>
class CompiledConstantSurfaceConstraint final {
public:
using PhysicalCondition = ConstantSurface<PhysicalQuantity>;
using Relation = SelectedRelation;
using SurfaceDependencies = Dependencies;
[[nodiscard]] Value<PhysicalQuantity> target() const noexcept;
template<class SurfaceState>
[[nodiscard]] double residual(const SurfaceState& state) const;
template<class SurfaceState, class SurfaceVariation>
[[nodiscard]] double jacobianAction(
const SurfaceState& state,
const SurfaceVariation& variation
) const;
};
```
The compiled object retains the physical target and the selected EOS relation. It does not expose or semantically store a `targetEnthalpy`.
For the polytrope, an implementation may privately cache the constant numerical value `h(P*)` as an optimization. That cache is not the condition's identity. For `h(P,s,Y_e)`, the right-hand side is evaluated from local boundary state and cannot be one global scalar.
### Surface dependencies
Dependencies should exist in both typed and runtime forms:
```cpp
template<class ResidualField, class... ReadFields>
struct SurfaceConstraintDependencies final {
using RowField = ResidualField;
using StateFields = FieldSet<ReadFields...>;
};
```
For the polytrope's `h(P*)` relation:
```cpp
SurfaceConstraintDependencies<field::Enthalpy, field::Enthalpy>
```
The first `field::Enthalpy` means that enthalpy boundary rows are replaced. The second means the residual reads the surface enthalpy value. A more general `h(P*,s,Y_e)` relation yields:
```cpp
SurfaceConstraintDependencies<
field::Enthalpy,
field::Enthalpy,
field::Entropy,
field::ElectronFraction
>
```
The Jacobian dependencies are derived mechanically from the selected relation:
\[
\delta R = \delta h
-\frac{\partial h}{\partial s}\,\delta s
-\frac{\partial h}{\partial Y_e}\,\delta Y_e.
\]
At runtime, the prepared operator needs a compact equivalent:
```cpp
struct RuntimeSurfaceConstraintDependencies final {
field::FieldId rowField;
std::vector<field::FieldId> stateFields;
};
```
The field IDs feed block dependency declaration and Jacobian assembly. They are generated from the typed dependencies, not maintained independently.
### Physical runtime description
If a non-templated model view needs to report the prescribed condition, use:
```cpp
struct ConstantSurfaceDescriptor final {
eos::QuantityId physicalQuantity;
double target;
};
```
This replaces a closed `SurfacePhysicalKind` enum. The quantity identity already says that the condition is constant pressure, constant temperature, and so on. The typed API remains the authority; this descriptor is for runtime inspection.
### Enforcement
Do not add `SurfaceEnforcementKind` now. The first surface assembler will do one thing:
- find the stellar-surface DOFs of the carrier field,
- replace the corresponding existing residual rows with the compiled constraint,
- replace the corresponding Jacobian rows with derivatives declared by the compiled dependencies.
This keeps the existing six blocks and preserves the nonlinear unknown count. Lagrange multipliers would add unknowns, residuals, couplings, null-space questions, and preconditioner blocks. If they are ever needed, they should arrive as a deliberate new formulation, not as an enum value that suggests the current assembler can support them.
## Proposed module and file layout
The names below are concrete recommendations; small naming adjustments are acceptable if module-build constraints require them.
```text
libmeanfield/interface/eos/
quantities.cppm Quantity tags, Value, PartialDerivative, QuantityId
relations.cppm Relation, RelationSet, aliases, relation-list utilities
concepts.cppm EquationOfStateModel and per-algorithm capability concepts
evaluation.cppm evaluate/partial customization points and EOS errors
runtime.cppm EquationOfStateView and generated adapters
polytropic.cppm Polytrope and its declared relation implementations
libmeanfield/interface/surface/
constant.cppm ConstantSurface<Q> and Isobaric alias
dependencies.cppm Typed/runtime SurfaceConstraintDependencies
compiled.cppm CompiledConstantSurfaceConstraint
compiler.cppm Generic condition + carrier + EOS relation selection
```
During compatibility phases, `eos_base.cppm`, `surface_base.cppm`, and the current `isobaric.cppm` remain temporarily and forward to the new API. They are removed only after all call sites have migrated.
`CMakeLists.txt` must list each new C++ module partition explicitly and add the new test translation units. The project already requires C++23, so `std::expected` is available.
## Test plan
The tests are grouped by the guarantee they protect. Negative compile-time cases should use concepts and `requires` expressions so the normal test target still compiles; no separate intentionally failing build is required initially.
### 1. Quantity-type tests
Suggested file: `tests/eos/quantities.cpp`
- `DensityValue`, `PressureValue`, and `EnthalpyValue` are distinct types.
- A relation accepting `PressureValue` is not invocable with `EnthalpyValue`.
- `PartialDerivative<Pressure, Enthalpy>` is not convertible to `PartialDerivative<Pressure, Density>`.
- Explicit scalar extraction is required at raw numerical-library boundaries.
- Value wrappers preserve the underlying scalar exactly and do not impose incorrect universal domain validation.
### 2. Compile-time relation-contract tests
Suggested file: `tests/eos/relation_contract.cpp`
- `Polytrope` satisfies `EquationOfStateModel`.
- Its five current value-relation signatures are present exactly once.
- Unsupported signatures such as `rho(P,s)` are absent.
- `evaluate<Pressure>(polytrope, DensityValue)` returns `PressureValue`.
- `evaluate<Pressure>(polytrope, EnthalpyValue)` selects a different declared relation.
- `partial<Pressure, Enthalpy>(...)` returns the correct derivative type.
- A synthetic EOS with a duplicate relation fails `ValidRelationSet`.
- A synthetic EOS with a declared but missing implementation fails `EquationOfStateModel`.
- A synthetic EOS with a wrong return type fails `EquationOfStateModel`.
- A relation can have three or more inputs without any special machinery.
Representative negative assertions:
```cpp
static_assert(!HasRelation<SyntheticEOS,
Relation<quantity::Density, quantity::Pressure, quantity::Entropy>>);
static_assert(!EquationOfStateModel<DeclaredButNotImplementedEOS>);
```
### 3. Polytrope characterization and numerical tests
Port and retain the existing coverage in `tests/physics/barotrope.cpp` and `tests/physics/barotrope_pressure.cpp` before deleting legacy method names.
For every migrated relation:
- compare against the existing analytic formula over representative `n`, `K`, and state values,
- preserve zero values at the stellar surface,
- preserve exterior `h < 0` continuation,
- preserve invalid-constructor checks,
- preserve nonfinite-input and negative-domain errors,
- test inverse round trips `rho -> h -> rho` and `P -> h -> P` where defined,
- compare each available analytic partial against centered finite differences away from nondifferentiable endpoints,
- test the `n = 1`, `h = 0` derivative separately.
These are characterization tests: migration is not an opportunity to alter formulas or endpoint conventions silently.
### 4. Runtime-view contract tests
Suggested file: `tests/eos/runtime.cpp`
- Construct `EquationOfStateView` from `Polytrope` without allocation or ownership transfer.
- The runtime relation descriptors equal the compile-time catalog exactly.
- Available-partial flags equal compile-time `HasPartial` results.
- Typed and erased evaluation agree for every declared relation.
- Typed and erased derivative evaluation agree for every available partial.
- An unsupported relation returns `unsupported_relation`.
- An unsupported partial returns `unsupported_derivative`.
- Raw internal dispatch rejects wrong arity and wrong input quantity.
- Domain failures become the corresponding structured `EosError`.
- Construction from an EOS temporary is rejected at compile time.
- Moving a stable-address model owner leaves an already-created view referring to the same EOS object.
- One function taking `EquationOfStateView` successfully evaluates two different synthetic concrete EOS types.
The final test is the direct proof that heterogeneous runtime consumption works.
### 5. Per-consumer concept tests
Suggested file: `tests/eos/consumer_contracts.cpp`
Define small synthetic EOS types to prove that requirements are local:
- an EOS with `rho(h)` and `drho/dh` satisfies `BarotropicClosureEOS`,
- an EOS lacking `drho/dh` does not,
- an EOS with `P(h)` and `dP/dh` satisfies `PressureForceEOS`,
- an EOS can satisfy one operator concept without satisfying another,
- an EOS can satisfy the general `EquationOfStateModel` concept without providing `h(P)`.
### 6. Surface-compilation tests
Suggested file: `tests/surface/constraint_compilation.cpp`
These tests prepare the surface architecture but do not assemble MFEM rows yet.
- `Isobaric::PhysicalQuantity` is `quantity::Pressure`.
- `Isobaric` accepts `PressureValue` and not `EnthalpyValue`.
- With enthalpy as carrier, the generic compiler selects the polytrope's `h(P)` relation without an isobaric or polytrope specialization.
- For a polytrope, the compiled residual equals `h-h(P*)` and its carrier Jacobian is one.
- The compiled condition still reports its target as pressure.
- No public `targetEnthalpy` exists.
- A synthetic EOS declaring `h(P,s,Y_e)` produces dependencies on enthalpy, entropy, and electron fraction.
- Changing entropy at fixed target pressure changes the computed boundary enthalpy in that synthetic EOS, proving the design does not assume one surface enthalpy.
- The Jacobian action for that EOS includes all required partials and agrees with finite differences.
- An EOS lacking a relation that solves the chosen carrier fails the `SurfaceCompilable` concept.
- Two matching relations produce an ambiguity at compile time rather than an arbitrary selection.
- An EOS lacking a required partial for an additional state input fails `SurfaceCompilable`.
### 7. Regression tests for migrated production consumers
Existing kernel and prepared-operator suites remain the regression authority:
- `tests/operators/kernels/barotropic_closure_kernels.cpp`,
- `tests/operators/prepared_barotropic_closure.cpp`,
- `tests/operators/kernels/pressure_force_kernels.cpp`,
- `tests/operators/prepared_pressure_force.cpp`,
- displacement and prepared stellar-equilibrium suites,
- structure seed and model tests.
The migration should change how values are requested from the EOS, not the expected residuals, Jacobian actions, quadrature behavior, or tolerances.
## Migration plan
Each phase should compile and pass tests independently. Compatibility shims are intentional and temporary.
### Current-file migration map
| Current area | Migration action |
|---|---|
| `libmeanfield/interface/eos/eos_base.cppm` | Keep as a compatibility base through Phases 1–5, then remove. It is not the new runtime contract. |
| `libmeanfield/interface/eos/polytropic.cppm` | Add the relation catalog and typed overloads first; make legacy virtual methods forward to them; later remove inheritance and wrappers. |
| `libmeanfield/interface/models/structure/structure_base.cppm` | Replace inheritance-only requirements with a structural `StructurePrescription` concept; runtime consumers eventually use a structure/model view. |
| `libmeanfield/interface/models/structure/polytropic.cppm` and `libmeanfield/impl/models/polytropic.cpp` | Preserve the concrete `Polytrope` return type, migrate seed construction to typed `h(rho)`, and retain current Lane–Emden behavior. |
| `libmeanfield/interface/models/stellar_model.cppm` | Replace immediate prescription erasure with a typed, CTAD-friendly owning model; add `StellarModelView` for runtime heterogeneity. |
| `libmeanfield/interface/surface/surface_base.cppm` | Retain only during compatibility; replace `ResolvedSurfaceCondition` with a typed compiled constraint after model/EOS migration. |
| `libmeanfield/interface/surface/isobaric.cppm` | Replace the raw-double derived class with `ConstantSurface<Pressure>`; remove `resolveTargetEnthalpy`. |
| Barotropic closure interfaces/implementations/kernels | Require `rho(h)` and `drho/dh`; migrate calls without changing residual or Jacobian formulas. |
| Pressure-force interfaces/implementations/kernels | Require `P(h)` and `dP/dh`; migrate calls without changing quadrature or linearization. |
| Displacement and stellar-equilibrium preparation | Forward the typed EOS or a statically bound evaluator; avoid introducing per-quadrature runtime erasure. |
| `libmeanfield/interface/mean_field.cppm` and `CMakeLists.txt` | Export/register new modules in dependency order and add the new test files. |
| Existing EOS, surface, model, kernel, and prepared-operator tests | Port incrementally; retain legacy-vs-typed comparison tests until compatibility wrappers are removed. |
### Phase 0: establish the baseline
1. Record the exact current test command and result.
2. Preserve the dirty working tree; do not mix unrelated existing edits into the EOS patches.
3. Ensure the current polytrope domain and endpoint behavior is fully covered before changing its API.
4. Add no surface wiring in this phase.
**Exit criterion:** the legacy behavior is characterized well enough to distinguish migration regressions from intended future changes.
### Phase 1: add quantity and relation infrastructure beside the old API
1. Add quantity tags, typed values, typed derivatives, relation signatures, relation sets, and utilities.
2. Add EOS errors and the `evaluate`/`partial` customization points.
3. Add compile-time validator tests with synthetic EOS types.
4. Export the new modules from the main `mean_field` module.
5. Leave `EquationOfState` and every current call site untouched.
**Exit criterion:** the infrastructure is tested but has no numerical behavior change.
### Phase 2: declare the polytrope relation catalog
1. Add `Polytrope::Relations` and typed `evaluate`/`partial` overloads.
2. Initially keep `Polytrope : EquationOfState`.
3. Implement legacy virtual methods as thin conversions to the typed relation API, so formulas have one implementation.
4. Port the characterization tests to exercise both APIs and compare their results.
5. Preserve all current domain and endpoint behavior.
**Exit criterion:** `Polytrope` satisfies the new compile-time concept and the legacy API is a forwarding compatibility layer.
### Phase 3: add the generated runtime view
1. Implement `QuantityId`, `RelationDescriptor`, generated descriptor tables, and generated dispatch.
2. Implement non-owning `EquationOfStateView`.
3. Add typed runtime queries and structured errors.
4. Test descriptor/catalog equivalence and heterogeneous use.
5. Do not put runtime dispatch into hot kernels.
**Exit criterion:** one non-templated function can safely accept multiple EOS concrete types, and all advertised runtime capabilities are generated from the static catalog.
### Phase 4: migrate concrete numerical call sites
Migrate in dependency order:
1. Polytropic structure seed construction: `h(rho)`.
2. Barotropic closure kernels and prepared closure: `rho(h)` and `drho/dh`.
3. Pressure-force kernels and prepared pressure operator: `P(h)` and `dP/dh`.
4. Displacement and stellar-equilibrium preparation that forwards the EOS.
5. Corresponding tests and helpers.
Initially, these functions may continue taking `const Polytrope&`; replacing raw method names with relation calls still gives typed arguments and relation checks. Introduce per-consumer concepts before generalizing signatures.
Where a template would force large kernel definitions into exported module interfaces, use either:
- explicit instantiation for supported library EOS types, or
- a small statically bound evaluator object created from the concrete EOS.
Do not solve module organization by routing every quadrature call through the runtime view.
**Exit criterion:** production numerical code no longer calls the legacy unary virtual methods directly.
### Phase 5: preserve concrete types through model construction
The current `StellarModel` erases `StructureType` and `SurfaceType` immediately. That prevents compile-time EOS/surface compatibility checks.
Introduce a typed owning model:
```cpp
template<class Structure, class Surface>
requires StructurePrescription<Structure> && SurfacePrescription<Surface>
class StellarModel final {
// unique_ptr<Structure> and unique_ptr<Surface> retain stable addresses
};
template<class Structure, class Surface>
StellarModel(Structure, Surface) -> StellarModel<Structure, Surface>;
```
Replace inheritance-only prescription concepts with structural concepts. During transition, `PolytropicStructure::equationOfState()` can use a covariant return of `const Polytrope&` while it still derives from `StructureBase`, allowing typed callers to recover the concrete EOS.
Add a non-owning `StellarModelView` for functions that genuinely need a uniform runtime type. Its EOS accessor returns `EquationOfStateView`.
Keep stable-address ownership because prepared operators and contexts borrow EOS/model objects.
**Exit criterion:** surface compilation sees the concrete surface type and concrete EOS type, while heterogeneous inspection remains possible through runtime views.
### Phase 6: remove the old universal virtual EOS base
1. Change remaining model/structure runtime boundaries to `EquationOfStateView`.
2. Remove inheritance from `Polytrope`.
3. Remove legacy unary wrappers after a repository search confirms no production or test use.
4. Remove `eos_base.cppm`; do not reuse the old universal-interface name for an unrelated runtime abstraction.
5. Keep the distinct names `EquationOfStateModel` for the concept and `EquationOfStateView` for runtime erasure.
**Exit criterion:** no API implies that every EOS supplies every unary conversion.
### Phase 7: migrate the surface prescription, without wiring it yet
1. Add `ConstantSurface<Q>` and make `Isobaric` an alias or thin named wrapper for `ConstantSurface<Pressure>`.
2. Add the formulation's enthalpy-carrier declaration.
3. Implement generic relation selection from condition, carrier, available bindings, and EOS catalog.
4. Add typed and runtime dependency descriptions.
5. Replace `ResolvedSurfaceCondition` with `CompiledConstantSurfaceConstraint` or a similarly typed result.
6. Remove public `targetEnthalpy` and preserve physical pressure in the condition and runtime descriptor.
7. Add the synthetic multi-input EOS tests described above.
8. Do not yet modify root residual/Jacobian assembly.
**Exit criterion:** a polytropic isobaric condition compiles naturally through `h(P)`, while a multi-input EOS demonstrates a nonconstant surface enthalpy.
### Phase 8: wire the single enforcement mechanism
This is deliberately the next project after the EOS migration and surface compilation design are accepted.
1. Build the stellar-surface DOF map for the carrier field.
2. Declare the compiled surface dependencies in the operator block graph.
3. Replace the selected hydrostatic residual rows.
4. Replace the matching Jacobian rows for every declared dependency.
5. Test residual/Jacobian consistency, finite differences, block sparsity, and zero-pressure conditioning.
6. Then connect the completed residual/Jacobian to the nonlinear solver and begin preconditioner development.
## Patch-series boundaries
The implementation should be reviewable as small patches rather than one architectural rewrite:
1. Quantity and relation primitives plus tests.
2. Typed `Polytrope` relation catalog plus forwarding legacy API.
3. Generated `EquationOfStateView` plus tests.
4. Structure seed and EOS unit-test migration.
5. Closure kernel/operator migration.
6. Pressure kernel/operator migration.
7. Remaining operator forwarding migration.
8. Typed model ownership and runtime model view.
9. Removal of the legacy EOS base.
10. Typed constant-pressure surface compiler and synthetic general-EOS tests.
Every patch should leave the test target green. Surface row assembly begins only after this series is complete.
## Risks and controls
### Compile-time relation ambiguity
**Risk:** more than one EOS relation can solve the selected carrier from the prescribed quantity and available surface fields.
**Control:** require an exact unique match. Make ambiguity a failed concept with a diagnostic listing candidate signatures. Do not select by declaration order.
### Mistaking a coordinate transform for a physical condition
**Risk:** `h(P)` could again leak into public state as “constant enthalpy.”
**Control:** the physical prescription stores `PressureValue`; the compiled constraint stores the selected relation separately; runtime inspection reports pressure; any cached transformed value remains private.
### Runtime/static contract drift
**Risk:** a runtime virtual table advertises different capabilities than the concrete EOS.
**Control:** generate descriptors and dispatch exclusively from `EOS::Relations` and compile-time derivative detection.
### Template and C++ module build cost
**Risk:** fully templating large MFEM kernels increases module dependencies and compile time.
**Control:** migrate relation calls first while retaining concrete `Polytrope` signatures; then use explicit instantiation or small statically bound evaluators for additional production EOS types.
### Runtime view lifetime
**Risk:** a non-owning `EquationOfStateView` outlives its concrete EOS.
**Control:** retain stable-address model ownership, document borrowing, prohibit construction from temporaries, and add lifetime-oriented tests. Add an owning wrapper only when a real ownership use case appears.
### Accidental change to exterior continuation
**Risk:** generic domain checking rejects negative enthalpy that the current solver uses to represent the exterior.
**Control:** values themselves impose no domain; each polytropic relation preserves its existing domain policy; characterization tests cover negative and zero enthalpy.
### Premature generality in surface enforcement
**Risk:** an enforcement enum creates abstractions for block layouts that do not exist.
**Control:** condition types describe physics; the current assembler implements one row-replacement formulation. A future Lagrange-multiplier formulation gets its own architecture if and when required.
## Acceptance criteria before surface wiring begins
The EOS migration is complete enough to support the next stage when all of the following are true:
- `Polytrope` satisfies the compile-time `EquationOfStateModel` relation concept.
- Thermodynamic arguments and derivative results are quantity typed.
- Consumer concepts express the exact relations and partials each numerical component needs.
- A generated `EquationOfStateView` supports heterogeneous runtime consumers and passes catalog-equivalence tests.
- No production numerical code calls the legacy universal virtual EOS methods.
- The old `EquationOfState` virtual base is removed.
- The typed model path retains the concrete EOS and surface prescription through compatibility checking.
- `Isobaric` is a constant-pressure type and stores a `PressureValue`.
- Surface relation selection is generic over condition quantity, carrier, available fields, and EOS relation catalog.
- `ResolvedSurfaceCondition::targetEnthalpy` is gone.
- A synthetic `h(P,s,Y_e)` EOS test proves that an isobaric surface need not be isoenthalpic.
- All existing closure, pressure-force, displacement, seed, model, and stellar-equilibrium tests pass without numerical regression.
- No surface residual/Jacobian rows or nonlinear-solver behavior have been changed yet.
## Recommended immediate implementation order after review
Begin with Phases 1–3: quantity/relation primitives, the typed polytrope catalog, and the generated runtime view. Those establish both halves of the contract while compatibility wrappers keep current code working. Then migrate the numerical call sites and typed model ownership before changing the surface types.
This ordering makes the later isobaric surface a direct consumer of an already-tested EOS relation system, rather than using the surface work to define EOS behavior implicitly.

View File

@@ -0,0 +1,182 @@
# MeanField architecture and current-state audit
Date: September 16, 2026. Repository examined: `/Users/tboudreaux/Programming/4DSTAR/MeanField`.
## Scope and confidence
This was a read-only source and artifact audit of the active equilibrium path, its operator, mapping, normalization, preconditioning, solver, seed, test, and experiment infrastructure. No repository files were changed, no solver run was launched, and no fresh build or regression suite was executed. This report is stored in the separate ChatGPT project workspace.
The checked-out commit is `75cc63873992984966ea20011cc04d9984f54be4`, but the working tree is substantially newer: 49 tracked files differ, with 3,626 additions and 267 deletions, plus untracked experiments, helper code, documentation, and numerical artifacts. The working tree, not HEAD alone, is the object of this audit. Existing modifications were preserved.
The user's observations—roughly 20 seconds per Newton step at n=1 and zero angular momentum, convergence at low rotation, and plateaus at higher index/rotation—are the current operational baseline. The archived measurements establish some of this independently, but do not establish the current rotation threshold or the cause of the plateau. This audit does not claim exhaustive line-by-line verification of every module or numerical correctness of the entire working tree.
## Purpose and numerical problem
MeanField is an experimental numerical test bed intended to inform SERiF/4D-STAR development. The immediate implemented problem is a three-dimensional, self-gravitating, rigidly rotating, barotropic free-boundary equilibrium. The presence of older advection, viscosity, Coriolis, and continuity integrators does not mean those equations participate in the current sandbox solve.
The polytropic EOS implements
\[
P=K\rho^{1+1/n},\qquad h=(n+1)K\rho^{1/n},\qquad
\rho(h)=\left[h/((n+1)K)\right]^n\quad(h\geq0).
\]
The active EOS accepts finite n >= 1 and positive K. Its standalone density-from-enthalpy relation extends to zero density for negative h, but the **prepared closure rejects negative enthalpy at its quadrature points**. This distinction matters when interpreting rejected Newton trials. The independent density field is checked for finiteness in that preparation path; a successful preparation is not itself a global density-positivity certificate.
With the code's positive rotation potential Psi = |Omega cross (x-center)|^2/2, the hydrostatic equation is the weak form of h + Phi - Psi - C = 0. Gravity uses a mixed gradient–potential formulation, with the stored flux representing grad(Phi), not physical acceleration -grad(Phi). Density closure is weakly enforced in the density test space. Pressure in the mechanical operator is evaluated from enthalpy.
The shape residual is obtained by first assembling the volume mechanical virtual-work residual and then applying the transpose of the surface-to-volume deformation Jacobian. Its Jacobian includes both the derivative of the mechanical residual and the derivative of this pullback. Consequently, solving the shape equations does not independently force every unrestricted volume mechanical test row to zero.
The usual sandbox model additionally imposes:
- Fixed total mass, generating the Bernoulli coordinate C.
- Fixed axial angular momentum, generating a scalar angular velocity along a prescribed axis; both density and changing geometry contribute to the inertia derivative.
- Fixed central density, implemented through a central **enthalpy** point condition and a hydrostatic border coordinate lambda_c.
- Zero surface pressure, compiled to enthalpy boundary rows replacing the corresponding hydrostatic rows.
Key implementations: [EOS](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/eos/polytropic.cppm), [physical core residual/Jacobian](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_stellar_equilibrium.cpp:795), [central-density border](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/operators/prepared_central_density.cppm:71), [rotation coupling](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/operators/prepared_variadic_stellar_equilibrium.cppm:712).
## Architecture
The main flow is: physics specifications -> compiled equilibrium problem and block manifest -> prepared physical operator -> normalized operator and scaled inverse -> FGMRES inside damped Newton -> a report with a borrowed accepted-state view.
| Layer | Responsibility and current implementation |
| --- | --- |
| Model declarations | `model::StellarModel` canonicalizes a compile-time specification pack. EOS, surface conditions, integral constraints, and phase conditions declare their own dependencies and contributions. |
| Compilation | The compiler derives state/residual blocks, Jacobian edges, manifests, normalization metadata, and prepared specification runtimes. `PreparedVariadicStellarEquilibriumOperator` is the active aggregate. |
| Discretization | MFEM parallel spaces on paired physical/logical STROID meshes. Field-support maps distinguish reduced solver coordinates from full MFEM true DOFs. Nonconforming support resolution is explicitly rejected. |
| Geometry | Radial surface parameters generate a vector displacement through a default power-law interior extension (power 2) and fixed-infinity vacuum extension. Kelvin compactification represents the exterior through infinity. |
| Prepared operators | Cache reference basis information, geometry, thermodynamics, local algebraic blocks, and residuals. Dependency identities/revisions determine invalidation. The global Jacobian is applied without assembling a monolithic matrix. |
| Normalization | Frozen reference-geometry diagonal Riesz factors and physical scales from M, reference R, and G. Distinct primal and dual coordinate maps. |
| Preconditioning | Material/surface and gravity block approximations, wrapped by a small dense specification-border correction and coordinate permutation/scaling. |
| Nonlinear runtime | A context owns the problem, accepted/trial state, normalization, inverse, and linear backend. Trial preparation, acceptance, refresh, rollback, and view invalidation are explicit. |
| Validation | Catch2 operator/runtime tests plus separate research experiments and a saved-field physical-validation/replay harness. |
C++23 modules divide interfaces (`libmeanfield/interface`) from implementations (`libmeanfield/impl`). The build uses MFEM, MPI, Hypre, UMFPACK, STROID, XAD, and other installed dependencies. Several old APIs remain compatibility paths; design/handoff documents are historical evidence and must be checked against current source.
The default field families are density and potential L2 order 2, gravity RT index 2, and enthalpy/displacement H1 order 3, plus a scalar surface parameter space. A compile-time option increments registered field orders uniformly. The mesh generator uses order-4 geometry; this is not fourth-order approximation for every field.
The saved coarse n=1 model has 1,216 hex elements (832 stellar, 384 vacuum) and 178,074 root values:
| Block | Size |
| --- | ---: |
| Gravity gradient | 98,928 |
| Potential | 32,832 |
| Density on stellar support | 22,464 |
| Surface shape | 866 |
| Enthalpy on stellar support | 22,981 |
| Three generated scalar coordinates | 3 |
The root geometry unknown is the surface field, not the much larger full vector displacement. Extension operators and coordinate maps are therefore essential numerical components, not incidental mesh utilities.
Entry points: [sandbox](/Users/tboudreaux/Programming/4DSTAR/MeanField/sandbox.cpp:92), [equilibrium problem](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/operators/stellar_equilibrium_problem.cppm:118), [field registry](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/field/field_registry.cppm), [default deformation](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/operators/stellar_equilibrium_problem.cppm:317).
## Normalization and preconditioning
For a spatial coefficient block with reference Gram diagonal d_i and characteristic physical scale s, normalized state factors are sqrt(d_i)/s and normalized weak-residual factors are 1/(s sqrt(d_i)). Surface pointwise hydrostatic replacement rows receive special treatment; generated global scalar blocks use declared physical scales.
The wrapper implements x = R x_hat, F_hat = L F, and J_hat = L J R. Its inverse wrapper applies R^-1 P^-1 L^-1. The normalization remains fixed during a solve unless explicitly refreshed. It uses reference computational geometry, including finite reference-domain gravity metrics, rather than an evolving exact physical norm over the infinite exterior. This is a deliberate coordinate policy, not evidence of a missing normalization layer.
The current default inverse has:
- Diagonal density and enthalpy approximations, with enthalpy-to-density coupling.
- An uncalibrated surface mass/Riesz diagonal and a surface-then-material triangular application.
- Independent material/surface and gravity subsystems at the structure level.
- Gravity approximate LDU with a fixed order-5 matrix-free Chebyshev H(div) mass inverse and three fixed BoomerAMG cycles for a potential Schur surrogate.
- A directly solved small dense border Schur matrix. Its construction uses the approximate structure inverse, so it is **not** the exact Schur complement of the full physical Jacobian.
Alternative triangular structure couplings, approximate LDU policies, calibrated surface scalars, and a surface mass-plus-stiffness surrogate already exist. The September 3 campaign found that apparently better isolated surface approximations did not improve the full system. It selected the defaults primarily using nonrotating n=3 linearizations and explicitly left rotating/refinement generalization unresolved. Its recommendation to add normalization is historical: normalization is now implemented.
References: [normalization factors](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/normalization/operators.cppm:325), [frozen wrapper](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/normalization/stellar_equilibrium.cppm:650), [default structure policy](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/stellar_structure.cppm:850), [surface surrogate](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/material_surface.cppm:1439), [border Schur assembly](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/specification_border.cppm:2333).
## Newton and initialization
The seed is a spherical Lane–Emden profile projected into independent density and enthalpy spaces, with a separate mixed gravity solve. Initial shape is zero, C is initialized from -GM/R, and angular velocity from target J divided by spherical inertia. A seed at nonzero target J is therefore not already a rotating equilibrium. The seed requires a compatible spherical reference radius.
The sandbox currently requests FGMRES restart 40, relative linear tolerance 0.03, at most 200 linear iterations, and at most 30 Newton iterations. The nonlinear criterion is max(atol, rtol times the initial residual), with sandbox atol=0 and rtol=1e-8. This is materially tighter than the saved validation experiment's atol=1e-8: for its initial residual 1.81e-4, the sandbox-style threshold would be about 1.81e-12.
FGMRES reports a separately recomputed true residual. Newton refuses a correction if that linear solve has not converged, even when it might provide some nonlinear decrease. The forcing tolerance is fixed across Newton steps. Backtracking uses the squared normalized-residual merit, sampled geometry admissibility, and thermodynamic rejection. A geometric preflight estimates safe step length from determinant polynomials at selected sample points. The next linear guess retains (1-alpha) times the previous correction after damping; this is vector reuse, not Krylov recycling.
Accepted-state refresh and rollback are carefully implemented. However, a successful report certifies **nonlinear residual convergence**, not independently verified physical equilibrium. Capture and serialization methods remain explicit unimplemented stubs. The experiment's saved-field files provide a separate persistence/replay mechanism; its replay currently requires exactly zero rotation.
References: [Newton loop](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/solver/stellar_context.cppm:1199), [linear solve](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/solver/linear_backend.cppm:720), [Newton options](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/solver/newton.cppm:28), [seed projection](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/seed/stellar_equilibrium_projection.cpp:175).
## Evidence for present numerical and performance state
The archived n=1, J=0 benchmark reaches normalized residual 6.60533e-9 in three full Newton steps, with 24, 25, and 28 Krylov iterations. G=M=R=1, K=2/pi, and target central density pi/4. These are actual saved data, not just a README claim.
| Diagnostic | Archived final value |
| --- | ---: |
| Relative mass error | 2.36e-11 |
| Energy virial error using P(rho) | 3.10e-7 |
| Force-based virial error using P(rho) | 3.73e-7 |
| Energy virial error using P(h) | 2.62e-7 |
| Gravity energy/force consistency | 6.30e-8 |
| Density relative volume L2 error | 4.70e-4 |
| Enthalpy relative volume L2 error | 3.27e-4 |
| Interior potential relative volume L2 error | 1.26e-4 |
| Gravity-gradient relative volume L2 error | 5.98e-4 |
| Surface-radius RMS error / R | 2.75e-4 |
Thus the saved model comfortably satisfies the user's 1e-5 virial requirement and also the older 1e-6 screen. Eight existing physical screening checks nevertheless fail. The diagnostic replay finds approximately 1.3% near-surface exterior-potential error; this is outside the interior potential norm above. Weak closure permits pointwise EOS mismatch because rho and h occupy different spaces. The experiment quantitatively demonstrates the n=1 projection contribution to the difference between pressure integrals from h and rho.
The old problematic mesh had a documented corner folding mechanism missed by production samples. The later saved n=1 solve has healthy sampled geometry and substantially better reference conditioning; it should not be described as suffering the same demonstrated fold. Nevertheless, current production inspection and preflight still use finite quadrature sample sets, not an element-wide positivity proof.
A one-level refined mesh and analytic geometry control exist. The refined equilibrium output directory contains input mesh, metadata, and analytic checks, but no accepted equilibrium fields or completed equilibrium convergence results. The corresponding report still describes that solve as in progress. I therefore do not infer demonstrated equilibrium h-convergence from it.
The September 9 optimization report records 1.53x whole-process, 1.70x Newton, and 2.02x linear-solve speedups for that particular batch, with roundoff-level agreement in saved physical metrics. Later working-tree optimizations go substantially further: tensor contractions, compact geometry data, fixed-mesh caches, batched field evaluations, specialized H(div) mass action, cheaper Riesz diagonal assembly, and fixed divergence reuse. The isolation harness documents a later first-Newton-step reference of 24.174 seconds. This is consistent with the user's approximate 10x improvement relative to the old 227–255 second steps, but is not a fresh matched end-to-end benchmark performed here.
Seven saved isolation-check CSVs contain 1,328 check rows, all marked passed. The latest batch includes 182 passing checks and measured incremental speedups of about 2.12x for pressure displacement action, 6.32x for source displacement action, 4.89x for hydrostatic preparation, and 6.61x for Schur preparation. These are operation-specific measurements with different baselines; they must not be multiplied into a claimed global speedup.
Validation provenance matters: the archived full-suite XML contains 592 tests, 588 passing and four failing. The failures are centrifugal virial h-refinement geometry, the n=3 projected-seed closure screen, and two-/four-rank MPI groups. The historical report reproduced those failures in preserved earlier binaries; it did not certify the newer September 14 working tree. The current H(div) constructor still requires both a local stellar and a local vacuum representative on every rank, confirming the partition limitation remains in source.
At audit time, 12 production source files were newer than the release sandbox executable and 30 newer than the release test executable. The isolation harness executable was newer than the inspected production sources. Timestamps are provenance clues, not hashes proving build identity, but they rule out treating the existing sandbox/tests as a demonstrated fresh validation of the latest source.
Evidence: [saved physical findings](/Users/tboudreaux/Programming/4DSTAR/MeanField/experiments/POLYTROPE_VALIDATION_FINDINGS_2026-09-09.md), [actual screening results](/Users/tboudreaux/Programming/4DSTAR/MeanField/polytrope_solution_2026-09-09/verification_checks.csv), [refinement status](/Users/tboudreaux/Programming/4DSTAR/MeanField/experiments/POLYTROPE_H_CONVERGENCE_2026-09-09.md), [historical full-suite report](/Users/tboudreaux/Programming/4DSTAR/MeanField/performance_optimization_2026-09-09/IMPLEMENTATION_AND_VALIDATION.md), [latest microbenchmarks](/Users/tboudreaux/Programming/4DSTAR/MeanField/final_optimizations_01/summary.txt).
## Main concerns for the next investigation
These distinguish observed implementation limitations from hypotheses about the plateau.
1. **Physical acceptance is separate from solver success.** The default Newton stopping criterion does not require virial balance. The dedicated validation program is currently specialized to single-rank, nonrotating n=1. General physical diagnostics and a 1e-5 acceptance gate are needed for the requested campaign.
2. **Central-density border and branch compatibility deserve early scrutiny.** The implemented equations are R_c=h(0)-h(rho_c,target) and R_h <- R_h+lambda_c e_c. This is not a direct constraint on the independent DG density at the center. At the saved equilibrium lambda_c is approximately -4.64e-13, with negligible effect on the unbordered residual. Along a rotating sequence, do not assume independently retained K, M, J, and rho_c targets remain compatible with the unmodified physical equations. Measure lambda_c, its normalized residual contribution, and the unbordered hydrostatic residual. This is a formulation question to investigate, not a proven diagnosis of present stagnation.
3. **The default inverse omits structure-level cross coupling and gives shape only a reference mass surrogate.** Exact Jacobian couplings are present; the approximation is in the inverse. Its adequacy at higher index/deformation must be measured on the actual troublesome Newton right-hand sides. Existing nonrotating policy rankings need not transfer.
4. **Higher n changes surface sensitivity.** The implemented d rho/d h tends to zero at h=0 for n>1, whereas n=1 has a nonzero one-sided value. Negative quadrature enthalpy triggers trial rejection. Inspect where rejected trials and weak material/shape responses occur rather than assuming the issue is only a Krylov iteration cap.
5. **Globalization is basic and failure modes need separation.** Fixed linear forcing, restart length, geometry caps, positivity rejection, and merit decrease can each limit progress. A plateau needs block-resolved residuals, true linear residuals, step lengths, and rejection reasons before selecting a remedy. The much tighter sandbox stopping threshold must be recorded in any comparison.
6. **The critical-rotation target is not yet an implemented acceptance coordinate.** The active sandbox takes angular momentum; some experiments use a reference Keplerian frequency. A declared Omega/Omega_crit convention, equatorial radius, and equatorial effective-gravity diagnostic are needed before labeling a model 50% or 99% critical. These goals are not established by setting a reference frequency fraction alone.
7. **Geometry safety and spatial accuracy remain independent requirements.** The present sampled geometry can be healthy while the surface and local gravity field are inaccurate. Near-corner/edge inspection and off-interface gravity sampling should accompany deformed models. A low scalar virial error alone cannot certify the spatial solution.
8. **Current-source regression status must be refreshed.** Rebuild explicit targets before comparing new solves. Maintain the known failure ledger without weakening assertions. Distributed scalability is presently constrained by local-material ownership assumptions, separate from serial nonlinear convergence.
## Validation additions with the highest immediate value
For zero surface pressure, preserve the independent requirement
\[
\epsilon_{vir}=\frac{|2T+W+3\Pi|}{|W|}\leq10^{-5},\qquad
W=\tfrac12\int\rho\Phi\,dV,\quad\Pi=\int P\,dV.
\]
Evaluate energy- and force-based versions, compare P(h) with P(rho), and vary diagnostic quadrature independently of solve quadrature. If nonzero surface pressure is later enabled, include the boundary-pressure contribution rather than applying the zero-pressure formula unchanged. Do not loosen the existing stricter baseline screens to meet the new minimum requirement.
The useful next tests are:
- A reproducible end-to-end baseline and rotating/index sweep recording state, mesh, source/build identity, solver controls, per-block residuals, unbordered residuals, border contribution, geometry minima, thermodynamic minima, and virial diagnostics.
- Independent radial Lane–Emden comparisons at additional indices, including a noninteger index, plus completed h/p convergence of accepted fields, shape, and global quantities. Separate reference integration from production seed generation.
- Full coupled Jacobian directional checks at accepted nonzero-rotation and higher-index states, including simultaneous angular-velocity, density, enthalpy, and surface perturbations. Use multiple admissible finite-difference step sizes and inspect each block, not just a global norm dominated by gravity.
- Rotating sanity checks: mass and angular momentum closure, T=Omega J/2 for the implemented rigid rotation, Bernoulli variation, surface pressure, symmetry/centering, and equatorial effective gravity. Positive/negative spin partners provide a useful symmetry comparison.
- Independent finite-radius gravitational flux/Poisson balance and exterior monopole checks, with sampling slightly off mesh/block interfaces. This helps distinguish localized trace effects from finite-volume field errors.
- Tensor virial or componentwise force-balance checks to expose anisotropic errors hidden by cancellation in the scalar virial.
- A targeted regression for the historical between-sample fold, plus stronger geometric sampling at large deformation. This is distinct from the existing test that rejects an obvious fold.
## Suggested order of subsequent work
First establish a freshly built baseline and preserve one reproducible plateau state with complete block and line-search telemetry. Audit target compatibility and border contamination at that state. Then check its full Jacobian and normalization balance before comparing existing and new inverse policies. Introduce continuation through accepted states and adaptive solve controls as measured experiments, retaining cost-to-solution and physical acceptance as the outcomes.
The intended milestones are understood: robust higher-index equilibria, at least 50% critical rotation, an eventual attempt beyond 99%, and every accepted model virialized to 1e-5 or better. The current infrastructure supports a disciplined investigation, but neither high-rotation convergence nor those models' physical accuracy has yet been demonstrated by the artifacts inspected here.

View File

@@ -0,0 +1,206 @@
# MeanField: current solver state and plateau diagnosis
Audit date: 16 September 2026. Repository: `/Users/tboudreaux/Programming/4DSTAR/MeanField`. This report supersedes the earlier read-only convergence assessment with fresh builds and controlled measurements. It does not promote a numerical remedy.
## Assessment
MeanField has a working, composable equilibrium operator and a useful experimental solver, with substantial derivative and lifecycle coverage. The present limitation is not one universal “Newton plateau.” The experiments separate **late linear-solve failure at already accurate n=1 states**, **more persistent coupled linear difficulty at higher index**, and **large nonlinear curvature in higher-index corrections**. There is also a distinct physical concern with retaining a prescribed central enthalpy while fixing K, mass and angular momentum.
The user's primary milestone is the stellar virial error at or below 1e-5. The n=1 cases satisfy it comfortably. The n=1.5 retained state satisfies the enthalpy-pressure virial metric despite remaining algebraically unconverged; it is not yet a validated equilibrium. The n=3 run never leaves its seed, which fails the virial milestone. Exterior pointwise accuracy is not an independent acceptance requirement: exterior changes should be judged by their influence on stellar equilibrium and virial balance.
**Scope of changes:** one opt-in diagnostic executable and helper headers, plus its build target and documentation. Production operators, preconditioner policies, normalization and solver acceptance rules were not changed. Larger Krylov windows and removal of the central phase were controlled diagnostic comparisons only.
## Code and architecture
The active model is a barotropic, rigidly rotating, self-gravitating free-boundary equilibrium in three dimensions. It is not yet a thermal or baroclinic stellar transport model. Its principal equations are mixed gravity, a weak polytropic density closure, Bernoulli balance, reduced mechanical virtual work, and mass/angular-momentum constraints:
\[
\rho(h)=\left[\frac{h}{(n+1)K}\right]^n,\quad
P=K\rho^{1+1/n},\quad
B=h+\Phi-\tfrac12|\boldsymbol\Omega\times\boldsymbol r|^2-C.
\]
Density and enthalpy are independent finite-element fields, as are potential and the RT gravity-gradient field. Pressure in the mechanical operator comes from h, whereas gravity and rotation forces use the independent density. These represent consistent continuum physics but do not enforce pointwise discrete equality automatically.
| Layer | Current state |
|---|---|
| Model and composition | Compile-time specifications generate blocks, scalar coordinates, couplings and a root manifest; the variadic prepared operator is the active aggregate. |
| Discretization | MFEM/MPI with supported-field reductions and explicit maps to full true DOFs. C++23 module interfaces are separated from implementations. |
| Geometry | A scalar radial surface graph generates interior displacement through a power-2 extension. A Kelvin compactification represents the vacuum through infinity with the outer boundary fixed. |
| Operators | Prepared matrix-free Jacobian actions; cached reference tables, geometry, thermodynamics and contractions. Dependency revisions govern invalidation. |
| Runtime | Context-owned accepted and trial states, rollback, inverse refresh and stale-view checks; FGMRES inside damped Newton. |
| Research infrastructure | Many alternative inverse policies and historical experiments exist. Production checkpoint/continuation capture is unfinished; the new snapshot is an experiment-only frozen-state facility. |
The campaign used the existing 1,216-hex mesh: 832 stellar and 384 vacuum elements, with order-4 geometry. Default approximation spaces are RT index 2 for gravity, L2 order 2 for potential and density, and H1 order 3 for enthalpy and surface/deformation. The bordered root has 178,074 unknowns: 98,928 gravity, 32,832 potential, 22,464 density, 22,981 enthalpy, 866 surface and three scalar coordinates. Mesh order is not the approximation order of every field.
Sources: [root composition](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_stellar_equilibrium.cpp:795), [problem/deformation defaults](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/operators/stellar_equilibrium_problem.cppm:317), [context and Newton runtime](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/solver/stellar_context.cppm:1199). The [earlier architecture audit](/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/MeanField_audit_2026-09-16.md) contains the fuller module map.
## Experimental controls and provenance
The current working tree, including the user's existing optimizations, was rebuilt in Release with Homebrew Clang 22.1.8. Library IPO was enabled, profiling disabled, and the field-order increment was zero. Sandbox, validation executable and test targets compiled successfully. The starting HEAD was `75cc63873992984966ea20011cc04d9984f54be4`, with 49 already-modified tracked files and additional untracked research material. The starting diff and status are archived with the campaign; HEAD alone does not describe the tested source.
Runs were serial, single-rank CPU jobs on the same mesh. M=R_reference=G=1. For n=1, K=2/pi and rho_c=pi/4. Other indices were calibrated to M=R=1 using the production Lane–Emden seed integrator (step 1e-3): this is seed-consistent calibration, not an independent high-precision continuum reference.
Live Newton used restart 40, at most 200 linear iterations, relative linear tolerance 0.03, nonlinear rtol=1e-8 and atol=0, with geometry preflight enabled. Runs stopped at linear failure rather than exhausting their nonlinear budgets. A nonzero exit status for these experiments records the intended failure observation, not a compilation or setup failure.
Frozen comparisons used the same state, physical right-hand side and default inverse, changing only the Krylov window from 40 to 160. Both started cold and independently recomputed the true residual. The live solver can retain the unused portion of a damped correction as its next initial guess; that distinction matters for the n=1.5 comparison. No probe trial was committed. Finite-difference and nonlinear-trial probes used the window-40 direction, even when window 160 gave a better solve.
Physical diagnostics integrate only stellar material at quadrature orders 14 and 18, reconstruct physical positions and the Piola-transformed gravity field, and use the actual n and K. They measure
\[
W_E=\tfrac12\int\rho\Phi\,dV,\quad
W_F=-\int\rho\,\boldsymbol x\cdot\nabla\Phi\,dV,\quad
\epsilon_V=\frac{|2T+W+3\int P\,dV|}{|W_E|}.
\]
Both W choices and both P(h)/P(rho) definitions are exported. Signed DG density is retained. Negative density makes a full physical P(rho) diagnostic undefined rather than silently clipped. Samples do not certify global positivity.
## Fresh convergence and physical results
Here F is the normalized, bordered weak residual. Omega is in the reference units above; it is **not** a measured fraction of critical rotation. Virial columns below use P(h).
| Model | Accepted Newton steps | Retained F | Energy / force virial | Immediate stopping condition |
|---|---:|---:|---:|---|
| n=1, J=0 | 3 full | 6.6053e-9 | 2.616e-7 / 3.246e-7 | Linear defect 0.04442 after 200 iterations |
| n=1, J=0.01 | 4 full | 5.0898e-10 | 2.610e-7 / 3.246e-7 | Linear defect 0.35468 after 200 |
| n=1, J=0.01, no central phase | 4 full | 5.0976e-10 | 2.612e-7 / 3.248e-7 | Linear defect 0.33345 after 200 |
| n=1, J=0.05 | 5 full | 6.0406e-9 | 3.016e-7 / 3.188e-7 | Linear defect 0.50520 after 200 |
| n=1.5, J=0 | 2: alpha=1, then 1/16 | 1.6976e-4 | 2.245e-6 / 2.318e-6 | Linear defect 0.14163 after 200 |
| n=3, J=0 | 0 | 3.1006e-3 | 5.326e-5 / 8.341e-5 | First linear solve fails at 0.05631 |
The strict n=1,J=0 nonlinear target is 1.81e-12 because it is relative to the initial residual. The same three-step model was previously classified as converged by the validation driver's absolute tolerance of 1e-8. These labels are compatible: the fresh run reproduces that state but requests further algebraic reduction.
The first three accepted n=1 steps take 22–24 seconds, confirming the current roughly 20-second operating point. I did not rerun the old pre-optimization code, so the factor-of-ten historical gain is not independently remeasured here. Once linear iterations grow, steps cost 66–106 seconds; backtracking can cost more. Improving per-action performance has not removed the conditioning problem.
For n=1, P(rho) virials are also below 3.74e-7, with order-14/order-18 changes below 8e-14. Mass/J errors are tiny. Nevertheless, Bernoulli RMS is about 1.14e-4 and density-closure RMS about 6.7e-5 in these reference units. The initial nonrotating n=1 seed already passes the virial requirement, which directly demonstrates that virial success alone does not certify interior equilibrium.
The faster-rotation case reaches Omega=0.18589155, compared with 0.03821371 at J=0.01. It passes all four virial metrics and has no negative density/enthalpy samples. Yet its maximum sampled EOS density mismatch reaches 0.00934 of the sampled density scale, approximately **0.93%**, compared with 0.0424% at J=0.01. Its Bernoulli range rises to 0.0146 while volume RMS changes little. This is a concentrated internal-consistency concern that global integrals and RMS alone would largely miss. The unbordered residual is 4.5423e-6, dominated by the central source, despite bordered F=6.0406e-9. This case was not subjected to a frozen restart comparison or a no-phase control.
For n=1.5, quadrature changes the P(h) virial by only 1.84e-9, supporting its integrated milestone. But negative DG density carries 2.89e-5 of the mass magnitude, and full P(rho) virials are undefined. Bernoulli RMS worsens from 1.49e-4 to 1.92e-4; gradient-force mismatch rises from 0.00153 to 0.01090. EOS closure improves. These are distinct errors that a single residual or virial number cannot classify. Negative density may be a projection undershoot rather than a large bulk failure; its magnitude and pressure contribution need an explicit error budget.
The n=3 state is the unchanged projected seed, not a converged model. Its virial failure is stable under quadrature refinement. A sampled bound on the pressure contribution associated with negative-density regions is below 1e-6 in virial units, too small to explain the measured 5–8e-5 P(h) defect.
## Preconditioner: capable baseline, incomplete coupled approximation
The default is accurately described by three levels:
1. **Material/surface:** solve surface q with a raw reference boundary-mass diagonal; apply the actual q-to-material coupling; solve enthalpy with a hydrostatic mass diagonal; solve density with its closure mass diagonal, including the live EOS h-to-rho derivative. Material-to-surface feedback is omitted. Replaced hydrostatic rows at the surface receive identity treatment in the enthalpy diagonal.
2. **Gravity:** approximate mixed LDU with degree-5 Chebyshev flux-mass inversion and three fixed AMG cycles for the potential surrogate B diag(M_g)^-1 B^T. Recovery uses two flux-mass actions. The surrogate and recovery do not use identical mass inverses.
3. **Structure and borders:** material/surface and gravity are independent at the structure level. A small dense scalar Schur complement is inverted exactly relative to that approximate structure inverse. Its completed scalar columns are cached; it is not the exact Schur complement of the stellar Jacobian.
Sources: [material policy and action](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/material_surface.cppm:995), [default structure policy](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/stellar_structure.cppm:850), [gravity surrogate](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/preconditioning/gravity_field.cpp:68), [border construction](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/specification_border.cppm:2333).
The live high-n EOS derivative is present; geometry refresh and stale-inverse protections are implemented. No material diagonal regularization floor activated in the inspected states. A claim that the preconditioner simply forgot nonlinear EOS dependence would be incorrect.
### Measured restart sensitivity
| Frozen state | Window 40: iterations / true relative defect | Window 160: iterations / true relative defect | Interpretation |
|---|---:|---:|---|
| n=1, J=0 endpoint | 200 / 0.04442 | 72 / 0.02914 | Larger window meets 0.03 target; 87.2 s becomes 31.0 s |
| n=1, J=0.01 endpoint | 200 / 0.35468 | 125 / 0.02519 | Larger window meets target; 90.5 s becomes 56.7 s |
| n=1.5, J=0 endpoint | 200 / 0.06491 | 70 / 0.02694 | Larger window meets target; 92.8 s becomes 32.1 s |
| n=3, J=0 seed | 200 / 0.05631 | 200 / 0.04026 | Improvement is insufficient; both fail |
At J=0.01 the histories coincide through iteration 40 and separate immediately after the first restart. The 160-vector solve finishes before restarting. Reported and independently recomputed defects agree. This establishes loss of useful accumulated Krylov information, rather than false residual reporting, for that state.
The failed window-40 n=1 corrections are nevertheless useful nonlinear directions: full admissible trials reduce F from 6.605e-9 to 2.937e-10 at J=0 and from 5.090e-10 to 1.805e-10 at J=0.01, matching their linear predictions closely. Production Newton never tries them because the fixed linear-quality gate fails. This is an observed gate/window limitation, not an observed nonlinear residual floor. It does not establish that loosening the gate is the best remedy.
At n=1.5 the cold window-40 defect, 0.06491, is smaller than the live warm-started result, 0.14163. The previous accepted step was only 1/16, so production retained 15/16 of the earlier correction as its next guess. That reuse did not help this particular solve. The comparison supports evaluating correction reuse separately from Krylov basis retention; it is not evidence that warm starts are generally harmful.
### Measured omitted feedback
At the rotating n=1 endpoint, 96.9% of the failed linear defect's squared norm lies in Poisson; at the n=3 seed it is 98.8%. The n=3 initial gravity residual is nearly zero: correcting material closure creates gravity imbalance that the coupled iteration struggles to remove.
For unit normalized scalar directions, I formed the preconditioner's completed structure response and applied the true full Jacobian. The scalar tails match the approximate Schur exactly, but the structure defects remain large and predominantly Poisson. For example, the central-border column's Poisson action is approximately 2.18e4 for n=1 and 3.15e5 for n=3. These arbitrary unit-column amplitudes are diagnostic, not physical solution errors. They directly expose missing material-to-gravity completion, consistent with stronger d(rho)/dh at higher central concentration.
The small normalized border matrix has a large raw condition number, 2.78e7 for rotating n=1 and 9.69e7 for n=3. This is dominated by a central-column scale near 7.3e6. Simple diagnostic row/column equilibration reduces those numbers to approximately 1.46 and 2.39. These are not estimates of the full Jacobian condition number and do not demonstrate a singular border or failure of its dense solve.
## Normalization: implemented consistently; physical weighting remains open
With reference Gram diagonal d and characteristic physical scale s, the state factor is sqrt(d)/s and the residual factor is 1/(s sqrt(d)), with point-row and scalar exceptions. Factors are frozen during the solve and based on M, R_reference and G, not divided by the requested J. Zero rotation is therefore not a normalization singularity.
Writing x_hat=Sx and F_hat=LF gives
\[
\widehat J=LJS^{-1},\qquad
\widehat P^{-1}=SP^{-1}L^{-1},\qquad
\widehat J\widehat P^{-1}=LJP^{-1}L^{-1}.
\]
Thus **state-only rescaling cancels from the consistently right-preconditioned system**. Direct tests spanning block state-factor changes of 1e-3–1e3 preserve the preconditioned action and physical correction to about 1e-16. Wrapper/explicit Jacobian actions and round trips likewise agree at roundoff.
This rules against a basic coordinate-wrapper error in the inspected states, not against a poor residual norm. Residual weighting changes what Krylov and line search minimize. The factors are identical across the tested indices at M=R=G=1 and do not adapt to concentration, EOS susceptibility or deformation. Their large ranges reflect support sizes and point-row treatment, not automatically a bug. The normalized weak norm is not a demonstrated unit-, mesh- or index-independent physical stopping criterion.
Future residual weighting should be evaluated through interior errors and virial, with stellar/vacuum gravity contributions separated. **Poisson dominance alone does not show that the exterior dominates the failure.** Exterior normalization or approximation changes remain acceptable if their induced interior errors satisfy the physical budget.
Sources: [factor construction](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/normalization/operators.cppm:325), [frozen stellar wrapper](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/normalization/stellar_equilibrium.cppm:650).
## Operator and globalization hypotheses
### 1. Higher-index corrections encounter real nonlinear curvature
For n=1.5, a valid linear correction is rejected at alpha=1, 1/2, 1/4 and 1/8 solely on residual merit; alpha=1/16 is accepted. All those trials are admissible. Gravity rows, initially almost zero, dominate the residual after the first step.
For n=3, the frozen full correction is admissible but increases F by a factor 6.92; alpha=0.1 decreases it. Its measured vector Taylor remainder is approximately 0.0215 alpha^2 over several decades of alpha. This supports smooth curvature along the tested direction rather than a gross derivative inconsistency. The current geometry-dependent gravity mass/source terms contain q–gravity and q–density interactions even though gravity is linear in its fields at fixed geometry.
Prepared closure and pressure reject negative enthalpy. Positivity does not limit the tested n=3 direction (sampled enthalpy step bound about 18.5) or late rotating n=1 direction (about 4e6). No positivity rejection was recorded during the earlier n=1.5 production backtracking.
However, the **later cold window-40 n=1.5 endpoint direction does encounter a positivity boundary**: the combined sampled thermodynamic limit is alpha=0.18863 (pressure quadrature; closure gives 0.19517), and full/half trials are rejected. At alpha=0.1 preparation succeeds but F grows to 2.4033e-4; alpha=0.01 decreases it slightly to 1.6893e-4. Its measured Taylor remainder is approximately 0.008852 alpha^2, with gravity accounting for 99.734% of the squared remainder at alpha=0.01. This separates a thermodynamic ceiling from a still tighter residual-merit restriction. It also shows why rejection mechanisms must be identified per state and direction rather than ruled out for an entire index. These nonlinear trials did not test the window-160 correction. Positive Jacobian determinants do not bound residual curvature or ensure enthalpy positivity.
**Discriminating next experiment:** separate shape-only, field-only and full directional Taylor remainders at the same state. With shape held fixed, the gravity residual is linear in its field/density variables, so its remainder should vanish to arithmetic accuracy. Measure reduced surface response and the actual correction's spatial content before selecting trust-region or continuation changes.
### 2. The surface equation complement may weaken for n>1
Hydrostatic surface rows are replaced by h=0; shape equations come from volume mechanical virtual work pulled back through the prescribed extension. For exact smooth fields with rho=P=0 on the surface,
\[
R_{mech}(w)=\int\rho\nabla B\cdot w
=-\int B\,\nabla\cdot(\rho w).
\]
Near a regular surface, h is proportional to inward distance d and rho to d^n. The induced Bernoulli test weight therefore behaves like d^(n-1): finite trace for n=1, vanishing trace for n>1. This suggests that mechanical shape tests may poorly complement the retained interior hydrostatic tests as n increases.
This is a **specific, unmeasured conditioning hypothesis**, not proof of a missing equation or zero shape stiffness. The extension reaches dense interior material, and independent discrete fields break the exact identity. Measure the reduced surface response and its near-null modes after coupled material/gravity completion. A later controlled formulation comparison could retain all weak Bernoulli rows and place h_surface=0 in shape rows, subject to checking matching boundary spaces. No such replacement was made here.
The power-2 extension also does not contain exact uniform volume dilation, so satisfying reduced mechanical equations does not algebraically guarantee scalar virial balance. The independent virial measurement must remain mandatory.
### 3. Central phase contamination is a physical issue, but not the sole low-spin stall mechanism
The central-density specification actually imposes a central enthalpy coefficient and adds lambda_c e_c to the hydrostatic equation. At rotating n=1,J=0.01, bordered F is 5.09e-10 but the unbordered norm is 1.87e-7. Removing the phase leaves global virials and bulk integrals almost unchanged, while the formerly constrained enthalpy coefficient drops by 6.83e-4, or 0.0683%. A localized error can therefore be invisible to the virial milestone.
The no-phase run still fails its late linear solve, so this border is not the sole cause of that Krylov failure. It nevertheless matters to internal correctness and to defining a physically compatible rotating sequence. At fixed K and mass, central density generally changes with rotation. For the n=1 reference model, an independent slow-rotation calculation gives delta M/M=(2/3-2/pi^2) Omega^2 at fixed K and rho_c; allowing the central density to decrease is required to retain equal mass. This agrees with the classic perturbation result in [Chandrasekhar's 1933 rotational-polytrope paper](https://articles.adsabs.harvard.edu/pdf/1933MNRAS..93..390C). The calculation is a local continuum argument, not proof that the bordered discrete system lacks a root.
At n=3,J=0 the central condition fixes a genuine homology freedom, so indiscriminately deleting it would be inappropriate. The physical parameterization of a rotating n=3 sequence deserves separate treatment. See the [formulation analysis](/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/formulation_audit_notes.md) for the derivation and source references.
### 4. Translation modes remain a plausible, unmeasured contribution
The active surface descriptor retains translations; fixing the mesh origin is not equivalent to fixing the physical center of mass when fields are independent. At a smooth center, a central enthalpy condition has zero first-order response to physical translation. Three continuum translation symmetries exist at zero rotation; axial translation survives rotation about a fixed axis.
The finite-element mesh, compactification and border may lift these directions, and measured COM drift is only a few parts in 1e-6. There is no evidence here that gross translation caused the observed curvature. Existing shape-only dipole tests do not test a fully field-compensated physical translation. A useful next probe constructs that complete tangent, completes gravity, measures Jv and overlap with the failed correction, and compares axial/transverse responses. Do not add a centering constraint merely on the strength of the continuum argument.
## Verification, limits and next decisions
All **nine focused tests passed: 4,252 assertions, zero failures**, in 315 seconds. They cover the complete coupled core Jacobian; closure at n=1,1.5,3; nonlinear pressure derivatives; optimized/reference hydrostatic preparation; central-border composition; generated angular-velocity derivatives; two-sided normalization with the full inverse; frozen normalized coordinates; and direct reference-mass diagonals. The freshly rebuilt, formatted diagnostic target also compiles successfully. See the [test log](/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/diagnostics/campaign_2026-09-16/focused_tests.log) and [exact test selection](/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/diagnostics/campaign_2026-09-16/focused_tests_metadata.json).
The final diff comparison confirms that all tracked numerical source changes predated this audit; the only additional tracked-file edit is the diagnostic CMake target. Five new experiment source/documentation files were added. The test reporter's new HTML output was archived and the user's pre-existing September 9 report restored. [Provenance](/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/diagnostics/campaign_2026-09-16/provenance.json) records the source check and final file hashes; a separate manifest records the actual campaign binary before formatting and its mesh hash.
Actual-state one-sided finite differences supplement manufactured tests. Higher-n error trends support the implemented derivative along the tested directions. At tiny n=1 residuals, differencing reaches an absolute arithmetic floor around 3e-14, so relative errors of nearly zero actions are not evidence of a Jacobian bug. These checks do not exhaust every mode, state, or near-vacuum behavior.
The entire test suite was not rerun. The prior archived full-suite result was 588/592 passing, with known refinement-map, projected n=3 seed-closure and two distributed-layout failures. This campaign is single-rank and does not resolve distributed partition restrictions. No rotating continuation to 50% or 99% critical has been demonstrated. Critical fraction must eventually be based on the rotating surface/equatorial effective gravity, not reference-unit Omega alone.
The most defensible sequence of subsequent work is:
1. Use these frozen physical right-hand sides as common comparisons for restart/recycling and existing coupled inverse policies. Compare true residual blocks, time and memory; do not select policies from isolated subsystem performance alone.
2. Measure missing density–gravity completion and the reduced surface response, including compensated translation/homology directions. The historical experiments already show that “more coupling” is not automatically better in the full system.
3. Separate geometric Taylor remainders and relate correction size to surface-response conditioning. Then choose among stronger coupled preconditioning, a different surface formulation, globalization or continuation based on the measured failure.
4. Evaluate residual weighting with stellar/vacuum splits and physical error budgets. State-only scaling is not a standalone remedy for this right-preconditioned operator.
5. Define a compatible physical sequence and monitor unbordered residuals and central profiles as J increases. Keep the central condition only where its role and physical effect are understood.
Validation should label **virial milestone**, **interior correctness**, and **algebraic convergence** separately. The next regression set should include both virial definitions with quadrature refinement; mass/J and COM; Bernoulli, EOS and gravity consistency by center/bulk/surface region; negative-density mass/pressure budgets; nonrotating n=1,1.5,3 profile and integral convergence under mesh/order refinement; and rotating symmetry/equatorial-force checks. Exterior refinement or weighting comparisons should be accepted according to their effect on those interior quantities. ESTER remains a later independent validation target.
## Artifacts
- [Campaign summary JSON](/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/diagnostics/campaign_2026-09-16/campaign_summary.json), with per-case CSVs and logs in the same directory.
- [Detailed preconditioner measurements](/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/diagnostics/campaign_2026-09-16/preconditioner_analysis.md).
- [Physical validation analysis](/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/diagnostics/campaign_2026-09-16/physical_validation_analysis.md).
- [Diagnostic executable source](/Users/tboudreaux/Programming/4DSTAR/MeanField/experiments/plateau_diagnostic.cpp) and [usage/methods](/Users/tboudreaux/Programming/4DSTAR/MeanField/experiments/plateau_diagnostic_README.md).

View File

@@ -0,0 +1,243 @@
# Formulation and operator audit — 2026-09-16
Read-only examination of `/Users/tboudreaux/Programming/4DSTAR/MeanField`, plus an independent, inexpensive scalar Lane–Emden perturbation calculation. No production edits or full FEM solves were made by this sub-audit. Sources refer to the current working tree rather than HEAD alone. The main audit's fresh solves should take precedence when categorizing actual plateau behavior.
## Principal conclusion
The most consequential formulation hypothesis is target compatibility: the sandbox fixes the EOS constant K, total mass M, angular momentum J, and central enthalpy simultaneously. The central condition is implemented by adding an artificial, localized hydrostatic source, not by choosing a physical degree of freedom such as K. An unbordered rotating polytrope does not generally have all four independent freedoms. This merits measurement before assigning the plateau entirely to preconditioning. It is **not yet demonstrated that this causes the observed plateau**.
The operator composition and available tests provide meaningful evidence against an elementary missing rotation derivative or forgotten shape pullback term. Existing optimized-path checks remain narrower than an end-to-end Jacobian check at an actual plateau.
## What is implemented
The physical residual is:
- Mixed gravity in independent RT gradient and L2 potential fields.
- Weak density closure, `integral q (rho-rho(h)) = 0`, in the DG density space.
- Hydrostatic Bernoulli residual, `integral v (h+Phi-Psi-C) = 0`, in H1 enthalpy, except surface rows replaced by pointwise prescribed enthalpy.
- Surface mechanical residual obtained by pulling back the full volume virtual-work residual through the surface-to-interior extension.
- Mass and angular momentum constraints, whose scalar unknowns are C and angular speed.
- Optional central enthalpy condition with a generated border scalar lambda.
Source: [physical composition](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_stellar_equilibrium.cpp:795), [hydrostatic imbalance](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_hydrostatic_equilibrium.cpp:863), [closure](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_barotropic_closure.cpp:652), [mechanical composition](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_displacement_operator.cpp:309).
Pressure force uses P(h), while gravitational and centrifugal forces use the independent rho. Hydrostatic balance uses the independent Phi, while force balance uses the independent gravity gradient. These are consistent continuum equations but need not be identical discrete statements. Their finite-dimensional compatibility and conditioning deserve attention as n increases. This is not a demonstrated algebraic error.
## Central-density compatibility: a quantitative check
[Sandbox lines 92–116](/Users/tboudreaux/Programming/4DSTAR/MeanField/sandbox.cpp:92) prescribe spherical n=1 K and rho_c and retain both fixed mass and fixed central density when J is changed. The commented n=3 replacement constants do the same for that index. [The phase implementation](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/operators/prepared_central_density.cppm:71) is exactly
```
R_c = h(0) - h(rho_c,target)
R_h += lambda_c e_c
```
The phase therefore changes the physical hydrostatic equation whenever lambda_c is nonzero. It does not literally constrain the independent DG density at the center. Repository [extension documentation](/Users/tboudreaux/Programming/4DSTAR/MeanField/docs/stellar_physics_extension_guide.md:188) itself distinguishes a phase condition that removes a degeneracy from a new physical invariant.
An independent continuum calculation sharpens this concern. Define
\[
a^2=\frac{(n+1)K}{4\pi G}\rho_c^{1/n-1},\quad h=(n+1)K\rho_c^{1/n}\theta,
\quad \xi=r/a,\quad v=\frac{\Omega^2}{2\pi G\rho_c}.
\]
Taking the Laplacian of `h+Phi-Omega² s²/2=C` gives
\[
\Delta_\xi\theta=-\theta^n+v.
\]
At first order in v the angle-averaged correction psi satisfies
\[
\psi''+2\psi'/\xi+n\theta_0^{n-1}\psi=1,
\quad \psi(0)=\psi'(0)=0.
\]
Because density vanishes at the unperturbed surface for n>=1, the first-order displacement of the integration boundary makes no contribution to mass. Consequently
\[
M=4\pi a^3\rho_c\{m_n+v m'_n(0)+O(v^2)\},
\quad m_n=-\xi_1^2\theta'_0(\xi_1),
\quad m'_n(0)=\xi_1^3/3-\xi_1^2\psi'(\xi_1).
\]
For n=1, theta_0=sin(xi)/xi and psi=1-theta_0, yielding the exact leading-order result
\[
\frac{\delta M}{M}=\left(\frac{\pi^2}{3}-1\right)v+O(v^2).
\]
For the sandbox's G=M=R=1 spherical K and rho_c, this becomes
\[
\frac{\delta M}{M}=\left(\frac23-\frac{2}{\pi^2}\right)\Omega^2+O(\Omega^4)
=0.4640242994\,\Omega^2+O(\Omega^4).
\]
For example, Omega=0.015 in these units implies a leading-order mass shift of about 1.04e-4 if K and rho_c stay fixed. This is **not** a measured error from a code run, and Omega here is relative to the spherical reference Kepler frequency; it is not a measurement of fraction of mass-shedding critical rotation. At fixed K and M the physical central density should instead change at order Omega².
An independent RK4 solution of the radial perturbation equations gave:
| n | xi1 | m_n | d(log M)/dv at fixed K,rho_c |
|---|---:|---:|---:|
| 1 | 3.1415926655 | 3.1415926536 | 2.2898681711 (exact 2.2898681337) |
| 1.5 | 3.6537537533 | 2.7140551201 | 2.8391061305 |
| 2 | 4.3528746068 | 2.4110460121 | 3.5676985861 |
| 2.5 | 5.3552754706 | 2.1871995655 | 4.5879534966 |
| 3 | 6.8968486271 | 2.0182359510 | 6.1245958551 |
Radial steps 1e-3 and 5e-4 agree on the n=3 derivative to approximately 1.3e-11 absolute; n=1 agrees with its closed form at 4e-8. These calculations establish the local continuum compatibility concern without depending on the production FEM solver or seed integrator.
For n=3 the prefactor `a³ rho_c` is independent of rho_c. Central density can select the nonrotating homology family when K and M are compatible, but a rotating dimensionless solution has a different mass at the same K. Changing rho_c alone cannot cancel that difference at fixed v. A sequence retaining the nonrotating K and M is therefore especially delicate: the nearby positive-rotation branch is not obtained simply by selecting a new central density. This is separate from, and additional to, linear-system difficulty near the n=3 homology mode.
This derivation was subsequently checked against the primary paper [S. Chandrasekhar, “The Equilibrium of Distorted Polytropes: (I). The Rotational Problem,” MNRAS 93, 390–406 (1933)](https://articles.adsabs.harvard.edu/pdf/1933MNRAS..93..390C). Equation (48″), page 397, gives exactly the n=1 mass correction above. Equation (56), page 399, gives approximately 6.123v for n=3, consistent with the sign and magnitude of the independent modern integration. Section 12, pages 400–401, discusses changing central density to retain equal mass and the singular character of n=3. The derivation and numerical calculation above were performed independently; the primary paper is a cross-check, not the source of their numerical table.
For n different from 3, fixed-K mass scaling gives the leading equal-mass response
\[
\frac{\delta\rho_c}{\rho_c}=-\frac{2n}{3-n}\frac{m'_n(0)}{m_n}\,v+O(v^2).
\]
The factor `2n/(3-n)` also makes n near 3 particularly sensitive. These are nearby, slowly rotating continuum statements; they do not prove that the finite-dimensional bordered system lacks a root or that every rotating branch at every parameter value is impossible.
**Discriminating measurements:** lambda_c, normalized norm of `lambda_c e_c`, the unbordered residual, and central profiles throughout rotation continuation. Compare their order in Omega². A physically meaningful variant must either demonstrate negligible lambda or explicitly account for which physical target is allowed to change. A solver can reduce the bordered residual while concealing an unbordered hydrostatic defect, so residual convergence alone cannot settle this question. The archived n=1 J=0 solution is a favorable control: lambda=-4.64e-13, normalized border action=1.25e-9, and unbordered total residual=6.72e-9.
A bounded **n=1 diagnostic control** without the phase is especially informative if the original rotating run fails: central enthalpy should be allowed to depart from its spherical value, and the physical residual should converge without a localized artificial source. This would test formulation sensitivity, not constitute a promoted remedy. Do not extrapolate this control to n=3,J=0, where removing the phase exposes a genuine homology degeneracy. Furthermore, an n=1.5 or n=3 plateau at **J=0 with compatible spherical targets** cannot be explained by rotational target incompatibility; another mechanism or a distinct discretization/phase compatibility issue must be demonstrated there.
## Surface admissibility and material conditioning
[Prepared closure lines 614–633](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_barotropic_closure.cpp:614) require finite density but reject every negative enthalpy quadrature value. The standalone EOS's rho(h)=0 extension at h<0 is therefore not usable through this prepared path. High-order H1 interpolation can undershoot between nodes, including when the boundary values are zero. A positivity-driven line-search collapse is a credible, testable plateau mechanism.
For a frozen Newton direction in reference coordinates, the exact closure-sample positivity limit is
\[
\alpha_h=\min_{\delta h_q<0}(-h_q/\delta h_q).
\]
Compare alpha_h with geometric preflight and accepted step length, and record the limiting element, point, h and delta h. This distinguishes an enthalpy boundary from geometry and merit-only rejection. Since h samples depend on FE coefficients rather than the moving physical quadrature location, this diagnostic is inexpensive and directly interpretable.
Independent DG density can be negative locally while all preparation checks pass; the angular-momentum operator only rejects a negative *total* inertia, not negative local density. Record minimum rho and negative-density mass fraction independently.
The [EOS derivative](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/eos/polytropic.cppm:155) is nonzero at h=0 for n=1, but zero for n>1. Thus density/enthalpy coupling becomes weak in the outer layers. This is not automatically a singular complete Jacobian: hydrostatic rows retain their h mass term and density rows retain their rho mass term. Claims that the EOS is singular must distinguish a vanishing coupling from inversion of that coupling or actual rank loss.
EOS quadrature includes an n-dependent extra order, `(n-1)*enthalpyOrder`, rounded upward ([source](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_barotropic_closure.cpp:103)); there is no evidence here of the elementary mistake of keeping an n=1 closure quadrature rule for all n. Noninteger powers and deformed geometry still merit independent quadrature convergence checks.
## Mechanical residual and virial acceptance
The reduced shape residual is `D'(s)^T R_mech`, not the full volume mechanical residual. Its vanishing establishes equilibrium only against extension-generated virtual displacements. The default interior extension uses radial power 2 ([default composition](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/operators/stellar_equilibrium_problem.cppm:317), [power default](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/deformation/radial_extensions.cppm:103), [radial weights](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/deformation/radial_extensions.cpp:752)). Uniform surface inflation therefore does not produce an exact volume dilation w=x on a spherical reference configuration. In particular, vanishing reduced mechanical residual does not algebraically guarantee a zero scalar virial residual.
The required 1e-5 virial milestone should be evaluated independently over the stellar volume. The existing validation integrals already compute energy and force versions and P(h) versus P(rho), but are explicitly n=1 formulas ([measurement source](/Users/tboudreaux/Programming/4DSTAR/MeanField/experiments/polytrope_validation_measurements.hpp:136)). Reusing this routine for n=3 without replacing these formulas would silently compute the wrong pressure. It is currently used only by an n=1-specialized harness, so this is a generalization warning, not an existing bug.
Interior pointwise tests should resolve Bernoulli variation, EOS mismatch, density sign, and gravity consistency. Exterior error is relevant insofar as it changes those internal quantities or virial balance; it should not be an independent acceptance obstacle under the user's stated priority.
## Jacobian correctness and optimization evidence
The root shape derivative contains both `D'(s)^T J_mech delta` and the derivative of the pullback itself ([source](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_stellar_equilibrium.cpp:891)). The generated angular-speed derivative reaches both the hydrostatic and shape rows, and the angular-momentum row differentiates inertia in density and geometry ([source](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/operators/prepared_variadic_stellar_equilibrium.cppm:713)). Returning zero physical rotational derivative at Omega=0 is correct for a quadratic centrifugal potential.
Existing coverage includes:
- A complete core, block-resolved centered-difference test with n=3 and nonzero fixed rotation, tolerance 2e-6 ([test](/Users/tboudreaux/Programming/4DSTAR/MeanField/tests/operators/prepared_stellar_equilibrium.cpp:1225)).
- A generated-Omega column finite-difference test at n=1, nonzero J, checking shape, hydrostatic, and angular-momentum rows ([test](/Users/tboudreaux/Programming/4DSTAR/MeanField/tests/operators/stellar_equilibrium_system.cpp:246)).
- Separate angular-momentum density/displacement derivative tests and numerous displacement/thermodynamic component checks.
- Optimized-versus-reference and finite-difference isolation results, with final batch metadata explicitly reporting n=1, K=1, 3 directions, deformation setting 0.7, and one rank ([metadata](/Users/tboudreaux/Programming/4DSTAR/MeanField/final_optimizations_01/metadata.txt)).
I found no demonstrated Jacobian defect in this read-only review. However, none of these facts substitutes for a fresh check at the actual higher-n/rotating stalled state, including simultaneous field, shape, Omega and border perturbations. Use an epsilon sweep and per-block relative errors, plus one-sided admissible perturbations where centered tests cross h=0. In particular, the n=1 optimization metadata is not evidence that nonlinear pressure/closure optimization is validated at every higher n.
## Ranked formulation-side hypotheses and falsifiers
1. **Physical target incompatibility / border contamination.** Strong analytical basis, but no stalled-state lambda measurement yet. Falsify as immediate cause if lambda and unbordered residual remain negligible while a compatible target family stalls identically.
2. **Enthalpy admissibility prevents the Newton correction.** Explicit rejection mechanism in source; must be established from trial reasons and alpha_h. Falsify if full or large steps are accepted and no thermodynamic rejections occur.
3. **Weak density/enthalpy coupling and approximate discrete mechanical compatibility worsen near n=3 or rotation.** Established structural change; causal role requires block diagnostics, homology-response measurement, and refinement comparison. Do not label projected-seed residual floors as proof that no discrete equilibrium exists.
4. **Missing or incorrect Jv at the actual state.** Lower prior because of substantial derivative tests, but inexpensive relative to further unstructured solver tuning and not excluded by old checks. Falsify with current-source, per-block directional convergence at the stalled state.
No proposed remedy has been implemented in this audit.
## Diagnostic-driver and focused-test review
Reviewed the separate workspace `diagnostics/plateau_diagnostic.cpp` without compiling or running it. `Derive()` correctly calibrates M=R=1 using `rho_c=xi1³/(4*pi*mu1)` and `K=4*pi*G*rho_c^(1-1/n)/((n+1)*xi1²)`. The last derivative entry really is at the first zero: the production integrator appends the linearly interpolated root and immediately returns. There is no endpoint-index error. Calibration is consistent with the seed integrator, but its 1e-3 step and linearly interpolated root/derivative do not certify exact continuum constants to 1e-12. Unbordered-residual subtraction correctly uses full residual indices supplied by `PhysicalState`.
Recommended focused test names (not run by this sub-audit):
1. `Prepared Stellar Equilibrium Complete Jacobian Matches Every Coupled Centered Difference Block` — n=3 core, nonzero fixed rotation, all blocks.
2. `Prepared Barotropic Closure Covers Multiple EOS And Geometry Conditions In Reduced Coordinates` — current tensor/reference comparisons and centered differences at n=1, 1.5, 3.
3. `Prepared Pressure Force Jacobian Matches Full Stateless Columns Through FieldDof Restriction` — n=3 optimized versus retained/reference pressure paths.
4. `Hydrostatic Tensor Preparation Matches Pointwise Preparation And Rebuilds On Mode Changes` — optimized preparation, all columns, geometry changes and switching paths.
5. `Central Density Contribution Composes Through The Variadic Root` — n=3 border algebra and invalidation.
6. `Fixed Angular Momentum Root Uses Its Generated Angular Velocity In Every Physical Row` — generated-Omega column at n=1 and nonzero J.
7. `Two Sided Normalization Composes With The Full Coupled Stellar Preconditioner` — n=1, J=0.05, central phase, scaling and inverse composition.
Additional relevant checks: `Normalized Stellar Equilibrium Preserves Physical Residuals Jacobians And Frozen Solve Coordinates` and `Direct Reference Mass Diagonals Match Full True DOF Assembly`.
The higher-n optimized-source test coverage is stronger than the saved n=1-only isolation metadata alone suggests. However, its manufactured enthalpy profiles are bounded away from vacuum. Passing these checks would not establish correctness of near-surface derivative behavior at a real plateau. The historical `Prepared Stellar Equilibrium Has A Restoring Jacobian Around An N3 Polytrope` screen has a known projected-seed closure failure; keep its result distinct rather than silently including it in a passing focused-selection claim.
## Additional hypothesis: physical translation modes survive mesh anchoring
**Assessment:** structurally plausible and worth a targeted frozen-J diagnostic, but not yet demonstrated as a measured near-null direction of the current normalized operator or as the cause of late Newton linear difficulty.
The active radial-surface descriptor explicitly declares `translationTreatment=Retained` ([source](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/deformation/nodal_radial_surface.cpp:25)). The power-law extension forces the displacement at the origin to zero ([source](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/deformation/radial_extensions.cpp:752)). The old `PreparedCenteringConstraint` module still exists and is exported, but a source-wide search found no active instantiation/application in the physical or variadic root. It imposed zero center *mesh displacement*, not center of mass. No active COM, three-component enthalpy-gradient centering, reflection/parity, or l=1 exclusion condition was found. Center-of-mass integration infrastructure exists as analysis/quadrature support, not an active equilibrium constraint.
The historical [deformation design](/Users/tboudreaux/Programming/4DSTAR/MeanField/SURFACE_DEFORMATION_PRESCRIPTION_DESIGN.md:703) intentionally removed the old centering rows when restricting geometry; it explicitly left possible surface-space translation projection or COM control to future conditioning evidence. Its argument establishes that rigid translation of the *complete mesh* is excluded. It does not establish that a compensated translation of the *physical fields and stellar boundary* is excluded.
To see the distinction, write the physical mesh map as x(X) and its perturbation as v(X). A translated physical scalar field is `f_t(x)=f(x-t a)`. Its coefficient-field tangent on the changing mesh is
\[
\delta\widehat f(X)=\nabla_x f(x(X))\cdot[v(X)-a].
\]
The scalar fields are independent unknowns, so they can supply this composition term even when v(0)=0. On a spherical surface the translated shape has radial tangent `delta s=a dot e_r`; on a general star-shaped surface it is `(a dot n)/(e_r dot n)`. Both are representable approximately by the nodal radial surface space. Tangential relabeling of surface points need not be a root geometry degree of freedom to describe the same translated physical boundary.
At a smooth centered equilibrium, `grad h(0)=0`. Thus the central phase has first-order response
\[
\delta R_c=\delta h(0)=-a\cdot\nabla h(0)=0.
\]
It may select the center at nonlinear second order, but it does not provide a nonsingular first-order translation gauge at such a state. Even away from an exact extremum its single scalar row can constrain at most one linear combination of three translation directions. This differs fundamentally from its useful nonzero response to the n=3 homology scaling tangent.
For Omega=0, all three translations preserve the continuum unbordered equations, mass, and zero angular momentum. For nonzero rigid rotation about a fixed z axis, axial translation preserves the centrifugal potential, the axial inertia, and J. Transverse translations are physically lifted by the fixed rotation axis through the force/hydrostatic equations, although their first-order axial inertia change is zero at a centered model. A nonzero anchored lambda source can itself break translation symmetry; the near-symmetry argument is strongest where the unbordered defect and lambda are already negligible.
Finite-element interpolation, the particular radial geometry space, compactified exterior representation, and discrete departure from symmetry can lift these continuum directions. Consequently, this review does not claim an exact current algebraic nullspace. Fixed origin of the exterior compactification is likewise a coordinate choice in the continuum but may be a source of finite-resolution lifting.
### Existing mode evidence does not test this complete tangent
Current [surface-mode construction](/Users/tboudreaux/Programming/4DSTAR/MeanField/experiments/stellar_null_space.cppm:444) initially sets all root blocks to zero except surface shape. Its l=1 patterns are named translation-like dipoles. In [coupled mode construction](/Users/tboudreaux/Programming/4DSTAR/MeanField/experiments/coupled_gauge_modes.cpp:373), only homology receives extension-aware density and enthalpy tangents; nonuniform modes, including dipoles, retain their original shape-only material variation before gravity completion. Their nonzero hydrostatic response therefore cannot falsify a fully compensated physical translation near-null mode.
The older `gravity_completed_null_space_restricted.csv` contains near-null *full-displacement* translations: unpinned action about 2.99e-7, versus constrained action about 1 after old center-row replacement; z translation remains at that small response at reference rotation fraction 0.5. This is historically consistent with the symmetry argument, but it is not current reduced-root/normalization evidence and should not be presented as such.
### Suggested frozen-state probe, without modifying solver policy
1. For each axis, prescribe the radial translation tangent on the current surface. At the nearly spherical n=1 J=0 baseline, `a dot e_r` is a suitable first probe; retain the current-normal formula for stronger deformations.
2. Lift it through the current domain-deformation Jacobian to v.
3. Project `grad h dot (v-a)` into the supported enthalpy space and `grad rho dot (v-a)` into supported density. For DG density, compare a recovered/analytic physical gradient or `rho'(h) grad h` to the elementwise gradient, because a broken derivative alone is not an exact translation of a discontinuous finite-element function. Boundary enthalpy direction should be zero by tangency; verify this rather than introducing a false surface-pressure response.
4. Complete the gravity-gradient and potential directions by solving the frozen restricted mixed gravity block with the negative residual generated by the prescribed density and shape tangents. Existing `GravityUnknownJacobian`/`solve_gravity_completion` in `experiments/coupled_gauge_modes.cpp` provides the model. This avoids hand-differentiating the RT Piola transform and correctly includes the fixed-infinity exterior response.
5. Set delta C, delta Omega and delta lambda to zero for the translation symmetry probe. Apply the full normalized Jacobian to a unit normalized direction and report every block, the phase response, delta M, delta J, and the derivative of COM (which should approach a).
6. Compare with uncompensated dipoles and generic normalized directions; then examine overlap of the actual problematic Newton correction with the compensated translation span. At nonzero rotation, compare axial with transverse response. A tiny response alone identifies poor conditioning; association with the failing correction/right-hand side is needed to assign causality.
No translation-mode code or solver change was implemented, and no new solve was run by this sub-audit.
## Additional hypothesis: mechanical rows weakly complement the omitted boundary Bernoulli tests
The active root first builds all H1 hydrostatic rows and then replaces the surface subset with h=0. Shape equations are separately supplied by reduced mechanical virtual work ([composition](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_stellar_equilibrium.cpp:803)). This is square and deliberate, not an equation-counting mistake. Nevertheless, the quality of the resulting surface complement may deteriorate with n.
For smooth exact fields, write `B=h+Phi-Psi-C`. Using `grad P=rho grad h` and P=0 on the surface gives
\[
R_{mech}(w)=\int_\star \rho\nabla B\cdot w\,dV
=-\int_\star B\,\nabla\cdot(\rho w)\,dV,
\]
where the second equality also uses rho=0 at the surface. Thus a shape test w_s acts like a Bernoulli test `q_s=-div(rho w_s)`, rather than like one of the dropped H1 boundary basis functions. Near a regular free surface, h is proportional to inward distance d and rho is proportional to d^n. For a smooth test with nonzero normal surface motion, the leading induced weight behaves as `q_s ~ d^(n-1)`. It has nonzero limiting trace for n=1 but vanishing trace for n>1.
This gives a specific potential conditioning mechanism: as n increases, induced mechanical tests may overlap strongly with already retained interior hydrostatic tests while weakly controlling Bernoulli mismatch in the boundary layer. After eliminating material/gravity variables, the remaining shape response can become small or sensitive to projection mismatch. A heuristic boundary-layer calculation suggests suppression relative to unweighted boundary Bernoulli tests by an additional factor of layer-thickness^(n-1), but this is not a measured scaling law for this discretization.
There are essential limits to this argument:
- Vanishing surface density **does not imply a zero mechanical shape Jacobian**: the lifted test extends through the dense interior, and geometry, pressure, gravity and scalar-field readjustment all contribute.
- In the continuum, interior Bernoulli tests are already dense enough to impose B=0; counting boundary test functions is a finite-dimensional argument, not proof of an underdetermined physical free boundary.
- The discrete code uses independent rho and h and independent RT gravity and L2 potential. Pointwise EOS mismatch, noncommuting gravity representations, and DG jumps spoil the exact smooth-field identity. Those defects can supply a numerical complement, but its magnitude and conditioning must be measured.
- Consequently, neither continuum redundancy nor surface vanishing by itself proves an implementation defect or identifies the observed plateau.
A direct diagnostic would eliminate the coupled material/gravity response for selected surface directions and compare the remaining mechanical-shape response with the omitted boundary Bernoulli residual response. Measure normalized singular/near-null responses, correction amplitudes, and refinement/index dependence. The reported n=1.5 behavior—small lambda, no thermodynamic rejection, acceptable linear residual and large geometric quadratic remainder—is compatible with a poorly conditioned shape direction, but is also compatible with other causes of an excessively large Newton correction.
A useful **future controlled formulation comparison**, not implemented here, is to retain all Nh weak Bernoulli rows and use h_surface=0 as the Nq shape-row equations, replacing mechanical shape rows. The current surface space is scalar H1 from the displacement collection (order 3), while enthalpy is also scalar H1 order 3 on the same mesh ([FEM construction](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/fem.cpp:214)); verify boundary count/topology before using a one-to-one arrangement. The design explicitly permits unequal future orders, so equality is not an architectural invariant. Retaining weak boundary Bernoulli tests avoids choosing a pointwise trace for the discontinuous potential. Independent virial and internal correctness remain acceptance criteria regardless of which discrete complement performs better.

View File

@@ -0,0 +1,85 @@
# Preconditioner and normalization audit — 2026-09-16
Read-only inspection of the current working source in `/Users/tboudreaux/Programming/4DSTAR/MeanField`. No solver fixes, source edits, builds, or new numerical runs were performed by this audit subtask. Existing numerical results below are explicitly historical. The repository is dirty and contains substantial performance work newer than HEAD `75cc638`; line references identify the inspected working source.
## Current default: exact implementation, not inferred intent
The sandbox selects `PhysicalRieszDiagonal{radius,G}`, default stellar preconditioning, and FGMRES(restart 40): [sandbox.cpp:118](/Users/tboudreaux/Programming/4DSTAR/MeanField/sandbox.cpp:118).
The physical unknowns grouped for preconditioning are material/surface `(rho,q,h)`, gravity `(g,Phi)`, then the generated scalar constraints. The preconditioner is a composition of three approximations:
1. **Material/surface is surface-first triangular.** Solve `q = Dq^-1 bq`, subtract the actual surface-to-material Jacobian actions, solve `h = Dh^-1 (bh-Ahq q)`, then solve `rho = Drho^-1 (brho-Arhoq q-Arhoh h)`. Thus the current EOS derivative and surface-to-material actions ARE included. Material-to-surface feedback is omitted. `Drho` is the closure density mass diagonal; `Dh` is the hydrostatic enthalpy mass diagonal, with replaced surface rows set to one. `Dq` is the raw positive boundary mass diagonal, without an operator-fitted coefficient or EOS/rotation-dependent stiffness. [default selection](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/material_surface.cppm:677), [action](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/material_surface.cppm:995), [diagonals](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/material_surface.cppm:1423), [surface assembly](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/material_surface.cppm:1439).
2. **Gravity is approximate LDU.** The mixed flux mass inverse is a degree-5 matrix-free Chebyshev action with 20 power iterations at setup; the positive potential-Schur surrogate is `B diag(Mg)^-1 B^T`, inverted approximately with three fixed BoomerAMG cycles. Gravity recovery makes two mass-inverse applications. Note that the Schur surrogate continues to use the mass DIAGONAL even though flux recovery uses the more accurate Chebyshev approximation; this is a deliberate approximation, not an exact factorization. [default](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/stellar_structure.cppm:851), [LDU](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/gravity_field.cppm:271), [surrogate](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/preconditioning/gravity_field.cpp:68), [fixed AMG](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/backend_implementations.cppm:47).
3. **Material/surface and gravity are independent before scalar bordering.** Their cross-couplings are available, but the default calls each subsystem inverse separately. A small dense border Schur `S = D-C Atilde^-1 B` is assembled by probing every scalar border column and inverted directly. For the stationary default the already-computed `W=Atilde^-1 B` is cached and used for recovery. This border is exact relative to the selected approximate structure inverse, not the exact stellar Jacobian. [independent action](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/stellar_structure.cppm:347), [border construction](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/specification_border.cppm:2333), [cached recovery](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/specification_border.cppm:2285).
Other available policies are material/surface LDU, reverse triangular order, calibrated surface mass, fitted surface mass-plus-stiffness, and both stellar cross-coupling triangular orders/LDU. Availability is not evidence of quality for rotating models.
Lifecycle checks are substantial: stale gravity and material inverses are rejected; changes to geometry rebuild their relevant diagonals and gravity surrogate. Material thermodynamic diagonals are reused when geometry is unchanged because the rho–rho and h–h derivatives are mass operators; the EOS derivative resides in a separately prepared live coupling. This reuse is not, by itself, evidence of a stale high-n EOS approximation. [material refresh](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/material_surface.cppm:1328), [gravity refresh](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/preconditioning/gravity_field.cppm:536), [closure density diagonal](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_barotropic_closure.cpp:705).
## Normalization: what is and is not established
Physical scales are derived from fixed target mass, branch reference radius, and G: rho*=M/R³, g*=GM/R², h*=GM/R, Omega*=sqrt(GM/R³), J*=M sqrt(GMR), F*=GM²/R². Neither target J nor Omega enters a denominator; zero rotation is not singular in these scale formulas. [scale derivation](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/normalization/physical_riesz.cppm:95).
The Gram diagonals are reference finite-element volume mass diagonals for rho,h,Phi; reference RT mass diagonal for g; and a boundary mass diagonal for q. For a field block with scale s and diagonal d, state normalization is `sqrt(d)/s`, while weak residual normalization is `1/(s sqrt(d))`. Replaced pressure-surface enthalpy rows use point metric one; generated scalar constraints use metric one. The central-density residual is correctly classified as an enthalpy residual, despite its density target. [assembly and block assignment](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/normalization/stellar_equilibrium.cppm:513), [factor formulas](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/normalization/operators.cppm:325), [hybrid rows](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/normalization/operators.cppm:247), [scalar dimensional declaration](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/models/specifications.cppm:772).
These maps are frozen throughout Newton unless explicitly refreshed. They do not adapt to central concentration, EOS derivatives, effective surface gravity, or rotation. They define the merit/Krylov norm; they are not a Jacobian approximation. Reference exterior weighting is a computational norm choice and does not by itself mean the exterior must be physically accurate everywhere. The important diagnostic is whether exterior residuals consume the solve budget while interior structure and virial balance are already accurate.
Let physical state `x=R xhat`, residual `Fhat=L F`, and physical approximate inverse `P^-1`. The wrappers implement exactly `Jhat=LJR` and `Phat^-1=R^-1 P^-1 L^-1`. Therefore
`Jhat Phat^-1 = L (J P^-1) L^-1`.
This is an especially useful diagnostic inference: **changing only state scaling cancels from the consistently right-preconditioned Krylov operator in exact arithmetic.** Row scaling changes the Euclidean residual geometry and nonlinear merit; it does not remove an actual null direction. A claim that variable scaling alone fixes the present solver would require an identified finite-precision or inconsistent-transform mechanism. [Jacobian wrapper](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/normalization/operators.cppm:398), [inverse wrapper](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/normalization/operators.cppm:571).
The source includes round-trip, scaled-operator, synthetic conditioning, and direct-versus-assembled Gram diagonal tests. They establish algebra and assembly expectations when run; they do not establish mesh-independent merit weighting for every n/rotation or full physical-unit invariance. Raw reference measures are used without total-volume/area normalization, surface point rows are counted individually, and the phase border is inserted directly into a weak enthalpy coefficient. Before making broad claims about dimensional invariance, test a physically equivalent length/mass unit change through the complete discretization, not only the characteristic-scale formulas. This is an audit gap, not demonstrated causation of the plateau at the current fixed units.
## Existing numerical evidence: historical, not a new convergence experiment
The September 3 campaign is explicitly a **nonrotating n=3 projected Lane–Emden seed**. Its full-system results precede the current normalized Newton stack. Surface-first, uncalibrated mass and independent stellar subsystems won the available full-system comparisons. Scalar surface calibration and material LDU improved isolated solves but did not transfer to the complete operator; the surface action varied over approximately three orders of magnitude across sampled modes. The fitted H1 mass-plus-stiffness surrogate was also unreliable. [campaign](/Users/tboudreaux/Programming/4DSTAR/MeanField/docs/preconditioning_campaign_2026-09-03.md:5).
Chebyshev-5/AMG-3 achieved true relative residual 1.19e-4 after a 36-iteration fixed-budget manufactured full-system solve; the historical residual was 93.8% gravity-gradient and 6.2% Poisson by squared norm. However, a physical RHS experiment with restart 20 stagnated near relative residual 0.9998 after 48 iterations, motivating equation normalization and restart studies. These are strong reasons to test actual physical RHSs and recompute true residuals, but cannot be presented as measurements of today's normalized plateau. [campaign results](/Users/tboudreaux/Programming/4DSTAR/MeanField/docs/preconditioning_campaign_2026-09-03.md:56).
## Hypotheses to discriminate, without changing the algorithm
1. **Global coupled modes are poorly represented by independent structure blocks.** The code omits the rho→gravity→h and shape↔gravity feedback loops from its principal approximate inverse; the scalar Schur inherits those omissions. High n changes the strength and localization of these loops. This is a strong structural hypothesis, but there is no present proof that it dominates a recorded plateau. Test the physical Newton RHS at one frozen plateau with identical total Jacobian budgets and longer restart; record which residual blocks remain. Only after diagnosis compare opt-in cross-factorization policies, using true residual reduction per time. Earlier stronger coupling policies were worse, so “more coupling” alone is not a recommendation.
2. **Surface restoring action becomes poorly matched by the raw surface mass diagonal.** Default Dq has no state-dependent stiffness, whereas the true surface residual contains material, gravity, and rotation dependence. This is particularly plausible approaching mass shedding, but cannot explain a low-rotation threshold without state-specific mode evidence. Probe smooth radial, oblate quadrupole, and a few high-frequency surface modes through the full normalized Jacobian and approximate inverse; include induced material/gravity completion when interpreting a surface Schur mode. Do not extrapolate isolated Aqq tuning to the coupled model.
3. **Nonlinear admissibility rather than linear conditioning can control high-n progress.** For n=1, dρ/dh is constant. For n>1 it tends to zero as h→0, and the closure's preparation rejects any negative h at its quadrature points. The standalone EOS itself clips negative h to zero, so merely inspecting its public formula misses this solver-domain restriction. Record minimum h, trial failure source, step length, and predicted versus actual reduction. Repeated h-domain rejection with accurate linear solves would rank this above preconditioner tuning. [EOS derivative](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/eos/polytropic.cppm:142), [closure rejection](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/impl/operators/prepared_barotropic_closure.cpp:627).
4. **Frozen residual weighting can make the reported plateau differ from the physical milestone.** Separate full normalized norm, each normalized block norm, interior gravity defects, and virial error. If almost all remaining norm is exterior gravity while virial/interior quantities satisfy their tolerances, the computational stopping target may be the issue. If virial remains bad, exterior inaccuracies cannot simply be dismissed: their influence on interior gravity must be assessed.
5. **Border/constraint compatibility needs explicit measurement.** Fixed-central-density adds `lambda_c e_c` to the weak enthalpy equation, alongside its phase condition; a small total residual does not imply the unmodified hydrostatic equation if lambda_c is appreciable. Export lambda_c, its actual normalized contribution, the tiny approximate Schur matrix, and its singular values in normalized coordinates. A well-conditioned approximate border Schur does not prove the exact coupled system is well-conditioned. [central border](/Users/tboudreaux/Programming/4DSTAR/MeanField/libmeanfield/interface/operators/prepared_central_density.cppm:72).
## Economical frozen-state instrumentation
At every accepted state, report `||F||`, normalized block norms, true `||J dx+F||/||F||`, solver-reported residual, iteration/restart count, accepted alpha, rejection reasons, minimum h/rho/Jacobian determinant, virial balances, mass/J errors, and phase-border contribution. Two Jacobian finite-difference directions (actual Newton direction and an oblate/shape direction), with several step sizes that remain admissible, would separate an inconsistent derivative from a poor solve.
Public access through the default context is available without editing production code:
```cpp
state.physicalInverse->Refresh(); // only when the physical problem is prepared
const auto &grouped = state.physicalInverse->GetGroupedPreconditioner();
const auto &S = grouped.GetFactorization().GetSchurComplement();
const auto &structure = grouped.GetStructurePreconditioner();
const auto &material = structure.GetMaterialSurfacePreconditioner();
const auto &gravity = structure.GetGravityPreconditioner();
const auto &coordinates = state.physicalInverse->GetCoordinateMap();
const auto &normalization = state.normalizedOperator->GetNormalization();
mfem::Vector L(state.physicalInverse->Height());
mfem::Vector V(state.physicalInverse->Height());
coordinates.PackResidual(normalization.ResidualFactors(), L);
coordinates.PackCorrection(normalization.StateFactors(), V);
const int start = grouped.GetCouplings().StructureSize();
mfem::DenseMatrix Shat(S.Height(), S.Width());
for (int i=0; i<S.Height(); ++i)
for (int j=0; j<S.Width(); ++j)
Shat(i,j) = L(start+i) * S(i,j) / V(start+j);
```
Compute SVD of `Shat`, not raw dimensional `S`. This is tiny and cheap; serial runs avoid distributed scalar ownership complications. Exporting the entries for external SVD is sufficient. Material diagonal min/max/floor/regularized-count getters are already public, as are gravity mass inverse, potential Schur surrogate, and factorization statistics. The current context refreshes the inverse during `PrepareTrialCommit`, and `WithState` requires a ready context, so the final accepted-state Schur is current. An explicit no-op refresh in an independent diagnostic remains harmless; preparations performed outside the context must respect the lifecycle.
The later experiment-only helper [preconditioner_diagnostics.hpp](/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/diagnostics/preconditioner_diagnostics.hpp) implements these exports plus a variable-scaling invariance check and full-Jacobian actions on border-completed directions. It does not change state, instantiate alternate preconditioner policies, or solve any extra equations. Its expected cost is three Jv plus one Jv per generated scalar border coordinate. Compilation and execution are coordinated by the root task.
No hypothesis above is presented as the established cause before the root task's new runs are available. Virial <=1e-5 is the primary model acceptance milestone; pointwise interior accuracy and checks for nonphysical constraint forcing remain necessary companions. Exterior error is relevant through interior gravitational influence and numerical conditioning, not as an independent accuracy target.

View File

@@ -0,0 +1,6 @@
{
"files": 6228,
"bytes": 12468217917,
"failed_paths": [],
"all_preserved": true
}

View File

@@ -0,0 +1,44 @@
[
{
"target": "tests",
"source_path": "/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/cmake-build-release-homebrew/tests",
"sha256": "5046f9436a4610321721b025438723619e9a2814907f9f86f7d373021a7f5819",
"bytes": 35593464
},
{
"target": "sandbox",
"source_path": "/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/cmake-build-release-homebrew/sandbox",
"sha256": "a9fb62fe13b0a35f652ad89f4beb90472c1235768cda2ba8ad8d8fc1654a568f",
"bytes": 18955752
},
{
"target": "plateau_diagnostic",
"source_path": "/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/cmake-build-release-homebrew/plateau_diagnostic",
"sha256": "dd253e6b6714108ba9edfb4dd940b433f0b439689ac0d17b21b3c3b1b133f6e6",
"bytes": 46059376
},
{
"target": "density_order_contract_tests",
"source_path": "/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/cmake-build-release-homebrew/density_order_contract_tests",
"sha256": "eddd993c0dd5d3db8b03de37aaf63dee217efee6c443d69d93b3ba288093fd54",
"bytes": 23341376
},
{
"target": "continuation_contract_tests",
"source_path": "/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/cmake-build-release-homebrew/continuation_contract_tests",
"sha256": "be55b8c29f2812d668c7bf2a8737fe1397dc5e93a825e94f1946987aa79c0b95",
"bytes": 24261896
},
{
"target": "surface_border_schur_contract_tests",
"source_path": "/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/cmake-build-release-homebrew/surface_border_schur_contract_tests",
"sha256": "073072ce770fdbb4582324ce0d0722f05087387160dfc7b70ef97d9528685d5b",
"bytes": 4078128
},
{
"target": "mpi_tests",
"source_path": "/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/cmake-build-release-homebrew/mpi_tests",
"sha256": "5a20e0d39f275b1c613ad6986ee0051da72e9ab84a711ad9771c57b8a935c0bd",
"bytes": 21886648
}
]

View File

@@ -0,0 +1,57 @@
{
"source_sha256": "c1ae24fcb31de984df425ffd43dd35b708a1f4d237aeba47a5abe9c8c1f14944",
"commands": [
{
"command": [
"/opt/homebrew/bin/pandoc",
"--from=latex",
"--to=gfm-tex_math_gfm+tex_math_dollars",
"--standalone",
"--toc",
"--toc-depth=2",
"--lua-filter=pandoc_tables.lua",
"--wrap=none",
"--output=MeanField_research_handoff_2026-09-20.md",
"MeanField_research_handoff_2026-09-20.tex"
],
"returncode": 0,
"seconds": 0.22621400002390146
},
{
"command": [
"/opt/homebrew/opt/python@3.14/bin/python3.14",
"check_report_conversion.py",
"--output",
"/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/working/report_builds/research_handoff/conversion_audit.json"
],
"returncode": 0,
"seconds": 1.092888499959372
},
{
"command": [
"/Library/TeX/texbin/latexmk",
"-pdf",
"-interaction=nonstopmode",
"-halt-on-error",
"-outdir=/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement/working/report_builds/research_handoff",
"MeanField_research_handoff_2026-09-20.tex"
],
"returncode": 0,
"seconds": 2.525557457935065
}
],
"outputs": {
"MeanField_research_handoff_2026-09-20.tex": {
"sha256": "c1ae24fcb31de984df425ffd43dd35b708a1f4d237aeba47a5abe9c8c1f14944",
"bytes": 195299
},
"MeanField_research_handoff_2026-09-20.md": {
"sha256": "437df6b7c636ebf0f59c17d350e94e0d7c825a5118310f25151637430c3f2f74",
"bytes": 195388
},
"MeanField_research_handoff_2026-09-20.pdf": {
"sha256": "76aa581492d4d4a135de0c6294621c8c08ff7dbde54038f56bf0269293b795aa",
"bytes": 1513961
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
{
"pdf_pages": 57,
"rendered_pages": 57,
"visually_reviewed_pages": 57,
"inspection": "Contact sheets for all pages, with individual-page checks of the final validation section; earlier individual checks of dense figures/tables retained in the build archive.",
"clipping_or_overlap_found": false,
"overfull_boxes_or_undefined_references": false,
"pdf_sha256": "76aa581492d4d4a135de0c6294621c8c08ff7dbde54038f56bf0269293b795aa",
"conversion_audit": "conversion_audit.json",
"build_manifest": "build_manifest.json",
"preview_archive": "working/report_builds/research_handoff/qa_final/"
}

View File

@@ -0,0 +1,21 @@
{
"command": [
"/opt/homebrew/bin/cmake",
"--build",
"cmake-build-release-homebrew",
"--parallel",
"2",
"--target",
"tests",
"sandbox",
"plateau_diagnostic",
"density_order_contract_tests",
"continuation_contract_tests",
"surface_border_schur_contract_tests",
"mpi_tests"
],
"cwd": "/Users/tboudreaux/.codex/.chatgpt-projects/g-p-6a6b3f2194ec8191bebcd59075897f1d/worktrees/preconditioner-improvement",
"source_commit": "b1fe3597607d70714e4f575fa14fe848532d8d4b",
"returncode": 0,
"seconds": 1324.310720375
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,76 @@
{
"cpp_case_executions": 337,
"cpp_assertions": 9316741,
"python_tests": 157,
"python_initial_skips_subsequently_run": 2,
"smoke_final_F": 1.527145159591774e-12,
"smoke_accepted_updates": 5,
"smoke_q18_virials": {
"enthalpy_virial_error": 3.8703561072645173e-07,
"enthalpy_force_virial_error": 2.659381864724186e-07,
"virial_error": 4.269936529762888e-07,
"force_virial_error": 3.058962287222557e-07
},
"checks": [
[
"mapping_surface_normalization",
"150 cases; 7,224,720 assertions",
794.1818723329343
],
[
"coupled_solver_preconditioner",
"118 cases; 1,369,031 assertions",
1432.0412241660524
],
[
"density_order_contract_tests",
"52 cases; 722,405 assertions",
199.69777812506072
],
[
"continuation_contract_tests",
"8 cases; 515 assertions",
610.431635707966
],
[
"surface_border_schur_contract_tests",
"9 cases; 70 assertions",
0.4409960419870913
],
[
"python_regressions",
"146 tests; 2 initially skipped",
12.31967287498992
],
[
"coupled_artifact_auditor_selftests",
"11 tests",
0.08722191606648266
],
[
"slice_geometry_build",
"completed",
0.875526332994923
],
[
"slice_geometry",
"completed",
0.2547087500570342
],
[
"n3_mass_compatibility",
"completed",
0.9261317920172587
],
[
"n1_harmonic_smoke",
"completed",
210.07539662509225
],
[
"plot_render_contracts",
"2 tests",
11.042002792004496
]
]
}

File diff suppressed because it is too large Load Diff

45
reports/verify_archive.py Normal file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/env python3
"""Verify preserved artifacts against the original relocation inventory."""
from pathlib import Path
import argparse
import hashlib
import json
import os
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--repository', type=Path,
default=Path(__file__).resolve().parents[1])
args = parser.parse_args()
records = json.loads((Path(__file__).resolve().parent /
'archive/move_manifest.json').read_text())
original = Path('/Users/tboudreaux/Programming/4DSTAR/MeanField')
failures, count, size = [], 0, 0
for move in records['moves']:
destination = args.repository / Path(move['destination']).relative_to(original)
for item in move['entries']:
path = destination if item['path'] == '.' else destination / item['path']
if item['kind'] == 'directory':
good = path.is_dir() and not path.is_symlink()
elif item['kind'] == 'symlink':
good = path.is_symlink() and os.readlink(path) == item['target']
else:
count += 1
size += item['bytes']
good = path.is_file() and not path.is_symlink()
if good:
digest = hashlib.sha256()
with path.open('rb') as stream:
for block in iter(lambda: stream.read(1024 * 1024), b''):
digest.update(block)
good = path.stat().st_size == item['bytes'] and digest.hexdigest() == item['sha256']
if not good:
failures.append(str(path))
print(json.dumps({'files': count, 'bytes': size, 'failed_paths': failures,
'all_preserved': not failures}, indent=2))
raise SystemExit(bool(failures))
if __name__ == '__main__':
main()

32
working/README.md Normal file
View File

@@ -0,0 +1,32 @@
# Local research workspace
This directory holds preserved local evidence and future working outputs. Raw data
are intentionally excluded from Git; no archived result was deleted during the
20 September 2026 consolidation. The source, experiment manifests, reports,
selected figures and relocation/hash inventory are versioned.
| Location | Contents |
|---|---|
| `research/diagnostics/` | Complete 16–19 September campaigns, copied executables, snapshots, logs, physical diagnostics and original provenance |
| `legacy_results/` | Earlier profiling, validation, geometry and preconditioning output directories |
| `legacy_results/tables/` | Earlier loose CSV files |
| `legacy_misc/` | Source ZIPs, patches, old test output, unused package placeholders and local helper scripts |
| `legacy_documents/prior/` | Unmodified original optimization report source and PDF; versioned copies also live in `reports/prior/` |
| `report_builds/prior/` | Preserved auxiliary files from the earlier LaTeX report |
| `report_builds/research_handoff/` | Build logs and temporary rendering output for the consolidated report |
| `consolidation_2026-09-20/` | Validation and audit records for consolidation |
The old project-workspace `diagnostics` path is a compatibility symlink to
`research/diagnostics/`, so recorded absolute snapshot paths remain usable on this
machine. For transfer to another machine, copy this directory and rebase the
paths in a **new** campaign manifest; do not rewrite original provenance.
Existing `cmake-build-*` trees remain at their original paths because CMake and
C++ module caches bind to absolute source/build locations. They are now ignored
by Git. Git-managed research worktrees and all hypothesis branches are also
retained. Local IDE/tool configuration remains in place.
See `../reports/archive/move_manifest.json` for every moved file's original and
new location, byte count and SHA-256. `../reports/branch_consolidation.md` records
the disposition of the research branches. Files under the ChatGPT project's
synced `sources/` directory were not changed or relocated.