Elamur GroupantsāŒ•
☰

gparse-test-softmax-backward-bounded-check

The groupant beside gparse/tests/softmax_backward.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

Facts

Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

Components

componentlabelwhere
approximantpartialapproximant
astpartial../syntax.json
costsymbolic source derivedinvariant
descriptantpresentdescriptant
invariantpartialinvariant
testspartial bounded checkstests

Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

idtypelabelwhere
behavior_complementbehavior_complementpartial source derived modelbehavior_complement
reverse_reconstructionreverse_reconstructionpartial source derived modelreverse_reconstruction
layout_caseslayout_casespartial source derived modellayout_cases
finite_differencefinite_differencepartial source derived modelfinite_difference
stable_maskstable_maskpartial source derived modelstable_mask
negative_referencenegative_referencepartial source derived modelnegative_reference

Model text

descriptant

Source-bound description

CUDA gradient test builds three rows for widths1,3,17,33,257; compares fused/reference probabilities and weighted gradients, f64 central differences, narrow offsets/transposes, and stable masked logits.

Epoch 2026-10-31

Prospective model was recorded before edits. Added tests use bounded synthetic fixtures; production algorithms unchanged. Coverage is partial, not proof. No trained corpus, live teacher or throughput experiment was executed.

approximant

Forward approximant

CUDA gradient test builds three rows for widths1,3,17,33,257; compares fused/reference probabilities and weighted gradients, f64 central differences, narrow offsets/transposes, and stable masked logits.

Domain: valid source-specific dimensions and resources stated in invariant; no automatic production substitution. Numerical observations are finite checks, not an end-to-end relative bound. Executable Rust surrogate: unsupported gap; existing exact tests are not surrogates. Future metric-specific caps may be 1/2/5/10%, never above 10%.

invariant

Invariant and cost

Every checked forward/backward discrepancy<2e-6; ±1000 logits stay finite and selected -1e9 columns exactly zero; upstream fused gradient absent.

Cost

O(sum widths) tensor storage and a fixed number of full-row objective evaluations per width.

Allocation, finite arithmetic, platform dimensions and external failures are not universally certified.

models

Typed model catalog

behavior_complement

Reference-gradient absence or threshold exceedance fails; no fallback to CPU is accepted because CUDA creation unwraps.

reverse_reconstruction

Probabilities admit row-shifted logits; derivative tolerances admit intervals around finite-difference observations.

layout_cases

narrow(0,1,2) tests nonzero contiguous offset; transpose tests contiguous conversion and backward through view.

finite_difference

Four indices per width, possibly duplicated at width1; epsilon1e-4. Do not count these as four distinct coordinates at width1.

stable_mask

[1000,999,-1e9] and [-1000,-1001,-1e9] produce finite rows and exact masked zeros on tested cells.

negative_reference

ops::softmax_last_dim graph must lack input gradient; this is distinct from custom derivative correctness.

tests

Checks and limits

Selected parent checks relevant to this fragment (not exhaustive): cpu_f64_uses_reference; fused_softmax_matches_reference_gradients_and_finite_differences

Selected commands run twice debug and twice release; exact receipts and source-to-test mapping retained in wave30 gparse external run directory. Tests do not certify allocation failure, all NaN/overflow inputs, trained-model accuracy or corpus timing. Compiled mutants cover selected boundaries; per-source coverage is recorded in the external map, not presumed.

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/gparse/tests/softmax_backward.rs.groupant/bounded-check.groupant/