Elamur GroupantsโŒ•
โ˜ฐ

algorithm-soft-threshold-tests

The groupant beside algorithms/src/soft_threshold/tests.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
approximantpartialForward
astpartialsyntax.json
costconditionalCost
descriptantpresentdescriptant
invariantpartialInvariant
testsbounded executedevidence

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 relational specificationbehavior_complement
reverse_reconstructionreverse_reconstructionpartial relational specificationreverse_reconstruction
independent_oracleindependent_oraclepartial relational specificationindependent_oracle
adversarial_domainadversarial_domainpartial relational specificationadversarial_domain
mutation_observabilitymutation_observabilitypartial relational specificationmutation_observability

Model text

descriptant

Modeling epoch 2026-10-30

Run deterministic finite grids and boundary/fiber fixtures. Independent partition/support enumeration or KKT/subgradient stationarity compares production outputs to the mathematical model. Success is conjunction of named assertions; no universal numerical theorem follows.

Retained observation: real convex uniqueness does not make floating-point projection exact. Common large offsets require shifting for simplex; nonfinite intermediates are rejected rather than silently accepted. PAVA sums and L1 norms conservatively reject overflow. Underflow can prevent simplex mass certification. Normal-cone/subgradient fibers preserve many-to-one behavior; negative input tests alone do not model it. No timing or global objective-error claim is inferred.

model

soft_threshold tests.rs

Forward

Run deterministic finite grids and boundary/fiber fixtures. Independent partition/support enumeration or KKT/subgradient stationarity compares production outputs to the mathematical model. Success is conjunction of named assertions; no universal numerical theorem follows.

Invariant

Fixtures and loop bounds are fixed; production errors fail ordinary-domain oracle checks. Expected invalid-domain errors are checked separately. A compiled production mutant must cause the named production test to fail, then restored bytes must pass.

Cost

Bounded finite tests: isotonic 625 length4 vectors times 8 partitions; simplex 125 length3 vectors times 3 radii and 7 supports; L1 625 length4 vectors times 4 radii; soft 201 scalar inputs times 4 thresholds times 241 candidate objectives. Boundary allocation fixtures have 1,000,001 elements. Oracle work is test-only, not production complexity.

behavior_complement

Within the fixed test transcript universe, pass excludes executions containing any failed assertion; fail excludes executions satisfying all checks under normal completion. Outside the finite schedules no acceptance restriction is established. Panic, allocation and infrastructure failures have distinct causes although all prevent a pass.

reverse_reconstruction

An observed pass has a nonunique preimage: all implementations that satisfy every finite fixture, including implementations wrong elsewhere. A failed named assertion narrows the fiber to executions violating that check but cannot uniquely locate production versus oracle defects. Compiled mutants witness distinct failing implementations.

independent_oracle

Partition enumeration minimizes squared loss without PAVA; support masks solve simplex KKT without sorting; L1 stationarity uses a recovered common multiplier; soft compares subgradients and a separate candidate-objective grid. Each is independent of its production control flow.

adversarial_domain

Fixtures cover ties, empty input, zero parameters, nonfinite values and extreme scales. Length caps are directly tested except L1 which delegates tested validation. Allocation refusal is not forced; finite sample success is not universal numerical certification.

mutation_observability

Mutants reverse the PAVA comparison, bias simplex threshold, erase L1 signs, or add soft threshold. Named partition_oracle, active_set_oracle, kkt_grid and subgradient_grid respectively detect them. Positive restoration and source hashes bind observations.

Limits and references

Partial syntax only: no name resolution, semantic AST, macro expansion or formal proof. No executable cheap surrogate is attached: a useful cheaper error-certified kernel has not been established; exact wrappers would not provide approximation evidence. No error budget above 10% or universal accuracy claim is made. Finite tests measure additive tolerances; simplex separately checks relative mass, with zero radius handled exactly. Citations: Barlow et al., Statistical Inference under Order Restrictions (1972); Duchi et al., Efficient Projections onto the l1-Ball for Learning in High Dimensions, ICML (2008); Parikh and Boyd, Proximal Algorithms (2014), section 6.5.2. Original implementation and fixtures, no copied code.

evidence

Executed evidence, 2026-10-30

Source SHA-256: ec9b288bd79834f2cbe68e5ca09f6d9193cd8ee9fc84c74decff51fb583a53ce.

All 497 library tests passed twice in debug and twice in release; sorted per-test result records match across all four. Eight owned test functions exercise independent oracles, domain boundaries and nonunique fibers. Strict algorithms Clippy all-targets passed. Four compiled production mutants failed their named tests; original bytes restored and full debug suite passed. No allocator failure injection and no universal numerical guarantee.

External logs: $MOVA_DATA/runs/octopus-wave19-projections-2026-10-30/.

prospective

Prospective projection models

Finite f64 vectors, length <= 1,000,000; scalar radius/lambda finite nonnegative. Fallible allocation; overflow/underflow affecting certificates may return Arithmetic. PAVA projects onto nondecreasing cone with unit weights, O(n) time/space, merged block means. Simplex projects onto nonnegative sum=r via descending sort and shared threshold, O(n log n)/O(n); L1 restores signs after simplex of magnitudes when outside ball. Soft threshold is coordinate prox of lambda L1, O(n)/O(n). Unique exact-real solutions do not imply bit-exact or universal f64 accuracy. Independent enumeration of contiguous partitions/support sets and KKT stationarity will test finite grids; boundary, ties, zero, nonfinite and extreme arithmetic explicit. No executable cheap surrogate: exact kernels are already cheap, no validated cheaper metric-preserving profile. Reverse fibers are normal cones; complement excludes KKT-incompatible candidates in real model. Tests repeated in both profiles and compiled mutants must fail named checks.

This page in Markdown โ†’ https://md.groupants.elamur.ai/free/en/mova/algorithms/src/soft_threshold/tests.rs.groupant/