-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevolution_loop.py
More file actions
87 lines (78 loc) · 3.2 KB
/
Copy pathevolution_loop.py
File metadata and controls
87 lines (78 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import subprocess
import sys
import time
import os
def run_evolution():
print("Starting Evolution Loop (100 Iterations)...", flush=True)
# 1. Base Evolution (Iterations 1-20): Standard Tasks, Low Difficulty
# Skipped as per instructions
# for i in range(1, 21):
# print(f"\n--- Iteration {i}/100 [Base Phase] ---", flush=True)
# cmd = [
# sys.executable, "UNIFIED_RSI_EXTENDED.py", "evolve",
# "--generations", "5",
# "--population", "32",
# "--task", "sort",
# "--mode", "solver"
# ]
#
# # Iteration 1 starts fresh, subsequent resume
# if i == 1:
# cmd.append("--fresh")
# else:
# cmd.append("--resume")
#
# ret = subprocess.run(cmd)
# if ret.returncode != 0:
# print(f"Iteration {i} failed!", flush=True)
# # break? or continue?
# 2. Advanced Phase (Iterations 21-60): Harder Tasks, Learner Mode (TTT)
# Skipped as per instructions
# for i in range(21, 61):
# print(f"\n--- Iteration {i}/100 [Advanced Phase - TTT] ---", flush=True)
# cmd = [
# sys.executable, "UNIFIED_RSI_EXTENDED.py", "learner-evolve",
# "--generations", "5",
# "--population", "32",
# "--task", "reverse",
# "--freeze-eval",
# "--resume"
# ]
#
# ret = subprocess.run(cmd)
# if ret.returncode != 0:
# print(f"Iteration {i} failed!", flush=True)
# 3. Expert Phase (Iterations 61-100): Strict Validation, Meta-Meta
for i in range(61, 101):
print(f"\n--- Iteration {i}/100 [Expert Phase - Discovery] ---", flush=True)
cmd = [
sys.executable, "UNIFIED_RSI_EXTENDED.py", "meta-meta",
"--episodes", "1",
"--gens-per-episode", "5",
"--population", "32",
"--universes", "2"
]
ret = subprocess.run(cmd)
if ret.returncode != 0:
print(f"Iteration {i} failed!", flush=True)
# [Real RSI - Self-Modification Step]
# Force the agent to attempt "Autopatch" (rewriting its own source code).
# We enable levels 1, 2, and 3 to allow modification of Hyperparams, Operators, and Eval Logic.
print(f"\n--- Iteration {i} [Real RSI - Codebase Self-Modification] ---", flush=True)
cmd_rsi = [
sys.executable, "UNIFIED_RSI_EXTENDED.py", "rsi-loop",
"--generations", "10", # Short burst for validation
"--rounds", "1", # Single round of self-surgery
"--levels", "1,2,3", # Enable ALL modification levels
"--population", "32",
"--universes", "1",
"--update-rule-rounds", "2" # Evolve the update rule itself
]
ret_rsi = subprocess.run(cmd_rsi)
if ret_rsi.returncode != 0:
print(f"RSI Autopatch failed at iteration {i} (Soft fail - continuing)...", flush=True)
else:
print(f"RSI Autopatch executed at iteration {i}. Checking for file changes...", flush=True)
print("\nEvolution Loop Complete.", flush=True)
if __name__ == "__main__":
run_evolution()