re: freezes are stochastic, not eliminated; calibration vectorised

Correcting the previous iteration's wording. It claimed on n=1 that disabling
the periodic rescan "removes the freeze". With more runs that is too strong: the
configuration is now clean at 210, 240 and 300 seconds and frozen at 60 on a
fourth run.

The tally across configurations: the heavy probe froze at 27, 45, 83, 183 and
255 seconds; the cheap probe with a 90 s rescan froze at 183; the cheap probe
with no rescan is clean in three runs of four past 200 s. That is a real and
large improvement in survival, but it is a change in probability rather than a
fix, and the documentation now says so.

The witness handled the frozen run correctly -- losses stop at t=45 and stalls
are flagged from t=60 onward, with no contradiction between them.

Separately, the candidate search was the last Python loop over eight million
words and most of the remaining startup cost. Replaced with two numpy vector
operations; 7250 candidates found and startup is no longer the bottleneck. Boot
now dominates: about 190 s of title movie plus 35 s to flight against a 595 s
turn cap leaves roughly 350 s of observation, so boot is the only remaining
lever if longer windows are needed.

Practical rule recorded: do not treat a single frozen run as evidence. Run,
check the witness, discard the frozen ones and keep the clean ones -- about
three in four are usable now, which is workable where it previously was not.
This commit is contained in:
Sylpheed RE agent
2026-08-24 19:13:06 +00:00
parent 14385ae170
commit d4f6b7bf03
3 changed files with 55 additions and 8 deletions

View File

@@ -126,11 +126,18 @@ def main():
n = min(1 << 24, hiw - pos); out += os.pread(fd, n, pos); pos += n
return bytes(out)
a = grab(); time.sleep(3.0); b = grab()
cands = []
for k in range(0, min(len(a), len(b)) - 3, 4):
va, vb = struct.unpack_from('>I', a, k)[0], struct.unpack_from('>I', b, k)[0]
if va < vb and 5 < (vb - va) / 3.0 < 200:
cands.append((lo + k, round((vb - va) / 3.0)))
# The candidate search was the last Python loop over 8 million words and cost
# most of the remaining startup time. numpy does the same comparison as two
# vector ops. (AGENT.md: numpy is installed; its absence used to look like a
# logic bug.)
import numpy as np
n4 = min(len(a), len(b)) // 4 * 4
A = np.frombuffer(a[:n4], dtype='>u4').astype(np.int64)
B = np.frombuffer(b[:n4], dtype='>u4').astype(np.int64)
d = B - A
rate = d / 3.0
idx = np.nonzero((d > 0) & (rate > 5) & (rate < 200))[0]
cands = [(lo + int(i) * 4, int(round(float(rate[i])))) for i in idx]
# The MODAL cluster is not the frame counter. One run picked a modal rate of
# 93/s, and only 11 of 31 of those advanced during active combat -- they are
# subsystem counters that tick in bursts. timer_probe measured the frame-rate