Skip to content

Reduce pending input scan interval to one second - #34

Merged
SaladDay merged 1 commit into
mainfrom
codex/input-scan-cadence
Sep 22, 2026
Merged

SaladDay merged 1 commit into
mainfrom
codex/input-scan-cadence

Conversation

@SaladDay

@SaladDay SaladDay commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Shorten the Environment-input scan interval from five seconds to one second so a restored Runtime can pick up pending input sooner. Provider lifecycle polling remains at five seconds; 100-candidate paging, four active slots, fairness, Runtime ownership, deadlines and no-replay handling are unchanged.

Three paired real Core + Codex + KVM + Kimi K3 runs used the same cached immutable runtime assets and release binaries. The extra delay after confirmed suspension varied to exercise different request timings. Timing is server-clock request submission to PostgreSQL Turn.started_at, not first token or model completion.

Extra delay Baseline resume Candidate resume Baseline cold Candidate cold
0 s 7.797 s 3.386 s 20.894 s 19.126 s
1.5 s 10.930 s 6.609 s 21.109 s 19.861 s
3 s 10.176 s 5.574 s 21.525 s 18.833 s

Resume improved by 4.3–4.6 seconds in each pair, but two candidate samples still exceed five seconds. This change does not establish a sub-five-second guarantee, percentile or uncached-image performance. All six runs verified same-Session history/files/configuration, initialization once, idempotent retry, source VM memory release and exact snapshot restoration.

The resource tradeoff was measured separately in six controlled 30-second Worker/mock-daemon + isolated PostgreSQL windows, excluding setup, compilation and warmup. Percentages are of one logical CPU core, not the whole host:

Workload Combined CPU, baseline → candidate Other observed cost
Idle, one connected Runtime 0.523% → 0.509% Difference is single-sample noise
100 connected but unready inputs 5.348% → 12.334% SQL calls 19,232 → 40,161
One immediately failed mock preparation 0.692% → 0.860% Prepare/release attempts 6 → 25

The failure fixture does not launch native processes; its low CPU measurement cannot establish low cost for repeated native startup failures. Four slots limit concurrency, not retry frequency. The contributor guide documents the new cadence and this distinction. No retry-policy redesign is included.

Validation: focused PostgreSQL regressions pass; the updated readiness bound fails on the five-second baseline at 5.52 seconds. Full Linux make check passed, including 74 Web acceptance cases. GitHub core-check and agents-api passed. Fresh independent blind review found no in-scope defects, repeated the Environment worker regressions three times, and checked the first two live pairs and resource methodology. The third live pair is separately qualified; the reviewer did not rerun full make check or real-model qualification.

Document A records the decision, CPU methodology, timing limits, external qualification-fixture correction for the baseline's HTTP 202 contract, and cleanup evidence.

@SaladDay SaladDay changed the title Evaluate one-second pending input scans Reduce pending input scan interval to one second Sep 22, 2026
@SaladDay
SaladDay marked this pull request as ready for review September 22, 2026 16:30
@SaladDay
SaladDay merged commit 6a3131e into main Sep 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant