Skip to content

Commit 95d98be

Browse files
committed
Remove uphill bias from random walk controller (50/50)
Change directional bias from 60/40 (favoring increase) to 50/50 (no directional bias). The A/B comparison showed 8 workers was 5.2% slower than 4 on 200K heaps, and the uphill bias was actively guiding the walker toward a worse operating point. Per Alex's direction: "no bias."
1 parent f91832c commit 95d98be

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/gcmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,9 +1432,9 @@ gc_collect_main(PyThreadState *tstate, int generation,
14321432

14331433
// 20% chance to step ±1 (proactive exploration)
14341434
if (rand_val < 0.2) {
1435-
// Bias uphill: 60% chance to increase, 40% to decrease
1435+
// No directional bias: 50/50 chance to increase or decrease
14361436
double dir_val = (double)((rng >> 16) & 0xFFFF) / 65535.0;
1437-
int delta = (dir_val < 0.6) ? 1 : -1;
1437+
int delta = (dir_val < 0.5) ? 1 : -1;
14381438

14391439
// Always step when the dice fires. Good values stick
14401440
// because they don't trigger further corrective steps.

0 commit comments

Comments
 (0)