Elamur GroupantsโŒ•
โ˜ฐ

algorithm-li-chao-tree-tests

The groupant beside algorithms/src/li_chao_tree/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
oracle_independenceoracle_independencepartial relational specificationoracle_independence
control_scopecontrol_scopepartial relational specificationcontrol_scope

Model text

descriptant

li_chao_tree epoch memory

2026-10-30: choose exact bounded integer computation before implementation. 15625 triples, 234375 exact query comparisons, plus 2^20 identical insertions and accepted/rejected coordinate cap fixtures. Finite bounded test cost; no timing benchmark.

Retain the distinction between observation and internal representation: query ties preserve insertion identity; connectivity results preserve only partitions. The compiled faulty reduction/rollback controls establish sensitivity at named assertions. Original code follows the classic descriptions cited in module documentation; no copied solution.

No performance gain or approximate substitute claimed. These small files use file-level models, with no nested fragments. Source-bound partial syntax is generated twice identically; macro expansion and semantic AST remain absent. Allocation-failure behavior is not fault-injected.

model

li_chao_tree tests.rs

Forward

Execute all 25^3 ordered triples of slopes/intercepts in -2..=2. After each insertion query five coordinates and compare literal enumeration of all inserted lines, retaining earliest ID. Add MIN/MAX, duplicate-coordinate, empty/unknown, cap and tie fixtures.

Invariant

Fixture order and integer arithmetic deterministic; independent oracles do not invoke production helpers. Test outcome observes scheduled assertions only, not all possible inputs or allocation effects.

Cost

15625 triples, 234375 exact query comparisons, plus 2^20 identical insertions and accepted/rejected coordinate cap fixtures. Finite bounded test cost; no timing benchmark.

behavior_complement

Universe: implementations paired with normal/panic outcomes on the fixed fixtures. Normal completion is excluded if a returned value/ID disagrees with direct enumeration, if a tie selects a later ID, or boundary errors/cap state preservation differ. Unsampled implementations remain unconstrained.

reverse_reconstruction

Normal completion retains all implementations agreeing on the finite observations, including different algorithms and faults outside these fixtures. A failing named assertion yields a concrete witness, not a unique faulty source reconstruction. Finite success does not recover implementation identity.

oracle_independence

Execute all 25^3 ordered triples of slopes/intercepts in -2..=2. After each insertion query five coordinates and compare literal enumeration of all inserted lines, retaining earliest ID. Add MIN/MAX, duplicate-coordinate, empty/unknown, cap and tie fixtures.

control_scope

One compiled production mutation is required to fail a named assertion. Exact saved bytes are restored before repeated positive runs. This witnesses sensitivity to that fault only; no exhaustive fault detection follows.

evidence

Evidence, 2026-10-30

Source SHA-256: 18732adb4526230276350a3c3a452f515e061ec84a5ac4c6956e604659c4e05f. Three tests for this algorithm pass twice debug and twice release with identical normalized names/results. Strict all-target Clippy and narrow rustfmt pass. One production mutant per algorithm compiles and fails a named assertion, then exact source bytes are restored.

15625 triples, 234375 exact query comparisons, plus 2^20 identical insertions and accepted/rejected coordinate cap fixtures. Finite bounded test cost; no timing benchmark.

Li Chao mutant changes query min reduction to max and fails exhaustive_envelopes. Connectivity mutant suppresses rollback and fails rollback_and_lifecycle. Six tests and two production controls total across the two algorithms. Finite evidence is not general correctness proof. No live parser/teacher/GPU, full-course or performance evidence.

External raw log hashes:

Structural receipts: four file sidecars, eighteen typed views (five per production file, four per tests file), zero fragments, four source-bound partial syntax projections. Each syntax artifact and groupant report generated twice identically. Temporary scaffold includes the base registry unchanged; no shared registry edits committed. Initial own-only scaffold was rejected for excluding existing ownership declarations, then corrected by including base nodes.

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