1.7/1.8 gap-closure design and traceability record
Status: complete and release-qualified for 1.8.0. Implementation, local qualification, and the required Linux and Windows GitHub Actions checks passed on the release/v1.8.0 branch.
Purpose
Version 1.7.0 is already tagged and must not be rewritten. Version 1.8.0 will therefore close material 1.7 contract and qualification gaps, complete the enforceable 1.8 scope, and publish an accurate account of conditional work that cannot pass the required numerical or platform gates.
This record is the focused design decision required by the roadmap before new public types or storage contracts are introduced. It also prevents a capability from being declared complete merely because a nearby example succeeds.
Interpretation rules
Each roadmap item received one of four opening dispositions before the gap-closing implementation:
complete — implementation, public documentation, and direct tests exist;
must close — unconditional roadmap work or completion-gate evidence is missing or materially overstated;
strengthen — a baseline exists but needs an additional path, diagnostic, adversarial test, or example to support the published claim;
conditional defer — the roadmap explicitly says “where justified”, “where quality can be validated”, “only after”, or “toward”. Deferral is permitted only when the prerequisite or supported-platform evidence is recorded in the capability inventory. It must not be described as stable.
All must close and strengthen rows are release blockers. A conditional row becomes a release blocker if its prerequisite is established during this release and a portable implementation can be qualified on the supported matrix.
Common public contract
The additions below retain the established contracts:
arrays and matrices are zero-indexed;
dense two-dimensional values use [Row, Column];
inputs are borrowed only for the duration of a call and are never mutated or retained unless a constructor explicitly documents that it copies them;
result records, models, factors, interpolants, filters, and trees own their arrays independently;
failure is atomic for caller-visible state and destination buffers;
shape, finite-value, bounds, resource-limit, and callback errors use the owning domain exception;
expected iterative outcomes use TIterationStatus; programmer errors raise;
existing signatures remain source compatible and new detailed entry points are additive;
every randomized API accepts caller-owned TLocalRandom state or an explicit seed and never changes RTL RandSeed;
new persistence formats are versioned, endian-defined, size-limited, and completely validated before constructing or replacing a result.
Focused names and layouts
The following names are approved for the gap-closing implementation. They are additive; no existing record field is reordered or removed.
Modelling and differentiation
dmComplexStep, TComplexScalarVectorFunction, and TDifferentiationKit.ComplexStepGradient provide an explicitly analytic complex callback path. A real callback is never silently treated as complex-analytic.
TDualVectorFunction and AutoJacobian provide the forward-AD vector path.
TJacobianCheckResult and CheckJacobian report the worst output row and input column as well as analytic/reference values and absolute/relative errors.
TSplineBoundaryKind, TCubicSplineInterpolator, TSplineFitResult, and TModellingKit.FitSplineBasis cover natural, clamped, and not-a-knot cubic splines and spline regression. The interpolator exposes read-only Evaluate, Derivative, SecondDerivative, Antiderivative, and Integrate operations and clamps evaluation to the documented knot interval like the existing cubic types. Spline regression uses the cubic truncated-power basis [1,x,x²,x³,max(0,x-k[0])³,...]; the result owns the interior knots and fit diagnostics and exposes Evaluate.
TPolynomialRootResult owns complex roots and per-root residuals and reports a TIterationStatus, iterations, and evaluations. TModellingKit.SolvePolynomial accepts finite coefficients in ascending power order with a non-zero highest coefficient. It returns every complex root sorted lexicographically by real then imaginary part; no real-only filtering is permitted.
TModellingKit.IntegrateCubature uses a tensor-product Gauss-Legendre rule of order 3 or 5 with an explicit evaluation cap. It targets low-dimensional smooth boxes only.
TModellingKit.IntegrateMonteCarlo accepts caller-owned TLocalRandom state, returns a sample-standard-error estimate, and commits the advanced RNG state only after every callback result has been validated.
Existing TOptResult gains appended Evaluations, BestX, and BestFVal fields. Existing fields and objective conventions are unchanged.
Existing TConvexResult gains appended BestX, BestObjective, and Certificate fields. The first two own the best finite feasible iterate observed. Certificate is empty for ordinary outcomes and owns a unit-length recession direction when the QP solver can prove an unconstrained positive-semidefinite model unbounded. Constrained QP infeasibility is reported by status and feasibility residual; no unsupported dual-certificate claim is made.
New detailed optimizers use TOptimizationOptions and return TOptResult. Bounds are optional copied arrays; progress callbacks are synchronous. The approved entry points are NonlinearConjugateGradient, BoundedLBFGS, TrustRegion, LBFGSAuto, and MultiStart. TOptimizationOptions owns no caller arrays; each call copies bounds and initial points into local state. It carries absolute, relative and gradient tolerances, iteration/evaluation limits, initial step/trust radius, L-BFGS history, deterministic seed, start count, and a cancellation callback.
TOptimizationWorkspace owns an optional warm-start point plus cumulative run/evaluation counters. BoundedLBFGSWithWorkspace uses a matching stored point on subsequent calls and commits the new best point only after the solve returns; Clear drops reusable state. Quasi-Newton curvature history is not reused across distinct objectives.
TSmoothConstraint stores a borrowed value callback, optional analytic gradient, equality/inequality kind, and feasibility tolerance. SolveConstrained returns the best finite iterate and explicit maximum feasibility rather than representing feasibility only through a penalty objective.
TMultiObjectiveResult owns a deterministic collection of nondominated TOptResult points and their objective vectors. ExplorePareto accepts an explicit weight grid and makes no claim to find a complete non-convex front.
TModellingKit.FitNonlinearAuto, SolveSystemAuto, and TOptimizationKit.LBFGSAuto are the explicit forward-AD solver paths. Existing entry points continue to select analytic callbacks when supplied and central numerical derivatives when they are absent.
TNonlinearFitOptions.ParameterScales is an optional copied positive vector. Internally the LM step is solved in scaled coordinates while public parameters, bounds, residuals, and covariance remain in original units. Nonlinear covariance is returned only for squared loss, positive residual degrees of freedom, and a full-column-rank final Jacobian.
TAdaptiveODEOptions.AbsoluteTolerances is an optional copied per-component vector. When present it replaces the scalar absolute tolerance in each component's embedded-error scale; relative tolerance remains shared.
Applied numerics
DSP additions remain on TDSPKit; batch results are arrays of the existing shared complex arrays. Overlap-add/save plans copy their impulse response and retain at most one documented block of state.
TOverlapAddConvolver and TOverlapSaveConvolver copy the impulse response, return one causal output sample for each input sample, and expose copied tail/history state for failure-atomic restoration. Flush is specific to overlap-add and returns the remaining convolution tail while clearing it. TComplexBatch and TSingleComplexBatch contain independently owned shared complex arrays; TransformBatch preserves batch boundaries and precision. HaarTransform is the orthonormal power-of-two wavelet baseline and uses the same entry point with Inverse=True for reconstruction.
Statistical additions live in StatsLib.Inference. Distribution models, estimates, test results, and regression diagnostics are value records owning their arrays.
TNormalDistribution, TExponentialDistribution, and TBinomialDistribution provide paired density/mass, CDF, survival, log-density/mass, quantile, and caller-owned-RNG sampling operations. TDistributionEstimate reports owned parameters and standard errors, log-likelihood, iteration status, and identifiability for EstimateNormal, EstimateExponential, EstimateGamma, and EstimateBinomial.
TInferenceTestResult, TANOVAResult, and TContingencyResult are the result contracts for one-sample/paired/Welch t tests, one-way ANOVA, chi-square contingency analysis, and Mann-Whitney analysis with average ranks and tie correction. AdjustBonferroni and AdjustBenjaminiHochberg return owned arrays and preserve input ordering.
TRegressionDiagnostics and TLogisticRegressionResult own coefficients, standard errors, fitted values, and residuals/probabilities. FitOLS uses the shared SVD least-squares foundation and explicitly reports rank and degrees of freedom. FitLogistic uses bounded IRLS, reports convergence, and marks complete/quasi separation as non-identifiable rather than returning an unqualified fit.
Higher-level analysis additions remain in MLLib.Analysis. Hierarchical clustering and decision forests own training-derived state and never retain the input matrix handle.
THierarchicalLinkage, THierarchicalClustering, HierarchicalCluster, and CutHierarchy define a deterministic Euclidean agglomerative baseline with single, complete, and average linkage. Merge indices follow the usual leaf-first convention (0..N-1 observations, then N..2N-2 merges).
TStandardizationModel, FitStandardization, and TransformStandardized separate fitting from transformation so validation rows cannot influence training means/scales. Non-finite and categorical values remain rejected; callers must impute/encode them explicitly.
TDecisionForest owns portable CART trees, task metadata, normalized impurity-decrease feature importances, and an out-of-bag score. FitClassificationForest and FitRegressionForest use seeded bootstrap samples and feature subsampling; PredictForestClasses and PredictForestValues reject task mismatches. Importance is explicitly an impurity heuristic, not a causal or permutation claim.
Multivariate linear-Gaussian filtering lives in TimeSeriesLib.StateSpace and uses typed dense matrices throughout.
TMultivariateKalmanConfiguration, TMultivariateKalmanFilter, TMultivariateKalmanStep, TMultivariateKalmanSeriesResult, and TMultivariateKalmanForecast define the multivariate contract. Configuration and filter constructors clone all matrices/state; observations are rows in a typed dense matrix. Updates use the innovation-covariance solve and Joseph covariance form, return innovations and likelihood diagnostics, and replace filter state only after a complete finite update.
Cross-domain persistence adapters live in InterchangeLib.Models, keeping MathBase.Interchange independent of modelling, DSP, and ML units.
SaveCubicSpline/LoadCubicSpline, SaveStreamingFIR/ LoadStreamingFIR, SaveStandardization/LoadStandardization, and SaveScalarKalman/LoadScalarKalman use one adapter envelope with magic, version, kind, little-endian payload length, and CRC-32. Loads enforce an explicit element cap and fully validate payloads before constructing a returned value. The existing MathBase.Interchange RNG format remains the RNG-state contract.
TValueMetadata plus Describe overloads report scalar type, rank/shape, and element count for real/complex vectors and matrices. MathBase.Interchange.Summarize gains a complex-vector overload; InterchangeLib.Models supplies concise Summarize* functions for each persisted model family.
The optional, non-Turing-complete evaluator lives in MathBase.Expressions. It has no assignment, loops, recursion, file, process, environment, or network primitives. Callers provide an immutable symbol table and explicit operation/element limits.
TExpressionValue, TExpressionSymbol, TExpressionLimits, and TExpressionEvaluator.Evaluate are the bounded evaluator surface. Values own vectors and clone matrices. Expressions support finite scalar literals, bound symbols, parentheses, arithmetic, elementwise elementary functions, dot, matmul, and transpose; there is deliberately no assignment or user-defined function mechanism. Shape/type errors and text, depth, element, or operation limit exhaustion raise EExpressionError before a result is returned.
1.7.0 traceability
Interpolation and approximation
Roadmap outcome
Disposition
Release evidence required
Stable barycentric and rational interpolation
complete
Existing direct/reference tests
Configurable spline boundaries, PCHIP/Akima, derivatives and integrals
Add optional adapter unit and compatibility/failure-atomic tests
Concise/full summaries plus shape/type metadata
must close
Add metadata records and complex/model summaries
Safe bounded expression evaluator
must close
Add parser/evaluator/resource/adversarial tests
Optional I/O/evaluator/adapters
complete
Preserve independent core-unit builds
Portable performance
Roadmap outcome
Disposition
Release evidence required
Caller buffers/workspaces and allocation measurement
strengthen
Add allocation counters for representative hot paths
Blocked kernels and bounded deterministic parallel execution
conditional defer
Serial blocked oracle is stable; activate threads only with Win32/Linux/Windows determinism evidence
Compile-time SIMD for x86/ARM after scalar stability
conditional defer
Cross-architecture compiler/CI evidence is not currently available
Separate small, batched, streaming, and large workloads
strengthen
Expand benchmark classes and allocation reporting
Published baseline/regression tracking
complete
Existing qualification comparison; retain on final code
Win32 overflow/address/allocation audit
strengthen
Re-run all new shape/resource cases under i386
Broader OS/architecture support toward ARM64/macOS
conditional defer
Requires maintainable hosted runners; do not claim unexecuted targets
1.8 completion gate
Gate
Disposition
Shared DSP/statistics/fitting/analysis containers
complete
Bounded-memory streaming and documented state
strengthen — add restored/long-block paths
Portable failure-atomic persistence
strengthen — extend to selected models
Portable oracle for optional accelerated paths
complete for shipped serial paths; conditional paths remain unsupported
Published accuracy/performance comparison
strengthen — rerun after gap closure
Published workflow/limit/open-item inventory
strengthen — regenerate from this final matrix
Completion rule
The branch is not ready to tag while any must close or strengthen row lacks implementation, direct tests, and public documentation. Conditional deferrals must remain visible in the roadmap, capability inventory, release notes, and qualification report, with the missing prerequisite stated.
Final closure audit
The disposition columns above preserve the pre-implementation audit, not the current completion status. Every must close and strengthen row now has implementation, direct tests, and public documentation:
Area
Closure evidence
Interpolation/fitting
TCubicSplineInterpolator, spline/weighted/rank-deficient fitting, scaled bounded robust nonlinear fitting, covariance eligibility tests, expanded example 17, and NumericalModelling.md
Integration/roots/ODE
cubature, caller-RNG Monte Carlo, all-complex polynomial roots, discontinuity/limit/reentrant tests, component ODE tolerances, reverse/cancel/failure tests, and NumericalModelling.md
Differentiation
explicit complex callback, vector AD/Jacobian checking, AD fitting/root/optimisation adapters, non-analytic guidance, and direct tests
Optimisation
detailed options/results, NCG/bounded L-BFGS/trust/AD/multistart/constrained/Pareto paths, warm-start workspace, two-phase LP, QP outcome/certificate evidence, and both optimisation guides
DSP
batch transforms, overlap-add/save, state restoration/long blocks, Haar energy/reconstruction, threshold/oracle tests, conventions table, and expanded benchmarks
hierarchy/linkages, fitted-transform leakage boundary, seeded classification/regression forests with OOB/importance, multivariate Kalman innovations/likelihood/forecast/failure atomicity, and public guides
Interchange/tooling
typed metadata, complex/model summaries, versioned selected-model adapters with corruption/resource tests, bounded expressions with adversarial limits, and Interchange.md
Performance/evidence
small, batch, stream, and large deterministic benchmarks with public allocation/state counters; the final platform/archive results are recorded in QUALIFICATION_1.8.0.md
Conditional rows remain deferred for the prerequisite stated in their original row and are repeated in the capability inventory, release notes, and qualification report. They are not represented as stable APIs.