Skip to content

xor_bench: name champion checks by state reset; add reset variants and tuning keys - #123

Merged
TLmaK0 merged 1 commit into
developfrom
issue-106-xor-bench-reset-checks
Nov 25, 2026
Merged

TLmaK0 merged 1 commit into
developfrom
issue-106-xor-bench-reset-checks

Conversation

@TLmaK0

@TLmaK0 TLmaK0 commented Nov 25, 2026

Copy link
Copy Markdown
Owner

What changes

still_solved_reversed_order evaluated the reversed patterns without resetting the CTRNN state, so it reported e.g. 42/50 even with reset=1, and its name did not say so. The SUMMARY champion checks are now named after whether they reset state:

SUMMARY field order state reset between patterns
reproduced_as_trained (was reproduced_same_order) training as in training (reset=)
still_solved_reset_each training yes
still_solved_reversed_no_reset (was still_solved_reversed_order) reversed no
still_solved_reversed_reset_each (new) reversed yes
still_solved_all_orders_reset_each (new) all 24 yes (solved only if every order is)

The per-run lines (run=...) now print a checks: ChampionChecks { as_trained, reset_each, reversed_no_reset, reversed_reset_each, all_orders_reset_each } field with the same meaning.

The usage text (printed when run without arguments) now documents every mode, every key, and every check.

New keys for the MutationConfig fields the bench lacked (so #108 can tune with it). If a key is not given, the bench uses the library default:
xavg (crossover_weight_averaging_rate), surv (survival_threshold), champ (champion_copy_min_offspring, inf = off), splitw / splitb (split_neuron), step (step_time), integ (0 exponential Euler / 1 explicit Euler), out (0 sigmoid / 1 linear), stag / elit (species_stagnation), reeval (reevaluate_elites). mutp, taurate, tmax and assign already existed.

The bench code moved to examples/xor_bench_common/mod.rs (same pattern as ctrnn_common), so tests/xor_bench_tests.rs can test it.

How it was verified

  • tests/xor_bench_tests.rs (11 tests, written first and seen failing). They check:
    • with no keys the config equals MutationConfig::default()
    • every new key sets its field
    • invalid enum values are rejected
    • every key appears in the usage text
    • all_orders() returns the 24 permutations
    • on a hand-built organism with memory (a self-loop and slow τ), the reset checks do not depend on the order, but reversed_no_reset does
    • every SUMMARY check name ends in _no_reset, _reset_each or _as_trained, and is documented
  • Gates: cargo fmt -- --check, cargo clippy --release --all-targets -- -D warnings (default, telemetry, all-features), cargo build --release --examples and cargo test --release --no-fail-fast all pass.

Closing criterion

Bench A (xor_bench 50 500 init reset=1 seed=S) gives identical results before (develop 8f46570) and after:

seed solved median reversed_no_reset reversed_reset_each all_orders_reset_each
1 50/50 52 42/50 50/50 50/50
101 50/50 53 42/50 50/50 50/50
201 50/50 53 40/50 50/50 50/50
301 50/50 51 36/50 50/50 50/50

ref #106
Part of epic #55

🤖 Generated with Claude Code

…d tuning keys

The SUMMARY check `still_solved_reversed_order` evaluated the reversed
patterns without resetting the CTRNN state, which its name did not say.
The checks are now named after what they do:

- reproduced_as_trained (was reproduced_same_order): training order and
  training reset setting
- still_solved_reset_each (unchanged)
- still_solved_reversed_no_reset (was still_solved_reversed_order)
- still_solved_reversed_reset_each (new)
- still_solved_all_orders_reset_each (new: all 24 orders)

The usage text (printed without arguments) documents every mode, key and
check. New keys for the MutationConfig fields the bench lacked, defaults
unchanged: xavg, surv, champ, splitw, splitb, step, integ, out, stag,
elit, reeval.

The bench code moves to examples/xor_bench_common so that
tests/xor_bench_tests.rs can test it. Bench A (seeds 1/101/201/301) is
unchanged: 50/50 solved, medians 52/53/53/51.

ref #106

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TLmaK0
TLmaK0 merged commit 30fa76d into develop Nov 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant