NAME

Sim::OPT::DWGI - Distance-Weighted Gradient Integration

DESCRIPTION

DWGI is an experimental one-shot sibling of Interlinear/DWGN. It keeps the finite discrete design lattice and the initial adjacent sampled gradients, but replaces generational nearest-neighbour propagation with a global weighted least-squares integration.

For each adjacent lattice edge u->v, DWGI estimates a desired increment d_uv from ORIGINAL sampled gradients belonging to the same factor/level pair. The gradients are averaged with Interlinear-like linear distance strength w = 1 - distance/max_distance. All missing scalar values are then obtained simultaneously by minimizing

sum_edges w_uv * ((y_v - y_u) - d_uv)^2

with every sampled y fixed exactly. The normal equations are a sparse weighted graph Laplacian and are solved by Jacobi-preconditioned conjugate gradients.

No reconstructed DWGI value is ever used to create another gradient.

INTERFACE

my ($arr_ref, $lines_ref, $report) = Sim::OPT::DWGI::dwgi(
    $sourcefile, $configfile, $metafile, $blockelts_ref, $reportfile,
    $countblock, $dowhat_ref, $dirfiles_ref, $lines_ref
);

The argument shape intentionally mirrors Interlinear so that integration into Sim::OPT can be tested with minimal plumbing.

Optional $dowhat_ref controls introduced by DWGI:

dwgi_distance_power => 1       # 1 preserves linear distance strength
dwgi_cg_tol         => 1e-8
dwgi_cg_maxiter     => 2000
dwgi_verbose        => 1

lvconversion is also honored.

IMPORTANT V0.0011 RULE

DWGI 0.0011 uses the same hierarchical transport rule as 0.001. The 0.0011 bug-fix excludes one-level fixed dimensions from the active reconstruction-factor set.

DWGI uses a hierarchical transport rule. For a target lattice edge it first uses original sampled gradients from the same factor AND the same adjacent level pair, preserving the strongest DWGN correspondence. If that exact class was not sampled initially, it falls back to all ORIGINAL gradients of the same factor and weights them by full edge-midpoint distance. Reconstructed values never enter this gradient bank. If an active factor has no original sampled adjacent gradient at all, DWGI stops rather than inventing variation along it.

Derived point strength (array element 3) is a local DWGI support score: the mean confidence of incident transported-gradient constraints. It is NOT the same quantity as generational DWGN strength and should not be compared as such.

DWGI 0.0011 — Distance-Weighted Gradient Integration

DWGI is an experimental one-shot sibling of Interlinear/DWGN.

It deliberately preserves the roots of DWGN — a complete discrete factorial lattice, sampled scalar values, adjacent directional gradients, normalized geometric distance, and confidence weighting — while replacing generational propagation with one global integration.

Mathematical definition

For every adjacent lattice edge u -> v, DWGI constructs a desired scalar increment d_uv from original sampled gradients only. It then solves

minimize sum_edges w_uv * ((y_v - y_u) - d_uv)^2

with every actually sampled y held fixed exactly.

The normal equations are a sparse weighted graph Laplacian. Version 0.0011 solves them with the same pure-Perl Jacobi-preconditioned conjugate-gradient solver as 0.001.

No reconstructed point is ever used to create another gradient.

Gradient transport rule

For an edge along factor f between adjacent levels k and k+1:

If original sampled gradients exist for exactly (f,k,k+1), only those gradients are used.

Otherwise, all original sampled gradients for factor f are eligible.

Eligible gradients are averaged with linear Interlinear-like distance strength 1 - distance/max_distance, measured between gradient-edge midpoints.

A factor is active only when its lattice has more than one level. Fixed one-level factors are ignored by the integration geometry and require no gradient evidence. If an active factor has no original adjacent sampled gradient at all, DWGI stops: variation along that factor is not identifiable from the initial gradient evidence.

This hierarchical rule preserves the strongest DWGN level-pair correspondence where it exists while still permitting a complete one-shot field when sparse acquisition omitted some exact level boundaries.

Sim::OPT-shaped interface

my ($arr_ref, $lines_ref, $report) = Sim::OPT::DWGI::dwgi( $sourcefile, $configfile, $metafile, $blockelts_ref, $reportfile, $countblock, $dowhat_ref, $dirfiles_ref, $lines_ref );

The argument shape mirrors Sim::OPT::Interlinear::interlinear() intentionally.

New optional dowhat keys:

canon => 'dwgi' # select DWGI through Sim::OPT::Metabridge dwgi_distance_power => 1 dwgi_cg_tol => 1e-8 dwgi_cg_maxiter => 2000 dwgi_verbose => 1

DWGN remains the default. Select DWGI with canon => 'dwgi'; Sim::OPT::Metabridge performs the dispatch without requiring OPTcue.

Qualification performed here

5x5 linear field, two-axis central star: maximum error ~1.8e-15; 3 PCG iterations.

5x5x5 separable quadratic, three-axis central star: maximum error ~1.6e-9 at a 1e-10 solver tolerance; sampled-anchor error exactly zero.

Interaction field: sampled anchors remain exact while the reconstructed field shows the expected approximation error, demonstrating that the solver is genuinely reconciling an imperfect transported gradient field rather than reproducing a trivial analytic formula.

Partial factor/level coverage: same-factor fallback exercised and a linear field reconstructed to numerical precision.

Missing all gradient evidence for an active factor: explicit identifiability failure.

A synthetic production-shape lattice of 9 x 11 x 11 x 19 x 17 = 351,747 points was also exercised. The prototype built all 1,616,494 edge constraints successfully. Ten PCG iterations plus setup took about 25 seconds in the test container and peaked at about 1.1 GB RSS. The residual after 10 iterations was ~0.628 and after 25 iterations ~0.191 in a deliberately demanding large synthetic solve. A complete 351,747-point convergence run has not yet been qualified here, so version 0.001 should be treated as research code, not a replacement for production DWGN.

Derived-point support

For API compatibility, arr->[3] is populated. Sampled points retain strength 1; reconstructed points receive the mean confidence of their incident transported-gradient constraints. This is a DWGI support score, not DWGN generational strength and should not be compared numerically with it.

Installation

Install the module only:

cp lib/Sim/OPT/DWGI.pm $HOME/Sim-OPT/lib/Sim/OPT/DWGI.pm

The optional experimental Descend hook is provided separately under experimental/. Do not install it over a production Descend without first preserving the current file. Its only functional change is a soft-coded engine selector around the existing Interlinear call.

First scientific comparison recommended

Run DWGN and DWGI from the same prepared sparse lattice and compare:

sampled anchors (must be identical);

reconstructed objective landscape;

incumbent/ranking changes;

holdout error where real simulated values are available;

wall-clock and memory;

DWGI gradient residuals and PCG convergence.

The point of v0.001 is not to prove that global integration is superior. It is to create the cleanest possible experiment separating iterative gradient propagation from simultaneous gradient integration.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 686:

Non-ASCII character seen before =encoding in '—'. Assuming UTF-8