Repository navigation
Description
Request: #1255
Problem
With baselines (#327), the warm pool learns every baseline that is leased even once as its own kind and keeps at least one copy of it booted until the kind is forgotten, with no time limit. On 2026-11-04, one lease each of ios-test and android-test on a test worker made the pool keep 4 kinds warm (plain iPhone 17, plain Pixel 9 and the two baselines): 3 simulators and 2 emulators booted at once, a load average of 217 on an M3 Pro, and baseline leases of 39 s and 60 s instead of ~25 s.
A worker whose agents use several baselines a day keeps one extra booted device per baseline, even for a baseline someone leased once to try it. An operator cannot opt one out: warm forget works per model, and warmPool.learn: false turns all learning off.
A second gap: when a new version of a learned baseline is saved, the learned kind takes only the new version number. A version saved from a device of another model, OS or image tag leaves the pool warming copies that no longer match the baseline (found in #1245's review).
Who it is for
An operator of a worker whose agents lease baselines: some all day, some once to try them. They want the busy baselines warm and the one-off ones to cost nothing after their lease.
Outcome
- A baseline leased fewer than N times in 24 hours leaves no device booted after its lease. N is
warmPool.baselineLearnAfter, default 3. - A baseline leased N times within 24 hours is kept warm from its Nth lease on, as a plain kind is after its first.
- A learned baseline is warmed as its newest version: platform, model, OS, mode, image tag and version. A version saved from another model is warmed as that model on the next pass.
- Plain kinds behave as today.
How it works for the user
flowchart TD
A[agent leases baseline ios-test] --> B{leases of ios-test in the last 24 h, this one included}
B -->|fewer than N| C[copy, boot, lease; after release nothing stays booted]
B -->|N or more| D[kind learned: a copy stays booted, as a plain kind]
D --> E[a new version is saved from another model]
E --> F[next pass warms copies of the new version's model]
D --> G[forgotten: catalog, 3 failed boots, 33rd kind, removed or stale, warm forget, nuke]
G --> B
With N = 3 (the default), on a worker with no other leases:
$ simlock lease --baseline ios-test # 1st today; released after
$ simlock status
warm pool
(nothing listed for ios-test)
$ simlock lease --baseline ios-test # 2nd; released after
$ simlock lease --baseline ios-test # 3rd; released after
$ simlock status
warm pool
iPhone 17 / 26.0 / full / baseline ios-test learned wanted 1 ready 1 booting 0Today the first lease alone makes that learned line appear.
$ simlock config set warmPool.baselineLearnAfter 0
{"error":{"code":"USAGE","message":"Invalid config after setting warmPool.baselineLearnAfter: Invalid config value for \"warmPool.baselineLearnAfter\": expected a positive integer"}}
# exit 2Examples
Leases of one baseline, N = 3, times counted from the first lease:
| Leases | Today | After |
|---|---|---|
| one at 0 h | learned at 0 h | not learned |
| at 0 h, 1 h | learned at 0 h | not learned |
| at 0 h, 1 h, 2 h | learned at 0 h | learned at 2 h |
| at 0 h, 1 h, 25 h | learned at 0 h | not learned (the 0 h lease is out of the window at 25 h) |
| at 0 h, 1 h, 25 h, 26 h | learned at 0 h | not learned (at 26 h only 25 h and 26 h are within 24 h) |
| at 0 h, 20 h, 23 h | learned at 0 h | learned at 23 h |
| at 0 h, 12 h, 24 h | learned at 0 h | not learned (a lease exactly 24 h before is out of the window) |
| v1 at 0 h, v2 at 1 h, v2 at 2 h | learned at 0 h as v1's model | learned at 2 h, warmed as v2 |
| a plain iPhone 17 lease at 0 h | learned at 0 h | learned at 0 h |
warmPool.baselineLearnAfter:
| Value | Today | After |
|---|---|---|
| unset | key unknown | 3 |
1 |
key unknown | every baseline learned on its first lease, as today |
5 |
key unknown | learned on the 5th lease in 24 h |
0, -1, 2.5, "3" |
key unknown | the config fails to load, naming the key |
What could go wrong
- A busy baseline is never kept warm because its leases are counted apart (per version or per model): every lease pays a copy and a boot. Unlikely; one record per baseline name prevents it.
- A one-off baseline still stays booted after its lease. Likely only with N set to 1.
- After a new version from another model, the pool keeps booting copies of the old model, which no lease can take. That is today's bug; this feature fixes it.
Words used
- kind: what the warm pool keeps ready, a device's platform, model, OS version, mode and image tag, plus a baseline name for a baseline kind, e.g.
ios / iPhone 17 / 26.0 / full / baseline ios-test. - learned kind: a kind the pool keeps warm because it was leased, shown as
learnedinsimlock status. - baseline kind: a kind made from a baseline; its model, OS, mode, image tag and version are the baseline's newest version's.
- counting: a baseline kind leased but not yet N times in 24 hours; it is recorded, not warmed and not listed.
- N: the value of
warmPool.baselineLearnAfter. - forgotten: the pool drops a learned kind and stops warming it, e.g. after
simlock warm forget ios "iPhone 17".
Non-goals
- Naming a baseline in
warmPool.targets(an operator target for a baseline). - Forgetting a baseline by name (
warm forget --baseline). - Showing a counting baseline (
leased 2 of 3) in status or the console. - Forgetting a learned kind after a fixed time; ADR 0038 rejected it.
- Live Android snapshots to speed up seed making and
baseline save(parked until fresh-home workers such as CI make the first lease matter).
Completion conditions
- On a worker with N = 3, two leases of a baseline within an hour leave no device of it booted after release, and
simlock statuslists nolearnedline for it. - A third lease within 24 hours adds the
learnedline, and a copy stays booted after release. - With N = 1, the first lease of a baseline adds the
learnedline. - After a new version of a learned baseline is saved from another model,
simlock statusshows the kind with the new model, and the pool boots copies of that model. warmPool.baselineLearnAfter: 0fails the config load naming the key.
Open questions
none
Decisions
- ADR 0062 — The warm pool learns a baseline after repeated leases, and follows its newest version (PR docs(adr): propose 0062, the warm pool learns a baseline after repeated leases (#1257) #1260): the Nth-lease rule, one record per baseline name, the newest version's spec, the schema version.
Shared values
none: a one-task feature.
Behaviours
| Behaviour (invoker, action, what it sees) | Seam | Cases | Task |
|---|---|---|---|
An operator sets warmPool.baselineLearnAfter and the daemon loads it and answers it in config.get |
loadConfig, config.get |
unset → 3; 1; 5; 0, -1, 2.5, "3" → invalid config naming the key; config.get returns the value |
#1261 |
| Agents lease a baseline, and the warm pool learns its kind only on the Nth lease within 24 hours | WarmPool on lease.granted, read through figures() and the pass's proposals |
N = 3: 1st and 2nd leases → no learned kind, nothing booted after release; 3rd within 24 h → learned, kept booted; leases at 0 h, 1 h, 25 h, 26 h → not learned; at 0 h, 20 h, 23 h → learned at 23 h; at 0 h, 12 h, 24 h → not learned; learned at 2 h (leases at 0, 1, 2 h) → still learned and kept booted at 30 h, and a 4th lease at 30 h keeps it learned; N = 1 → 1st lease learns; leases of v1 and v2 count together; a plain kind learned on its 1st lease; a forgotten baseline kind counts from zero | #1261 |
| A learned baseline kind is warmed as the baseline's newest version | WarmPool pass, figures() |
new version from another model → kind shows and creates the new model and version; another OS; another image tag; another platform; same model, new version → version only; after a save from another model, its third failed boot in a row forgets it | #1261 |
An operator forgets a learned baseline kind with warm forget |
WarmPool.forgetKinds |
match by the newest version's model → forgotten; by the old version's model → not forgotten; narrowed by OS, mode, image tag; a baseline still counting → not answered, keeps counting | #1261 |
| A worker restarts, and the record keeps what it learned | LearnedKinds over a reopened state.db |
a learned baseline kind stays learned; a counting one keeps its lease rows and counts on; a file at warm pool version 2 opens at version 3 with plain kinds and their leases kept and baseline kinds dropped | #1261 |
Tasks
- Warm pool: a baseline kind is learned on its Nth lease in 24 h and warms its newest version #1261 Warm pool: a baseline kind is learned on its Nth lease in 24 h and warms its newest version — after it, a baseline leased fewer than N times a day leaves nothing booted, and a learned baseline follows its newest version. Risk: a busy baseline is never warmed, and every lease of it pays a copy and a boot.
Completion conditions → task: all five by #1261's Done when.
Open work in the same area:
- Runtime warm-pool targets: warm.set and warm.list, kept in state.db #1143 (runtime warm targets, part of Console: warm the pool up and down, and add a device from the catalog, without a restart #1137): adds tables to the same warm pool owner in
state.db, so both raise its schema version, and both touchsrc/core/warm-pool/converger.ts's config reads. No Depends on: Console: warm the pool up and down, and add a device from the catalog, without a restart #1137's ADR (PR docs(adr): propose 0056, an operator sets warm targets at runtime (#1137) #1139) is still a draft and its tasks are not ready; whichever merges second takes the next schema version, as with the protocol bump. - ios.simulator.audio keeps every simulator silent #1238 (task of Keep a leased iOS simulator silent: ios.simulator.audio #1118, in PR feat(ios): ios.simulator.audio keeps every simulator silent #1258) and ios.simulator.headless false shows each simulator in DeviceHub or Simulator.app #1239 (task of iOS: show a leased simulator in a window when headless is off #1237): both change contract shapes and bump the protocol, as Warm pool: a baseline kind is learned on its Nth lease in 24 h and warms its newest version #1261 does, so they overlap even in other files. Warm pool: a baseline kind is learned on its Nth lease in 24 h and warms its newest version #1261 Depends on ios.simulator.headless false shows each simulator in DeviceHub or Simulator.app #1239, which depends on ios.simulator.audio keeps every simulator silent #1238.
- Settings: change settings through the daemon with PATCH /v1/settings, live where it can #1154 (live settings, part of Console: see and change the daemon's settings, and restart it #1151): reads warm pool keys from a holder the daemon can change; the new key joins that list when Settings: change settings through the daemon with PATCH /v1/settings, live where it can #1154 lands. No Depends on: not ready.
Written by an agent.
Activity
docs(adr): 0062 keys a baseline kind on its name alone (#1257)
docs(adr): accept 0062 (#1257)
V3RON commentedon Nov 4, 2026
Spec updated: every section written (business sections, Decisions with ADR 0062 on PR #1260, Behaviours, Tasks); one task, #1261, set ready after its spec check.
Written by an agent.
docs(adr): drop the duplicate 0061 index row (#1257)
docs(adr): 0062 names the true upgrade consequence and everything it …
docs(adr): 0038 and 0050 status name what 0062 narrows (#1257)
docs(adr): propose 0062, the warm pool learns a baseline after repeat…
feat(warm-pool): a baseline kind is learned on its Nth lease in 24 h …
github-actions commentedon Nov 5, 2026
Closing: all 1 sub-issues are closed. The PR that closed the last one walks the completion conditions (delivery rule 9); reopen this if one does not hold on
main. Flip its ADRs to Accepted if delivery has not.V3RON commentedon Nov 5, 2026
Delivery run
Merged: #1260 (ADR 0062), #1335 (#1261)
Parked: none
Waiting: none
Decided: #1261 — the gate refused because ADR 0038 still read "not yet implemented" although its feature #771 is done → flipped 0038 to Accepted in the stack (see the Decision taken comment on #1335)
Written by an agent.