Update numerical strategy documentation with verified evidence
This commit is contained in:
@@ -22,6 +22,8 @@ The direct inverse capability recognizes the standard normalized physical precon
|
|||||||
|
|
||||||
`plateau_gravity_application_diagnostics.hpp` supplies `plateau_diagnostics::ProbeGravityApplications(subsystem, outputDirectory)`. Call after preparing the full normalized operator, refreshing its inverse, and preparing/refreshing the subsystem. It writes `gravity_applications.csv` with three deterministic nontrivial global directions, selected paths, relative/absolute compact-versus-full errors, and separate application times. It neither prepares a candidate nor changes accepted state. The reference policy also allows direct solve comparisons outside the probe. `check_numerical_strategies.py` automatically checks this CSV when present; `--require applications` explicitly requires it. Its default-fixture operator/inverse comparison uses `error <= 2e-12 * max(1, reference_norm)` and rejects nonfinite measurements. Fallback paths are reported without failing selection.
|
`plateau_gravity_application_diagnostics.hpp` supplies `plateau_diagnostics::ProbeGravityApplications(subsystem, outputDirectory)`. Call after preparing the full normalized operator, refreshing its inverse, and preparing/refreshing the subsystem. It writes `gravity_applications.csv` with three deterministic nontrivial global directions, selected paths, relative/absolute compact-versus-full errors, and separate application times. It neither prepares a candidate nor changes accepted state. The reference policy also allows direct solve comparisons outside the probe. `check_numerical_strategies.py` automatically checks this CSV when present; `--require applications` explicitly requires it. Its default-fixture operator/inverse comparison uses `error <= 2e-12 * max(1, reference_norm)` and rejects nonfinite measurements. Fallback paths are reported without failing selection.
|
||||||
|
|
||||||
Recommended bounded real checks: run the helper once on the frozen n=1.5 fixture and once on a fixture with the central-density border; repeat the smaller viable fixture on two ranks. Require operator relative error near floating-point roundoff, then inspect inverse equivalence and timings separately. Run both compact and reference inner solves at the same true-defect tolerance before interpreting speed or iteration changes. The frozen strategy probe's existing inner report already carries operator/inverse application times; expose those alongside `UsesCompactOperator()` and `UsesCompactPreconditioner()` when recording campaign results.
|
The integration campaign compiled and passed the compact mock tests in serial and on two ranks, and the real-FEM serial comparisons both with and without the central-density border. The frozen n=1.5 helper measured exactly zero operator and inverse output differences for all three dense directions. On that fixture compact operator applications took about 0.018 seconds versus 0.244 seconds for the root reference; inverse applications took about 0.160 versus 0.205 seconds. The first matched gravity solve took 7.25 seconds versus 18.36 seconds before the compact change, with the same 40 iterations and numerical result at the same true-defect tolerances. These are fixture measurements, not universal speedup guarantees.
|
||||||
|
|
||||||
At the time of this implementation commit, the new C++ tests and real-FEM comparison helper await the root-coordinated build/run. No performance or stellar-physics acceptance is claimed from the algebraic tests. End-to-end models continue to require the existing strict convergence and virial checks.
|
`gravity_applications.csv` records selected paths and separate operator/inverse application times. The backend's `LinearSolveReport` also has application timing fields, but the current `numerical_strategy_inner.csv` records only aggregate inner solve time. Neither per-application speedup nor aggregate inner timing alone measures a complete Newton step; reduced outer work also includes full-system actions.
|
||||||
|
|
||||||
|
Full stellar MPI comparisons remain unvalidated: the larger two-rank integration selection encountered the existing logical radial surface interpolation restriction to one rank. Low-level distributed application and collective-fallback tests passed. The measured default inverse equivalence does not establish equivalence for arbitrary custom compact preconditioners. End-to-end models continue to require the existing strict convergence and virial checks.
|
||||||
|
|||||||
@@ -61,9 +61,14 @@ the original Newton equations.
|
|||||||
Three focused tests, appended to `tests/solver/gravity_reduction.cpp`, cover
|
Three focused tests, appended to `tests/solver/gravity_reduction.cpp`, cover
|
||||||
large cancelling contributions, rejection of defects beyond either gate,
|
large cancelling contributions, rejection of defects beyond either gate,
|
||||||
nonfinite measurements, and scaling over twenty-four orders of magnitude.
|
nonfinite measurements, and scaling over twenty-four orders of magnitude.
|
||||||
The real stellar rejection must still be reproduced and reassessed; passing a
|
All three passed with 28 assertions in serial and 28 assertions per rank on two
|
||||||
synthetic arithmetic test alone establishes neither the hypothesis nor stellar
|
ranks. The subsequent production n=1, J=0 curvature control converged and passed
|
||||||
convergence.
|
all eight virial checks, with no prepared-consistency failure. The n=1.5, J=0
|
||||||
|
curvature run likewise had no prepared-consistency failures: all 14 auxiliary
|
||||||
|
gravity solves passed, but the outer linear iteration cap stopped the model
|
||||||
|
before nonlinear convergence. These runs reassess the original auxiliary
|
||||||
|
rejection; the synthetic arithmetic tests alone do not establish stellar
|
||||||
|
convergence or validate the estimate as a rigorous error bound.
|
||||||
|
|
||||||
|
|
||||||
## Reporting regression
|
## Reporting regression
|
||||||
|
|||||||
@@ -35,8 +35,9 @@ equations rather than silently dropped. These formulas require an invertible
|
|||||||
gravity block; they do not regularize a singular full stellar problem or remove
|
gravity block; they do not regularize a singular full stellar problem or remove
|
||||||
the n=3 homology.
|
the n=3 homology.
|
||||||
|
|
||||||
The production gravity subsystem owns its inner backend and restricted full
|
The production gravity subsystem owns its inner backend and selected gravity
|
||||||
inverse. The reduced operator borrows it, allocates workspaces once, and checks
|
preconditioner, using a supported compact action or full-root restriction.
|
||||||
|
The reduced operator borrows it, allocates workspaces once, and checks
|
||||||
its preparation generation through `IsCurrent()` before and after actions. Each
|
its preparation generation through `IsCurrent()` before and after actions. Each
|
||||||
inner solve starts from zero to avoid importing a previous Krylov direction into
|
inner solve starts from zero to avoid importing a previous Krylov direction into
|
||||||
the next action. A successful backend report is checked against the requested
|
the next action. A successful backend report is checked against the requested
|
||||||
@@ -65,9 +66,10 @@ has only approximately completed gravity.
|
|||||||
|
|
||||||
An action costs one gravity solve and two full Jacobian applications outside the
|
An action costs one gravity solve and two full Jacobian applications outside the
|
||||||
inner solve. Projection preconditioning costs one full inverse application.
|
inner solve. Projection preconditioning costs one full inverse application.
|
||||||
This first implementation deliberately reuses existing operators and inverses;
|
The compact gravity applications reduce work inside the inner solve; they do
|
||||||
its cost should be measured before replacing them with specialized gravity
|
not remove these surrounding full-system actions. The measured improvement to
|
||||||
kernels. All scratch vectors persist across applications. Objects borrow stable
|
one inner solve therefore does not establish a cheaper reduced outer step.
|
||||||
|
All scratch vectors persist across applications. Objects borrow stable
|
||||||
addresses, are not reentrant, and must not outlive their prepared subsystem or
|
addresses, are not reentrant, and must not outlive their prepared subsystem or
|
||||||
full inverse.
|
full inverse.
|
||||||
|
|
||||||
@@ -90,7 +92,11 @@ The focused test source `tests/solver/gravity_reduction.cpp` covers:
|
|||||||
|
|
||||||
These algebraic tests establish the reduction contract. They do not establish
|
These algebraic tests establish the reduction contract. They do not establish
|
||||||
FEM convergence, a faster implementation, or an additional virial-qualified
|
FEM convergence, a faster implementation, or an additional virial-qualified
|
||||||
stellar equilibrium; those require the integrated runtime experiments.
|
stellar equilibrium. Separately, the integrated serial n=1, J=0 reduced control
|
||||||
|
converged in six full steps and passed all eight virial checks, but took longer
|
||||||
|
than the curvature control. Supported low-level two-rank tests passed; full
|
||||||
|
stellar MPI operation remains unvalidated because of the existing single-rank
|
||||||
|
logical radial surface interpolation restriction.
|
||||||
|
|
||||||
## Resolved FEM difference sampling
|
## Resolved FEM difference sampling
|
||||||
|
|
||||||
@@ -110,8 +116,11 @@ two-correction completion budget. The inner tolerance, prepared completion gate,
|
|||||||
and checker thresholds are unchanged. There is no assumption that larger steps
|
and checker thresholds are unchanged. There is no assumption that larger steps
|
||||||
will prepare successfully or automatically pass the trend check.
|
will prepare successfully or automatically pass the trend check.
|
||||||
|
|
||||||
These remain finite-range empirical derivative checks. The recorded arithmetic
|
The updated frozen n=1.5 probe passed all 124 algebraic and invariant checks.
|
||||||
scale is heuristic, and a gravity residual bound by itself is not a bound on its
|
Absolute central-difference errors on that grid were approximately `1.7784e-7`,
|
||||||
amplified effect in the retained equations. The larger grid is intended to
|
`1.5987e-8`, `1.7761e-9`, and `1.9661e-11`, resolving the expected second-order
|
||||||
resolve a measurable trend without claiming such an unmeasured amplification
|
trend without relaxing thresholds. These remain finite-range empirical
|
||||||
bound or interpreting floor-limited differences as derivative failures.
|
derivative checks. The recorded arithmetic scale is heuristic, and a gravity
|
||||||
|
residual bound by itself is not a bound on its amplified effect in the retained
|
||||||
|
equations. The result establishes no such unmeasured amplification bound and
|
||||||
|
does not reinterpret floor-limited differences as derivative failures.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ gravity and retained local systems must be square. A globally empty gravity
|
|||||||
system is rejected by the prepared linear backend. Gather/injection require
|
system is rejected by the prepared linear backend. Gather/injection require
|
||||||
preallocated, nonoverlapping storage.
|
preallocated, nonoverlapping storage.
|
||||||
|
|
||||||
`PreparedGravitySubsystem` owns restricted operator/inverse workspaces and the
|
`PreparedGravitySubsystem` owns gravity operator/preconditioner workspaces and the
|
||||||
existing prepared linear backend. It borrows the full normalized operator,
|
existing prepared linear backend. It borrows the full normalized operator,
|
||||||
inverse, and communicator at stable addresses. It is neither movable nor
|
inverse, and communicator at stable addresses. It is neither movable nor
|
||||||
copyable. Preparation records the root preparation generation. After candidate
|
copyable. Preparation records the root preparation generation. After candidate
|
||||||
@@ -26,15 +26,17 @@ the subsystem; stale applications and solves fail. The subsystem does not
|
|||||||
prepare a candidate, change an accepted state, or commit a step.
|
prepare a candidate, change an accepted state, or commit a step.
|
||||||
|
|
||||||
The exact gravity action is the principal restriction of the root Jacobian.
|
The exact gravity action is the principal restriction of the root Jacobian.
|
||||||
The preconditioner is the corresponding restriction of the supplied root
|
The default automatic policy uses the existing compact physical gravity action
|
||||||
inverse. This reuses existing normalization, gravity boundary conditions, and
|
when a declared compile-time capability and collectively checked canonical
|
||||||
preconditioning recipes, but does not assert that the restricted inverse is an
|
partition permit it. Otherwise it injects, applies, and restricts the full root
|
||||||
exact gravity inverse. Every solve retains the backend's independently checked
|
operator. The selected preconditioner similarly uses a supported compact
|
||||||
true-defect gate. Both wrappers preallocate full-vector workspaces; applications
|
physical gravity block or the supplied root inverse's restriction. Neither
|
||||||
perform gather/scatter and the existing root actions without allocating their
|
choice asserts an exact gravity inverse. Both paths retain the same diagonal
|
||||||
own vectors. Full root actions may do unnecessary non-gravity work; a specialized
|
normalization and boundary maps, persistent scratch storage, and the backend's
|
||||||
gravity action/inverse adapter remains a future optimization requiring equality
|
independently checked true-defect gate. `RootRestrictedGravityApplications`
|
||||||
tests against this reference restriction.
|
remains an explicit reference policy. Equality tests and measured application
|
||||||
|
costs are recorded in
|
||||||
|
[`GRAVITY_COMPACT_APPLICATIONS_2026-09-17.md`](GRAVITY_COMPACT_APPLICATIONS_2026-09-17.md).
|
||||||
|
|
||||||
Attempted solves, completed inner iterations, failed calls, completed solve time,
|
Attempted solves, completed inner iterations, failed calls, completed solve time,
|
||||||
and the last completed solve report are available without history allocation.
|
and the last completed solve report are available without history allocation.
|
||||||
@@ -81,5 +83,10 @@ overlapping storage, exact restricted solves, true-defect failure, nonfinite
|
|||||||
inputs, stale operator/inverse preparation, locally empty MPI partitions,
|
inputs, stale operator/inverse preparation, locally empty MPI partitions,
|
||||||
globally empty rejection, preserved backend options, zero affine curvature at
|
globally empty rejection, preserved backend options, zero affine curvature at
|
||||||
an off-manifold base, and the second-order correction at curved trial geometry.
|
an off-manifold base, and the second-order correction at curved trial geometry.
|
||||||
The root integration campaign compiles these components and tests real stellar
|
The integration campaign compiled these components and passed their serial and
|
||||||
states; this branch does not claim a new validated stellar equilibrium.
|
supported two-rank tests, including locally empty partitions. Real stellar
|
||||||
|
serial fixtures also passed compact/reference comparisons with and without the
|
||||||
|
central-density border. Full stellar MPI operation remains unvalidated because
|
||||||
|
the existing logical radial surface interpolation is restricted to one rank.
|
||||||
|
Algebraic tests alone do not establish a virial-qualified stellar equilibrium;
|
||||||
|
the separate model campaign applies the unchanged physical acceptance checks.
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ This changes the enthalpy direction while allowing the stellar strategy to retai
|
|||||||
|
|
||||||
Collective adapter calls must occur in the same order on all ranks. Sign status, polynomial bounds, and repair fraction are globally combined. Witness element indices, coordinates, and work counters remain rank-local. Unequal repair fractions and work budgets are rejected collectively.
|
Collective adapter calls must occur in the same order on all ranks. Sign status, polynomial bounds, and repair fraction are globally combined. Witness element indices, coordinates, and work counters remain rank-local. Unequal repair fractions and work budgets are rejected collectively.
|
||||||
|
|
||||||
Tests cover nodal-positive/interior-negative cubics, a positive polynomial with negative coarse Bernstein coefficients, exact zero faces, very small negative pockets, unresolved tangential zeros, arbitrary runtime degree, nonfinite input, finite-element ordering, true-DOF sharing, invalid bases, immutable failure output, and prescribed trace handling. Integration tests are intended for both one and two MPI ranks.
|
Tests cover nodal-positive/interior-negative cubics, a positive polynomial with negative coarse Bernstein coefficients, exact zero faces, very small negative pockets, unresolved tangential zeros, arbitrary runtime degree, nonfinite input, finite-element ordering, true-DOF sharing, invalid bases, immutable failure output, and prescribed trace handling. The compiled production module passed serial tests and supported low-level two-rank tests. Full stellar MPI operation remains unvalidated because the existing logical radial surface interpolation is restricted to one rank.
|
||||||
|
|
||||||
`PreparedStellarEnthalpyStrategy<State>` resolves the enthalpy block from the compiled form type and captures the initial physical enthalpy as its anchor. Every full-state check denormalizes the state; pointwise positivity is not invariant under a general diagonal Riesz normalization. The strategy minimizes the full normalized linear-residual norm over the sufficient one-dimensional repair interval, verifies the actual normalized root candidate after rounding, and rejects a non-descent result. Unrelated blocks of the normalized correction are retained bit for bit. It does not prepare an operator or change an accepted state. A valid unaltered full candidate costs one Jacobian action for its true merit slope; an altered direction costs three actions (family model plus the actual rounded chosen direction). The anchor's certificate is cached only when coefficients agree exactly on every rank.
|
`PreparedStellarEnthalpyStrategy<State>` resolves the enthalpy block from the compiled form type and captures the accepted physical enthalpy at the start of each `evaluate()` as its anchor. The anchor remains fixed during that evaluation. Every full-state check denormalizes the state; pointwise positivity is not invariant under a general diagonal Riesz normalization. The strategy minimizes the full normalized linear-residual norm over the sufficient one-dimensional repair interval, verifies the actual normalized root candidate after rounding, and rejects a non-descent result. Unrelated blocks of the normalized correction are retained bit for bit. It does not prepare an operator or change an accepted state. A valid unaltered full candidate costs one Jacobian action for its true merit slope; an altered direction costs three actions (family model plus the actual rounded chosen direction). The anchor's certificate is cached only when coefficients agree exactly on every rank.
|
||||||
|
|
||||||
A standalone extraction of the scalar/tensor certification engine was compiled with the system C++20 compiler and exercised before module integration. It certified a strictly positive quadratic with negative coarse coefficients and a three-dimensional zero-face bubble; it proved a negative pocket of depth 1e-10; it returned unresolved for an exact tangential zero. Production module compilation and MPI execution remain part of the integration campaign.
|
A standalone extraction of the scalar/tensor certification engine was compiled with the system C++20 compiler and exercised before module integration. It certified a strictly positive quadratic with negative coarse coefficients and a three-dimensional zero-face bubble; it proved a negative pocket of depth 1e-10; it returned unresolved for an exact tangential zero. The subsequent integrated frozen probes certified the earlier rotating base, detected a negative full trial, and rejected the already-negative late rotating base with `invalid_base` while preserving accepted buffers. The n=1, J=0 polynomial-policy control converged and passed all eight virial checks; feasible repaired rotating candidates in the frozen probe did not pass full residual acceptance.
|
||||||
|
|
||||||
Arithmetic requirements are enforced at compilation: `__FAST_MATH__` and a positive `__FINITE_MATH_ONLY__` are rejected, and static assertions require IEC 559 binary64 with subnormal support. Runtime floating-point modes must retain gradual underflow; the application must not enable flush-to-zero after construction. The existing Release build was inspected: `-O3 -g -DNDEBUG -std=c++23 -flto=thin -arch arm64`; no unsafe floating-point flags were present in the generated build commands.
|
Arithmetic requirements are enforced at compilation: `__FAST_MATH__` and a positive `__FINITE_MATH_ONLY__` are rejected, and static assertions require IEC 559 binary64 with subnormal support. Runtime floating-point modes must retain gradual underflow; the application must not enable flush-to-zero after construction. The existing Release build was inspected: `-O3 -g -DNDEBUG -std=c++23 -flto=thin -arch arm64`; no unsafe floating-point flags were present in the generated build commands.
|
||||||
|
|
||||||
|
|||||||
@@ -80,17 +80,22 @@ Use one numerical process at a time and preserve all capped failures as results.
|
|||||||
| Python checker | Synthetic passing, false-convergence, mutation, missing-data, negative-base, compact/fallback agreement, and NaN records | 30 seconds; standard-library unit tests |
|
| Python checker | Synthetic passing, false-convergence, mutation, missing-data, negative-base, compact/fallback agreement, and NaN records | 30 seconds; standard-library unit tests |
|
||||||
| Positivity frozen states | n=1 J=0.1 captured iteration 2 and iteration 11; a certified seed/control | 10 minutes per probe; iteration 11 must be negative and reject repair with `invalid_base`; no claim that the earlier base is positive before checking it |
|
| Positivity frozen states | n=1 J=0.1 captured iteration 2 and iteration 11; a certified seed/control | 10 minutes per probe; iteration 11 must be negative and reject repair with `invalid_base`; no claim that the earlier base is positive before checking it |
|
||||||
| Gravity curvature | n=1.5 J=0 captured iteration 1 | 15 minutes; alpha = 1, 0.1, 0.01, 0.001; gate fresh remainder cancellation and small-step order |
|
| Gravity curvature | n=1.5 J=0 captured iteration 1 | 15 minutes; alpha = 1, 0.1, 0.01, 0.001; gate fresh remainder cancellation and small-step order |
|
||||||
| Reduced gravity | Same n=1.5 state, plus constrained n=3 saved seed direction | 15 minutes per probe; completion and three central-difference pairs; n=3 direction remains an approximate diagnostic correction |
|
| Reduced gravity | Same n=1.5 state, plus constrained n=3 saved seed direction | 15 minutes per probe; completion and four central-difference pairs; n=3 direction remains an approximate diagnostic correction |
|
||||||
| Regression equilibrium | n=1 J=0 and low-rotation J=0.05 baseline; opt-in strategies individually | Preserve existing nonlinear/linear caps, add a 20-minute wall limit per model; strict solver and all virial gates remain mandatory |
|
| Regression equilibrium | n=1 J=0 and low-rotation J=0.05 baseline; opt-in strategies individually | Preserve existing nonlinear/linear caps, add a 20-minute wall limit per model; strict solver and all virial gates remain mandatory |
|
||||||
| Failure-prone equilibrium | n=1 J=0.1 and n=1.5 J=0, strategies separately before combinations | 8 Newton steps / 20 minutes; report residual progress, auxiliary work, rejection causes, and physical endpoint without equating the cap with convergence |
|
| Failure-prone equilibrium | n=1 J=0.1 and n=1.5 J=0, strategies separately before combinations | 8 Newton steps / 20 minutes; report residual progress, auxiliary work, rejection causes, and physical endpoint without equating the cap with convergence |
|
||||||
|
|
||||||
At the supplied frozen-gravity defaults, there are at most 20 explicitly requested
|
At the supplied frozen-gravity defaults, there are at most 24 explicitly requested
|
||||||
inner solves, each capped at 160 iterations, and at most 36 preparations in the
|
inner solves, each capped at 160 iterations, and at most 42 preparations in the
|
||||||
normal completed path. The maximum covers four curvature corrections, seven
|
normal completed path. The maximum covers four curvature corrections, nine
|
||||||
gravity completions with up to two corrections each, and two reduced actions.
|
gravity completions with up to two corrections each, and two reduced actions.
|
||||||
Rejected preparations can reduce those counts. Root integration controls and
|
Rejected preparations can reduce those counts. Root integration controls and
|
||||||
end-to-end outer solves are separately bounded; their nested work is not covered
|
end-to-end outer solves are separately bounded; their nested work is not covered
|
||||||
by this frozen-probe count.
|
by this frozen-probe count.
|
||||||
|
|
||||||
|
The completed n=1.5 frozen campaign passed all 124 algebraic and invariant
|
||||||
|
checks, including the four-pair resolved central-difference trend and compact
|
||||||
|
application comparisons. The checker regression suite passed 18 Python tests.
|
||||||
|
These results do not replace physical acceptance of an end-to-end model.
|
||||||
|
|
||||||
Treat outer reduced-solve time as inclusive of nested gravity solves. Report the
|
Treat outer reduced-solve time as inclusive of nested gravity solves. Report the
|
||||||
inner counters separately, but do not add the two times as if they were disjoint.
|
inner counters separately, but do not add the two times as if they were disjoint.
|
||||||
|
|||||||
Reference in New Issue
Block a user