// ---
// tags: trident, rust
// crystal-type: source
// crystal-domain: comp
// ---
//! Fitness scoring for neural optimizer candidates.
use ;
use StackState;
/// Score how close a candidate is to matching the baseline.
/// Runs both on one test stack and returns a shaped fitness score:
/// 0 = candidate crashes
/// 100 = doesn't crash
/// 200 = stack depth matches
/// 400 = 50%+ of stack values match
/// 600 = 90%+ of stack values match
/// 800 = all stack values match
/// 900 = stack + all side-channels match on this stack
/// Score a neural model's raw output against a baseline block.
/// Decodes the output, verifies equivalence, and returns the lower cost
/// (or baseline cost if candidate is invalid/worse).
/// Score improvement of a neural candidate over baseline.
/// Returns 0 for failures or equal/worse cost, positive value for genuine wins.
/// Used by training to reward only actual improvement (not negated cost).
trident/src/cost/stack_verifier/scoring.rs
ฯ 0.0%