tempo sim: the busy report stays up until a launch comes on time
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5556c902b4
commit
29fa45e501
2 changed files with 6 additions and 3 deletions
|
|
@ -235,7 +235,8 @@ fn drive(
|
|||
let mut rng = Rng(seed);
|
||||
let mut busy_rng = Rng(seed ^ 0xB05E_B05E_B05E_B05E);
|
||||
let mut busy_until = vec![W0; scenario.minds];
|
||||
let mut stalled = false;
|
||||
// The heartbeat's report: a beat since the last launch found every Mind busy.
|
||||
let (mut stalled, mut found_busy) = (false, false);
|
||||
let mut state = Fallback::default();
|
||||
let mut used = scenario.start_used;
|
||||
let mut resets = W0 + WINDOW_MS;
|
||||
|
|
@ -309,7 +310,8 @@ fn drive(
|
|||
out.last_beat = beat;
|
||||
if now - last_turn >= i64::from(beat) * 1000 {
|
||||
if let Some(mind) = busy_until.iter().position(|&until| until <= now) {
|
||||
stalled = false;
|
||||
stalled = found_busy;
|
||||
found_busy = false;
|
||||
let step =
|
||||
scenario.cost_step.map_or(
|
||||
1.0,
|
||||
|
|
@ -331,6 +333,7 @@ fn drive(
|
|||
}
|
||||
} else {
|
||||
stalled = true;
|
||||
found_busy = true;
|
||||
out.stalls += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -870,7 +870,7 @@ fn a_saturated_report_stops_integration_toward_more_spend_only() {
|
|||
assert!(s.integral > integral, "not saturated, it integrates again");
|
||||
let integral = s.integral;
|
||||
let t = t + 60_000;
|
||||
control(&T, &mut s, Some(&read(700, t)), t, 900, false, true);
|
||||
control(&T, &mut s, Some(&read(480, t)), t, 900, false, true);
|
||||
assert!(
|
||||
s.integral < integral,
|
||||
"ahead, saturation does not hold the integral up"
|
||||
|
|
|
|||
Loading…
Reference in a new issue