Boot Android emulators slim: guest RAM, low-RAM mode, and the feature profile
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- android, typescript
- Ambito
- devtools, documentation, mobile-dev
Direzione di ricerca
Read docs/internal/adr/0006-opt-in-slim-android-emulators.md and compare the iOS path in src/drivers/android/index.ts, src/core/config.ts, src/daemon/main.ts, and the listed tests. Run the focused Android driver/config tests first, then verify the emulator flags, featureProfile, hashes, advisories, documentation, and pnpm check; the slow real-emulator lane must also pass when an Android SDK is available.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Part of #159.
Scope
After this PR a slim Android device runs with the configured guest RAM and, unless turned off, as a low-RAM device. The mode rules are those of #172: android.defaultMode sets the default, --mode slim gets a slim device on any worker, and the lease reports mode: "slim". A --mode full lease gets a stock emulator on its own pool key, as on iOS. simlock doctor names an installed image that ignores the RAM size. No package is disabled yet; that is the next task.
{
"android": {
"defaultMode": "full", // default
"slim": {
"ramMb": 1536, // guest RAM in MiB for a slim device
"lowRam": true // boot the guest as a low-RAM device
}
}
}
A changed key applies at a device's next boot and rebuilds that device's clean baseline once. Nothing under android.slim is settable from a lease request, MCP, or HTTP.
Technical spec
Written before #172. #172 has shipped (#204): featureProfile is now device.mode ("slim" or "full", always present), slim.enabled gave way to android.defaultMode, and --full is now --mode full. Revise this section against that before approval.
Modules touched
src/core/config.ts:android.slimblock besideandroid.emulator(#148) with the defaults above. Validators reject a non-booleanenabledorlowRamand aramMbthat is not a positive integer, naming the key. A gateway already warns about and ignores theandroidkey; only the docs list changes.src/contract/schemas.ts: the config block sosimlock configandconfig.getrender it.src/daemon/main.ts: threadconfig.android.slimintodiscoverAndroidDriverasslim, the wayconfig.ios.slimreaches the iOS driver.src/drivers/android/data.ts:AndroidDriverData.full?: true;isAndroidDriverDataaccepts data with or without it.src/drivers/android/index.ts:AndroidDriverOptions.slim(AndroidSlimOptions, optional; omitted equals disabled).reducesFeaturesisslim?.enabled === true.provisionstampsfull: trueinto driver data whenspec.fullis true, and nothing otherwise, so a normal spec's driver data stays byte-identical.- One function decides whether slim applies to a device: enabled and not
full. Every other site calls it (architecture rule 10). #startEmulatorappends-memory <ramMb>and, whenlowRam,-lowramafter theandroid.emulatorflags, on every boot of a device slim applies to, recovery included (ADR 0006 §2).#currentConfigHashgains the device's slim inputs (ramMb,lowRam) only when slim applies, and appends nothing otherwise, so a baseline captured before this change keeps its hash for slim off and for afulldevice (ADR 0006 §3).#configHashand#captureBaselinepass the device through.makeReadyreturnsfeatureProfileon every path, including the already-running path and arecoverboot:undefinedwhile slim is off,"full"for afulldevice,"reduced"otherwise (ADR 0006 §5).advisories()returns oneslim-image-ram-flooradvisory naming each installed image whose tag ends in_ps16kwhile slim is on andramMbis below 4096 (ADR 0006 §9). Read-only, same contract aslistCatalog.
docs/CONFIGURATION.md: the three keys in the table, their validation, the next-boot and baseline-rebuild rules, the gateway-ignored list, a slim section that no longer says iOS-only and says what to pair:capacity.config.ramBudget.androidBytesPerDeviceandandroid.emulator.gpu.docs/CLI.md:--full,featureProfile, and thedoctoradvisory text no longer say Android is ignored or absent.docs/HTTP-API.md: the same forfullandslim.docs/internal/KNOWN-PITFALLS.md: an Android slim section: a config change wipes each device once, low-RAM mode is app-visible, 16 KiB images gain nothing.e2e/slow-android-slim.test.ts: the real-emulator lane, gated likeslow-android-smoke.test.ts.
Contract and event changes
None beyond the config schema. No new operation, event, or lease-request field. lease.request must not gain slim.
Rules in play
docs/internal/adr/0006-opt-in-slim-android-emulators.md§1 to §5 and §9: the design this task builds.docs/internal/adr/0002-opt-in-slim-ios-simulators.md§6:fulland pool identity, reused unchanged.docs/internal/agent-rules/architecture.md: rule 2 (the core forwards the block unread), rule 10 (one "does slim apply" decision), rule 13 (the iOS-only claims in the docs become false).docs/internal/agent-rules/safety.md: rule 2 (a recovery boot keeps the flags and changes nothing else), rule 9 (config fails closed).docs/internal/agent-rules/testing.md.
Tests
- With
android.slimabsent, the emulator launch command is byte-for-byte what it was before this change andmakeReadyreports nofeatureProfile. - With slim enabled, a device's launch adds
-memory 1536 -lowramafter theandroid.emulatorflags andmakeReadyreportsfeatureProfile: "reduced". - With
lowRam: falsethe launch adds-memory 1536and not-lowram. - A
fullspec is stampedfull: trueinto driver data, its launch carries neither flag, andmakeReadyreportsfeatureProfile: "full". - A
recoverboot of a slim device carries the same launch flags as aprepareboot and runs no baseline logic. - The already-running path of
makeReadyreports the samefeatureProfileas a fresh boot. reducesFeaturesis true exactly whenandroid.slim.enabledis true.- Enabling slim, or changing
ramMborlowRam, changes the baseline hash of a non-full device and does not change it for afulldevice or with slim off. advisories()names each installed*_ps16kimage while slim is on andramMbis below 4096, and returns nothing while slim is off orramMbis 4096 or more.- A non-boolean
android.slim.enabled, a non-booleanandroid.slim.lowRam, or anandroid.slim.ramMbthat is not a positive integer is rejected at config load, naming the key. isAndroidDriverDataaccepts driver data with and withoutfull.simlock configrenders theandroid.slimblock with its defaults (e2e, fast lane).lease.requestcarrying aslimfield isBAD_REQUEST.- Slow lane, real emulator: a slim lease's guest reports
ro.config.low_ramastrueand aMemTotalnear 1536 MiB, its grant carriesfeatureProfile: "reduced", and a--fulllease of the same spec reports neither and carriesfeatureProfile: "full".
Done when
- Every test above passes and
pnpm checkis green. - With default config the emulator launch command is byte-for-byte what it was before.
simlock configshows the block.docs/CONFIGURATION.md,docs/CLI.md, anddocs/HTTP-API.mdsay what the Modules section lists, and no end-user doc says slim is iOS-only or that--fullis ignored on Android.- The slow lane passes on a machine with an Android SDK.
Out of scope
- Disabling packages,
android.slim.categories, thedevice.slimmedevent: the next task. - Guest settings of any kind.
- Any change to the capacity RAM budget.
- Headless, GPU, audio, boot animation: #148.
Depends on
- #148
- #172
- #442
Approval
- Approved for delivery
Written by an agent.
- Lingua principale
- TypeScript
- Stelle
- 19
- Fork
- 1
- Merge medio
- 7h 49m
- PR unite (30g)
- 228
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di callstackincubator/simlock
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
callstackincubator/simlock#639 ·
I maintainer di solito rispondono entro 1 giorno
-
Lint does not enforce index.ts boundaries for cleanup/, routing/, warm-pool/ and contract/ helpersForse già presa @V3RON l’ha presa 1 giorno fa. Apertabug:ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
callstackincubator/simlock#445 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
daemon-lifecycle e2e: the it.fails status test passes for the wrong reasonForse già presa @V3RON l’ha presa 8 giorni fa. Apertabug:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
callstackincubator/simlock#422 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
task:ready
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
callstackincubator/simlock#637 ·
I maintainer di solito rispondono entro 1 giorno
-
task:ready
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
callstackincubator/simlock#636 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di callstackincubator/simlock
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
anomalyco/opencode#56380 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
BUG | `MCP 服务器` | 全局层行的停用/启用与删除报 404 server row not found,编辑保存会在 profile 层复制出重复行Forse già presa @w6242652 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Chocobozzz/PeerTube#7832 ·
I maintainer di solito rispondono entro 3 giorni
-
Pay to use?Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 66/100
darkreader/darkreader#16108 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni