ENH: Add ZeroResp and ZeroResp v2 (tournament rev 2.2) - #1496
Conversation
Adds an adaptive state-machine strategy with dynamic epochs, a stochastic
retaliation buffer (5 + U{1..10}), and a permanent red-line ban after
systemic defections. Includes unit tests (initial C, buffer queue, red line,
reset), strategy registration, classifier entry, and docs index update.
Adds tests for match-length edge cases, end-game harvest, anti-raider, hostile live ban, and epoch/red-line close paths. Updates stochastic and makes_use_of length filter counts after registering ZeroResp.
NumPy 2.x changes scalar repr (np.int64/np.float64) which breaks doctests, match.scores output, and fingerprint probe string equality under CI. Tox already pins numpy==1.26.4 for install_deps; package deps were upgrading to 2.x via numpy>=1.26.4. Constrain the dependency and harden Point creation.
pytest already green (5252 passed, 100% coverage). CI failed on black --check for test_zeroresp and a few pre-existing modules under black 26.x. Format those files so tox commands[1] passes.
Ports ZeroRespV2Core: early-sharp retaliation, echo-shield contrition, one-shot noise forgiveness, deadlock break, plus ZeroResp backbone (epochs, systemic red line, anti-raider, end-game harvest). Includes full TestPlayer suite, registration, classifier YAML, and docs.
Update for maintainers (2026-08-04)Pushed revision 2.2 of ZeroResp v2 (short adaptive buffer, dual noise-aware forgiveness, smart harvest / grim probe). CI was already green on the previous commit; this push should re-run the matrix. Evidence package (algorithm + unit tests + Higher League / deep-validation tables): Why this is ready for the strategy list
Request: please review when you have bandwidth. If two strategies are too many, I can collapse to a single Thank you for maintaining Axelrod — happy to address any requested API/doc changes promptly. |
CI fix for revision 2.2 (just pushed)Addressed the two failures from the previous matrix run:
What is in this PR (for clarity):
Happy to rename the display string to |
|
Can you fix the merge conflicts (#1497 fixed a problem with numpy). |
Take numpy>=2.1 from Axelrod-Python#1497 (Fix numpy version). Keep float() cast in fingerprint point generation for stable probe names across NumPy.
|
Thanks @drvinceknight — merge conflicts with Took |
What
Adds two related adaptive long-memory strategies for the iterated Prisoner's Dilemma:
This PR supersedes #1495 (ZeroResp alone). Prefer reviewing this PR.
Why
ZeroResp v2.2 is the sandbox leader against classic Axelrod pools and exploiter heuristics while remaining non-cheating (
inspects_source/manipulates_*all false).External benchmarks (reproducible package)
Full report: https://github.com/Evreu1pro/ZeroResp
How to test
Smoke:
Coverage
reset()/ clone for multi-rep tournamentsChanges
axelrod/strategies/zeroresp.pyaxelrod/strategies/zeroresp_v2.pyaxelrod/tests/strategies/test_zeroresp*.py_strategies.py/ classifiers / docsAlso includes CI hardening (
numpy<2, black formatting) so the suite stays green on current runners.Breaking
No — additive only.
Review notes for maintainers
ZeroResp v2.2if that is clearer in plots.