Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ABTM G2 closeout: metadata-first product pruning

Status: validated / closed for the 0.8 development checkpoint

G2 asked whether ABTM topology can eliminate numerical work before value access, whether row/column topology should be prepared in both orientations, and which numerical physical layout is appropriate for CPU sparse row-by-column products.

The answer is not one universal storage format. The evidence supports a metadata-first topology layer, adaptive numerical execution, and an explicit fallback for structures where ABTM does not pay for itself.

Experiment sequence

CheckpointQuestionResult
G2aCan topology prune products before numerical value loads?Yes. Pruning follows active support, but fixed bitmap metadata is not universally faster.
G2cDoes row + column topology accelerate structural intersection?Yes, strongly on high-occupancy cases; low-occupancy cases remain near explicit-index performance.
G2dCan numerical values remain single-copy through a column-to-row source map?Correct, but the extra indirection can be expensive. Duplicated hot column values are faster where transpose-oriented numerical work matters.
G2eDoes adaptive Sparse/Bitmap/Dense execution recover low/intermediate-occupancy performance?Yes. This is the strongest tested CPU numerical representation.
G2fCan byte-packed variable payloads reduce metadata further?Storage improves, but hot-loop decoding is too expensive. Rejected for numerical execution.
G2gCan an 8-byte typed compact descriptor retain compression without the byte decoder?Faster than G2f, but slower than G2e on every tested matrix. Rejected as the G2e replacement.

G2e ten-matrix numerical corpus

All timings are median scalar CPU row-by-column sparse-dot measurements with eight deterministic pairs per row and five repeats. time ratio and storage ratio are relative to an explicit CSR + transpose-CSR baseline.

MatrixCSR nnzavg nnz/rowSparse tilesBitmap tilesDense tilestime ratiostorage ratioOutcome
thermal1574,4586.95272,688801.6421.286explicit
sherman520,7936.286,54754801.0321.138explicit
cfd11,825,58025.84392,86137,24501.0670.981explicit
venkat251,717,76327.52321,60810,02000.9900.925near parity
boneS015,516,60243.36921,64413,18700.7820.893ABTM
s3dkq4m24,427,72548.9575,331265,81300.7180.771ABTM
cant4,007,38364.17116,483230,48400.7590.783ABTM
raefsky31,488,76870.2215,64862,30400.7040.738ABTM
x1048,713,60280.40316,872431,0211,7170.8500.785ABTM
nd3k3,279,690364.4143,102101,72418,6890.5970.796ABTM

The corpus does not justify selecting only from 64-column word occupancy. boneS01 is the counterexample: about 98.6% of its tiles are Sparse, yet the adaptive ABTM path is about 21.8% faster than explicit and uses about 10.7% less storage. Row structural length and the amount of row/column merge work are therefore material predictors in addition to local word occupancy.

Within this corpus, average row length separates the clear outcomes: matrices at or below about 28 nnz/row are explicit or near parity, while all measured matrices at or above about 43 nnz/row favor G2e. The unmeasured region between those groups is too large to promote a production threshold. An avg_nnz_per_row ~= 32 rule is useful only as an experimental screening heuristic, not a stable API or automatic policy.

Numerical agreement

The adaptive and explicit kernels accumulate the same sparse products in different orders. The initial six-matrix corpus had scaled errors from exact agreement through approximately 1.5e-13. The larger held-out matrices exposed more cancellation:

Matrixmax scaled error
cant9.159e-10
s3dkq4m24.846e-11
boneS014.955e-9
x1049.313e-9

The performance-harness validation tolerance is therefore 1e-8. This is a benchmark-equivalence gate, not a solver convergence criterion. Any production promotion must additionally validate operator-level relative error and end-to-end residual behavior.

Architecture decision

G2 closes with the following CPU direction:

logical/symbolic layer:
    dual row/column topology
    metadata-first intersection and pruning

hot numerical layer:
    fixed direct descriptor
    adaptive Sparse / Bitmap / Dense execution
    prepared row values
    duplicated prepared column values when transpose-oriented reuse justifies it

fallback:
    explicit CSR / CSC-like path

The following are explicitly not promoted:

  • universal bitmap-only numerical storage;
  • source-index mapped single-copy column values as the hot default;
  • byte-decoded variable payloads in the numerical hot loop;
  • typed compact 8-byte descriptors as a replacement for the faster G2e layout;
  • a production automatic ABTM/explicit threshold derived from this corpus.

Preparation cost

G2e prepares both row and column orientations. On the larger corpus matrices this is on the order of tens to a few hundreds of milliseconds per orientation. That cost must be amortized by repeated row/column work. A production selector therefore needs a solve/work horizon or an application-provided reuse signal; kernel time alone is not sufficient.

Next checkpoint

G3 moves from generic sparse-dot experiments to ABTM’s intended topology-heavy operations:

  1. region growth;
  2. overlap and multiplicity;
  3. local submatrix extraction;
  4. preparation/reuse metrics for those operations.

G3 should keep CSR as the numerical reference/fallback and should not assume that the G2e physical layout must be reused unchanged for every region kernel.