algorithm-hungarian-tests
The groupant beside algorithms/src/hungarian/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
| component | label | where |
|---|---|---|
| approximant | partial | approximant |
| ast | partial | syntax.json |
| descriptant | present | descriptant |
| invariant | partial | approximant |
| tests | finite checks | tests |
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.
| id | type | label | where |
|---|---|---|---|
behavior_complement | behavior_complement | partial relational specification | behavior_complement |
reverse_reconstruction | reverse_reconstruction | partial relational specification | reverse_reconstruction |
independent_oracle | independent_oracle | partial relational specification | independent_oracle |
mutation_sensitivity | mutation_sensitivity | partial relational specification | mutation_sensitivity |
boundary_partition | boundary_partition | partial relational specification | boundary_partition |
Model text
descriptant
hungarian: tests.rs
Epoch 2026-10-30: original exact implementation and fixtures. Deterministic ties, witness identity, explicit admission and wide objective arithmetic define the API. The implementation exports its mathematical certificate/witness directly; finite exhaustive checks inspect those identities independently.
This is a new implementation epoch, not a measured optimization. No speedup or numerical surrogate is proposed: exact objectives remain exact. Partial source syntax has opaque macro bodies; semantic analysis and unrestricted correctness remain outside the structural model. Four compiled objective/oracle controls are retained as falsification evidence.
approximant
Forward, invariant and cost
Finite forward map: each deterministic fixture is sent to the exact implementation and an independently enumerated optimum; a run passes iff every asserted objective, witness, certificate and error agrees. Invariant: oracle selection state is restored after every recursive branch. Injection enumeration costs O(P(c,r)*r) including path work; tour enumeration costs O((n-1)!*n). Test generation and source syntax are finite and explicit; neither exact source parsing nor finite agreement proves unrestricted correctness.
models
Typed models: hungarian tests.rs
Subject: adjacent source SHA-256 in manifest; epoch 2026-10-30. Observation is the pure call result or finite test outcome. All entries are partial relational specifications supported by source inspection and the named finite checks; formulas are not automatically verified. Allocation behavior is conditional on successful reservation. No general inverse, semantic AST or approximation-error guarantee is claimed.
behavior_complement
Universe: deterministic executions of this finite test source with linked implementation. A passing run excludes candidate outputs that violate the enumerated oracle equalities, witness checks or boundary assertions. This is an inner absent-behavior description over executed fixtures only, not a specification of all possible inputs. Assertion failure is observed, with compilation failure excluded from mutant evidence.
reverse_reconstruction
Observation is pass/fail plus named assertion. The compatible antecedent set contains every implementation/oracle version producing that observation on these fixtures. Passing output loses nearly all input and execution detail; many wrong implementations may pass finite fixtures. Failure constrains the reached assertion but does not identify a unique defect. The retained compiled mutation is one witness in the failure fiber.
independent_oracle
Hungarian tests enumerate injections recursively with a used-column array and compare optimum, then separately verify all primal/dual identities. Held-Karp tests enumerate permutations by swaps and sum actual optional arcs, independently of subset recurrence. Fixtures are original finite synthetic data. Oracle agreement is exact on these bounded domains, not a general proof.
mutation_sensitivity
Production objective+1 and purpose-specific oracle optimum+1 changes compile and fail named equality assertions. Original bytes are restored before positive checks. The transformation is a deliberately false objective, not malformed syntax; evidence establishes sensitivity to this class only and cannot establish all semantic defects are detected.
boundary_partition
Selected fixtures cover empty inputs, singleton conventions, malformed shapes, precedence of dimension caps, work limits, ties and full-width integer sums. Held-Karp executes the accepted 18-vertex cap on a directed ring; Hungarian rejects an ordinary 512-square fixture by work budget. No impossible allocation or allocator-exhaustion test is attempted.
tests
Checks
Run cargo test -p mova-algorithms hungarian::tests. Three tests cover independent enumerations, objective/witness identities and shape/resource boundaries. Debug and release each repeat twice with identical sorted test outcomes. Strict all-targets Clippy and narrow rustfmt pass. Raw logs stay under external run key octopus-wave11-optimization-2026-10-30; see validation.md for hashes. No cross-algorithm integration is executed in this leaf task; the root owns composition tests.
validation
Validation epoch 2026-10-30
Six owned tests pass twice in debug and twice in release. Three per module have identical normalized test identities across all four runs. Four compiled implementation/test-oracle objective controls fail named equality assertions; exact source bytes restore and positive focused checks pass. Strict all-targets algorithm Clippy passes. Partial syntax projections repeat byte-identically. No timing or general proof claim.
External run key: octopus-wave11-optimization-2026-10-30. SHA-256 evidence:
hungarian-debug-1.log:3b4d415736ca9be57fd08c71d5a67711475d01b78a3c7536f9dfd902dee99ee2hungarian-debug-2.log:ac6e474af571e4ad581babb8d559de2cc6c34977328bd6225a092baebe6e20b1hungarian-release-1.log:1c8a970e6b676297726fd2f9f228b791d57d555d1299356039fe10a3ed3bfce6hungarian-release-2.log:a6ce6070323bccc7e41893d63441a833b4e9989b9c41a6ad28a0eb39c2eef74dhungarian-identity.txt:89ea7ecaf483075d797f0594ec86f9098caf82dffd4b03843a2b1fc2cd959031hungarian-tests.rs-mutant.log:d21f9a48cb678fddd8cedc36cd71a56bc95828b5b92f3c18c8e41855e47b1156hungarian-tests.rs-mutant-restored.log:a5f3a11ff5c1f862de5522bb39a2663d7276a470eb4aee07f805ece876862c2dclippy.log:5f04f6b51d898d08f9077b5d6c8fedf70a17c77579347c18617e41b4292617fb
This page in Markdown â https://md.groupants.elamur.ai/free/en/mova/algorithms/src/hungarian/tests.rs.groupant/