# Behavior traces — flutter/flutter

> Canonical page: https://codevetter.com/unpack/flutter/behavior-traces

# Behavior traces — flutter/flutter

Scanned commit acb8fd51143a49384799557cb1df6ecead61a55a (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Three end-to-end flows were traced. (1) CLI bootstrap: bin/flutter -> shared.sh -> Dart SDK fetch + snapshot compile -> flutter_tools.dart -> executable.main -> runner.run -> FlutterCommandRunner -> FlutterCommand.runCommand. (2) `flutter run` hot path: RunCommand picks HotRunner -> FlutterDevice.create (ResidentCompiler + shader compiler) -> device launch -> attach to VM service -> keystroke-triggered _reloadSources -> DevFS push -> VM reloadSources -> reassemble. (3) On-device app start: embedder creates Shell/Engine -> RuntimeController.LaunchRootIsolate -> dart:ui _runMain -> user main() -> runApp -> WidgetsFlutterBinding frame pipeline -> rasterized by the engine's Animator/Rasterizer.
- Bootstrap order (posix): bin/flutter -> follow_links -> source bin/internal/shared.sh -> shared::execute -> update_engine_version.sh -> staleness check on flutter_tools.stamp -> _wait_for_lock -> update_dart_sdk.sh -> pub_upgrade_with_retry (10 tries) -> `dart --snapshot-kind=app-jit` compile -> exec dart flutter_tools.snapshot "$@". — [bin/flutter#L51-64](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/bin/flutter#L51-L64) [bin/internal/shared.sh#L118-191](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/bin/internal/shared.sh#L118-L191) [bin/internal/shared.sh#L196-283](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/bin/internal/shared.sh#L196-L283)
- Guard rails in bootstrap: shared::execute refuses to run without git on PATH and without $FLUTTER_ROOT/.git (must be a real clone), warns when EUID==0 outside Docker/CI, and sources bin/internal/bootstrap.sh first if present. — [bin/internal/shared.sh#L196-242](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/bin/internal/shared.sh#L196-L242)
- Tool dispatch order: bin/flutter_tools.dart main -> executable.main (sets Cache.flutterRoot via defaultFlutterRoot) -> runner.run -> runInContext -> ToolDependencies.bootstrap -> FlutterCommandRunner -> commands().forEach(runner.addCommand) -> runner.run(args) -> FlutterCommand.verifyThenRun -> runCommand. — [packages/flutter_tools/bin/flutter_tools.dart](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/bin/flutter_tools.dart) [packages/flutter_tools/lib/executable.dart#L105-188](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/executable.dart#L105-L188) [packages/flutter_tools/lib/runner.dart#L55-150](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/runner.dart#L55-L150)
- Error exit contract: UsageException -> exit 64; ToolExit -> its exitCode or 1; ProcessExit(immediate) -> direct exit; missing-git ProcessException -> friendly message + exit 1; anything else -> crash report path with exit 1. — [packages/flutter_tools/lib/runner.dart#L232-354](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/runner.dart#L232-L354)
- `flutter run` flow: RunCommand.runCommand computes BuildInfo via getBuildInfo(), picks hotMode = shouldUseHotMode(buildInfo), constructs HotRunner(flutterDevices, debuggingOptions...) or ColdRunner, then ResidentRunner.run() launches the app on each Device and attaches to the VM service (vmservice.dart). — [packages/flutter_tools/lib/src/commands/run.dart#L611-660](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/commands/run.dart#L611-L660) [packages/flutter_tools/lib/src/commands/run.dart#L695-840](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/commands/run.dart#L695-L840) [packages/flutter_tools/lib/src/resident_runner.dart#L1082](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/resident_runner.dart#L1082) [packages/flutter_tools/lib/src/vmservice.dart](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/vmservice.dart)
- Hot reload flow: user presses r -> HotRunner.reload -> _reloadSources -> projectFileInvalidator finds changed sources -> ResidentCompiler.recompile -> devFS update -> _reloadSourcesService issues VM-service reloadSources -> _reassembleHelper invokes reassemble in the app -> DeviceReloadReport aggregated per view; timings tracked via named Stopwatches (reloadSources:reload, :vm, :reassemble). — [packages/flutter_tools/lib/src/run_hot.dart#L178-265](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/run_hot.dart#L178-L265) [packages/flutter_tools/lib/src/run_hot.dart#L957-1040](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/run_hot.dart#L957-L1040) [packages/flutter_tools/lib/src/run_hot.dart#L72-77](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/run_hot.dart#L72-L77)
- Engine app launch flow: the embedder (embedder.h API or platform embedder like FlutterEngine.java) creates a Shell, which constructs Engine with a RuntimeController; Engine::Run/LaunchRootIsolate starts the Dart isolate, which enters dart:ui's _runMain (hooks.dart) -> user's main() -> runApp -> WidgetsFlutterBinding.ensureInitialized + scheduleAttachRootWidget + scheduleWarmUpFrame. — [engine/src/flutter/shell/common/engine.cc#L36-90](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/engine/src/flutter/shell/common/engine.cc#L36-L90) [engine/src/flutter/shell/common/engine.cc#L248-282](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/engine/src/flutter/shell/common/engine.cc#L248-L282) [engine/src/flutter/lib/ui/hooks.dart#L424](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/engine/src/flutter/lib/ui/hooks.dart#L424) [packages/flutter/lib/src/widgets/binding.dart#L1887-1957](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter/lib/src/widgets/binding.dart#L1887-L1957)
- Frame pipeline order (documented in binding.dart): transient callbacks -> handleBeginFrame (animations, transient frame callbacks) -> microtasks -> handleDrawFrame -> build/layout/paint -> compositing -> semantics -> finalization; super.drawFrame() ordering keeps the layer stack consistent. — [packages/flutter/lib/src/widgets/binding.dart#L1483-1577](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter/lib/src/widgets/binding.dart#L1483-L1577)
- `flutter test` flow on CI: LUCI target -> flutter_drone recipe -> `dart dev/bots/test.dart` -> selectShard() picks the shard runner (e.g. frameworkTestsRunner, _runToolTests) -> suite runner invokes `flutter test` with flutterTestArgs; --local-engine flags are exported as FLUTTER_LOCAL_ENGINE env vars for subprocesses. — [dev/bots/test.dart#L87-140](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/dev/bots/test.dart#L87-L140) [.ci.yaml#L9-10](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/.ci.yaml#L9-L10)
- First-run persistence flow: when artifacts are missing, commands call Cache.updateAll -> downloads zip from storage.googleapis.com -> unzip into bin/cache/artifacts -> stamp files written; failed downloads leave no partial artifacts because downloads go through temp files (cache.dart Net/HttpClient path). — [packages/flutter_tools/lib/src/cache.dart#L246-253](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/cache.dart#L246-L253) [packages/flutter_tools/lib/src/cache.dart#L537-590](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/cache.dart#L537-L590) [packages/flutter_tools/lib/src/flutter_cache.dart](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/flutter_cache.dart)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
