speckl/compiler/lagrangia/.gitignore
tef-engine d5489234e1 feat(lagrangia): action functional + ToggleSwitch stationary-point test
Implements spec §2.3/§2.4 of the Lagrangia reducer probe
(~/.hermes/plans/2026-07-18-lagrangia-reducer-spec.md).

- compiler/lagrangia/src/score.rs: three scoring functions
  (complexity, invariant_distance, byte_entropy) + action() with
  v0 weights w1=1.0, w2=100.0, w3=0.1.
- compiler/lagrangia/tests/toggle_switch.rs: N=20 candidate search
  with deterministic LCG, hill descent (top-5 × 5 perturbations ×
  3 rounds), argmin selection with id-based tiebreak.
- Asserts: nonzero score variance (manifold not flat), stationary
  candidate holds invariants, argmin well-defined.

Test result: 8 passed (7 unit + 1 integration). Stationary point
found at S=43.47 (complexity=43, inv_dist=0, entropy=4.71) — the
gold ToggleSwitch codegen output, as expected.

Note: invariant_distance uses a static proxy (gold=holds, perturbed
=fails with depth). Full Z3 wiring is a follow-up.
2026-07-19 01:26:13 -07:00

1 line
No EOL
7 B
Text