Elamur GroupantsโŒ•
โ˜ฐ

algorithm-max-flow-tests

The groupant beside algorithms/src/max_flow/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
approximantsource derivedForward
astpartialsyntax.json
costsymbolic unmeasuredCost
descriptantpresentdescriptant
invariantsource derivedInvariant
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
nonbehaviorbehavior_complementpartial source derivednonbehavior
compatible_implementationsreverse_reconstructionpartial source derivedcompatible_implementations
oracle_independenceoracle_independencepartial source derivedoracle_independence
finite_domainbounded_correspondencepartial source derivedfinite_domain
fault_sensitivitycompiled_fault_observationpartial source derivedfault_sensitivity

Model text

Migration: consolidated into model.md, 2026-11-04, operator decision; fresh hash-bound references to the former files were rebound to the sections below.

descriptant

max_flow tests.rs

Original std-only implementation and adjacent bounded checks. Classical concept: Edmonds-Karp shortest augmenting paths, Edmonds and Karp (1972). No source copied.

2026-10-30 prospective epoch: O(V+E) memory. O(V+E+VE(V+E)) conservative time: Edmonds-Karp has O(VE) augmentations; full BFS and array initialization cost O(V+E) each. The additive term covers E=0. No runtime timing claim or capacity-dependent iteration count.

The prospective artifact preceded implementation. The runtime checks refine this mathematical description; no timing claim, universal proof, macro expansion or semantic AST is supplied. Executable approximation is intentionally absent: these are exact APIs, with no justified lossy metric or substitution budget.

model

max_flow tests.rs model

Forward

Run named exhaustive, boundary and metamorphic tests; each successful test is conjunction of its explicit Rust assertions. The suite executes production methods directly and independent reference predicates.

Invariant

Oracle fixtures stay finite and deterministic; successful output is checked rather than inferred from constructor success. Evidence separates production correctness from harness mutation sensitivity.

Cost

Exhaustive domain 2^12 graphs times at most 2^4 cuts and E edges; bounded production calls and explicit numeric fixtures. No measured performance claim.

nonbehavior

Type: behavior_complement. For fixed finite fixtures, U consists of candidate terminating implementations paired with claimed pass/fail outcomes. R pairs each with conjunction of actual assertions. U minus R contains false pass and false failure claims. Unexercised inputs are unconstrained; a passing suite is not universal correctness.

compatible_implementations

Type: reverse_reconstruction. A passing transcript admits every implementation satisfying the finite assertions, including implementations wrong outside the observed domain. A failing assertion restricts antecedents to implementations violating that exact predicate, without uniquely locating the defect.

oracle_independence

Type: oracle_independence. The value oracle enumerates all separating vertex cuts; it does not augment paths. Certificate checks use capacity bounds, incoming/outgoing sums and cut equality. Shared endpoint representation and Rust arithmetic remain assumptions.

finite_domain

Type: bounded_correspondence. 4096 directed unit-capacity graphs on four vertices, 25 two-edge capacity combinations, 10 direct preimages, numeric maximum and malformed inputs constrain production outputs. They do not exhaust weighted multigraphs; the explicit cancellation and parallel fixtures cover selected additional behavior.

fault_sensitivity

Type: compiled_fault_observation. Compile an isolated production mutation that replaces checked total accumulation with value=0. The exact residual_cancellation_and_preimage test must fail at its value-two assertion; successful compilation followed by assertion failure establishes executable sensitivity, not broad mutation coverage.

evidence

Evidence

2026-10-30: planned and then measured in the dedicated graph-optimization run. See external run label octopus-wave5-graph-optimization-2026-10-30: prospective.md, debug/release twice normalized, strict-clippy.log, format.log, syntax twice and compiled production mutant logs. Four tests per algorithm. Bounded results are not universal verification.

Compile an isolated production mutation that replaces checked total accumulation with value=0. The exact residual_cancellation_and_preimage test must fail at its value-two assertion; successful compilation followed by assertion failure establishes executable sensitivity, not broad mutation coverage.

Measured outcome

All four focused tests passed in each of two debug and two release runs; named assertion transcripts were byte-identical after timing removal. Strict all-target Clippy with -D warnings and cargo fmt --check passed. Each source syntax projection was generated twice and was byte-identical. Each isolated production mutant compiled successfully and failed the named equality assertion.

Artifact SHA-256 bindings (external run label above):

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