luckdraw 0.1.2
luckdraw: ^0.1.2 copied to clipboard
Unofficial lucky-canvas Flutter port with wheels, grids, slots, capsule machines, lots and lotto draws, typed controllers and pluggable Canvas rendering.
luckdraw #
Live demo: all eight modes, runnable in the browser.
Status: 0.1.1, published to pub.dev.
简体中文: README.zh-CN.md
Unofficial port. luckdraw ports lucky-canvas (Apache-2.0) to Flutter. It has no connection to the lucky-canvas authors and is not endorsed by them. See NOTICE for upstream attribution.
Lucky-draw widgets for Flutter: wheel, nine-grid, slot machine, lever slot, capsule machine, number wheel, drawing lots and super lotto. The rendering core can be swapped out.
Status: 0.1.1, published to pub.dev. All repository checks pass: no analysis issues,
1051 tests (none skipped), 100% line coverage of lib/ (6792/6792), formatting, imports,
static/runtime acceptance checks and the parity manifest check.
Windows and Android integration tests each passed 33/33 runs. With local Flutter 3.24.5 / Dart 3.5.4,
analysis has no issues and 951 non-golden tests pass. Web and APK tree-shaking each
passed all ten probes with no leaked code. Device performance acceptance has not fully passed:
shadow comparisons still show measured differences, and one slot sample was clipped. Not yet verified:
Linux goldens, remote CI and real pub.dev publication. See
the release checklist.
The 12 Dart blocks across both READMEs keep the signatures that were analyzed with no
issues in a temporary Flutter project (REL/B17b).
Screenshots #
Renderings of this project's example app, not captures of the upstream demo. They are not evidence of pixel-for-pixel matching. Light theme:








The images use absolute raw URLs because docs/ is not in the pub archive.
The files must exist on the repository's main branch, and these changes have not been
published yet. Local originals are in docs/example_audit/after/
(the full audit has 45 PNGs, about 1.26 MB).
Features #
What it has:
- Immutable typed configuration, Controllers, result callbacks and phase notifications.
- Pick a prize by index or by weight, or wait for the result from your server.
- Canvas 2D rendering: static content is cached as
ui.Picture, and each frame only applies transforms. - A timeline that can pause and resume, freezes in the background, and keeps the same speed at any refresh rate.
- Game, renderer, easing and prize picker are separate interfaces. No third-party runtime dependencies.
- A lucky-canvas JSON compatibility layer, kept separate, with an opt-in strict comparison preset.
Five games are new and not in upstream: lever slots, capsule machines, number wheels,
drawing lots and super-lotto machines. There is nothing upstream to compare them with.
Their animation is deterministic by default. The capsule machine and lotto can opt in to a built-in physics collision mode (physics: LuckyPhysics()); it uses no third-party engine. 3D rendering is only an extension path.
Install #
Add the dependency:
dependencies:
flutter:
sdk: flutter
luckdraw: ^0.1.2
The current manifest declares Dart ^3.5.0 and Flutter >=3.24.0.
Quick start #
Each example is a standalone lib/main.dart for a Flutter app that uses this package.
They use text only, need no assets or server, and dispose their own Controller.
Start a round, then press Stop to slow down toward the second prize (zero-based index 1).
The animation still has to finish after a stop is accepted; onEnd then reports the result.
Wheel #
import 'package:flutter/material.dart';
import 'package:luckdraw/wheel.dart';
void main() => runApp(const MaterialApp(
home: Scaffold(body: Center(child: WheelDemo())),
));
class WheelDemo extends StatefulWidget {
const WheelDemo({super.key});
@override
State<WheelDemo> createState() => _WheelDemoState();
}
class _WheelDemoState extends State<WheelDemo> {
final _controller = WheelController();
static const _config = WheelConfig(
prizes: [
WheelPrize(background: LuckyFill.color(Color(0xFFE9E8FE)),
texts: [LuckyText('Try again')], weight: 3),
WheelPrize(background: LuckyFill.color(Color(0xFFB8C5F2)),
texts: [LuckyText('Gift')], weight: 1),
],
buttons: [
WheelButton(radius: LuckyLength.percent(30), pointer: true,
background: LuckyFill.color(Color(0xFF617DF2)),
texts: [LuckyText('Spin', top: LuckyLength.px(-10))]),
],
);
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
LuckyWheel(config: _config, controller: _controller,
width: 300, height: 300,
onStart: () { _controller.play(); },
onEnd: (result) => debugPrint('Wheel: $result')),
TextButton(onPressed: () { _controller.stop(1); },
child: const Text('Stop')),
],
);
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
Nine-grid #
Stop indices follow the order of the prize list; x and y set each cell's position.
The eight prizes below run clockwise around the center button.
import 'package:flutter/material.dart';
import 'package:luckdraw/grid.dart';
void main() => runApp(const MaterialApp(
home: Scaffold(body: Center(child: GridDemo())),
));
class GridDemo extends StatefulWidget {
const GridDemo({super.key});
@override
State<GridDemo> createState() => _GridDemoState();
}
class _GridDemoState extends State<GridDemo> {
final _controller = GridController();
static const _config = GridConfig(rows: 3, cols: 3,
prizes: [
GridPrize(x: 0, y: 0, texts: [LuckyText('A')]),
GridPrize(x: 1, y: 0, texts: [LuckyText('B')]),
GridPrize(x: 2, y: 0, texts: [LuckyText('C')]),
GridPrize(x: 2, y: 1, texts: [LuckyText('D')]),
GridPrize(x: 2, y: 2, texts: [LuckyText('E')]),
GridPrize(x: 1, y: 2, texts: [LuckyText('F')]),
GridPrize(x: 0, y: 2, texts: [LuckyText('G')]),
GridPrize(x: 0, y: 1, texts: [LuckyText('H')]),
],
buttons: [GridButton(x: 1, y: 1, texts: [LuckyText('Spin')])],
activeStyle: LuckyCellStyle(
background: LuckyFill.color(Color(0xFFFFCE98))),
);
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
LuckyGrid(config: _config, controller: _controller,
width: 300, height: 300,
onStart: () { _controller.play(); },
onEnd: (result) => debugPrint('Grid: $result')),
TextButton(onPressed: () { _controller.stop(1); },
child: const Text('Stop')),
],
);
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
Slot machine #
Slots have no built-in start button and no onStart, so start them from your own control.
stop(1) stops every reel on prize 1; stopEach([0, 1, 2]) sets each reel separately.
import 'package:flutter/material.dart';
import 'package:luckdraw/slot.dart';
void main() => runApp(const MaterialApp(
home: Scaffold(body: Center(child: SlotDemo())),
));
class SlotDemo extends StatefulWidget {
const SlotDemo({super.key});
@override
State<SlotDemo> createState() => _SlotDemoState();
}
class _SlotDemoState extends State<SlotDemo> {
final _controller = SlotController();
static const _config = SlotConfig(
prizes: [
SlotPrize(texts: [LuckyText('A')]),
SlotPrize(texts: [LuckyText('B')]),
SlotPrize(texts: [LuckyText('C')]),
],
reels: [SlotReel(order: [0, 1, 2]), SlotReel(), SlotReel(direction: -1)],
options: SlotOptions(mode: SlotMode.vertical, colSpacing: 5, cellAspectRatio: 0.8),
);
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
LuckySlotMachine(config: _config, controller: _controller,
width: 300, height: 180,
onEnd: (result) => debugPrint('Slots: $result')),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
TextButton(onPressed: () { _controller.play(); },
child: const Text('Spin')),
TextButton(onPressed: () { _controller.stop(1); },
child: const Text('Stop')),
]),
],
);
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
Lever slot #
The lever variant of the slot machine: drag the lever to start, then stop reels with stopEach.
import 'package:flutter/material.dart';
import 'package:luckdraw/slot.dart';
class LeverDemo extends StatefulWidget {
const LeverDemo({super.key});
@override
State<LeverDemo> createState() => _LeverDemoState();
}
class _LeverDemoState extends State<LeverDemo> {
final _controller = SlotController();
static const _config = SlotConfig(
prizes: [
SlotPrize(texts: [LuckyText('7')]),
SlotPrize(texts: [LuckyText('BAR')]),
SlotPrize(texts: [LuckyText('★')]),
],
reels: [SlotReel(), SlotReel(), SlotReel()],
);
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
LuckyLeverSlotMachine(
config: _config,
controller: _controller,
width: 300,
height: 180,
onPull: () => debugPrint('Lever pulled'),
onEnd: (result) => debugPrint('Lever: ${result.indices}'),
),
TextButton(
onPressed: () {
_controller.stopEach([0, 0, 0]);
},
child: const Text('Server result'),
),
],
);
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
Capsule machine #
Tap the knob to start; stop(1) drops capsule 1. The physics option switches to the built-in collision mode; remove it for the deterministic animation.
import 'package:flutter/material.dart';
import 'package:luckdraw/capsule.dart';
class CapsuleDemo extends StatefulWidget {
const CapsuleDemo({super.key});
@override
State<CapsuleDemo> createState() => _CapsuleDemoState();
}
class _CapsuleDemoState extends State<CapsuleDemo> {
final _controller = CapsuleController();
static const _config = CapsuleConfig(
prizes: [
CapsulePrize(
topFill: LuckyFill.color(Color(0xFFFF8A65)),
bottomFill: LuckyFill.color(Color(0xFFFFF3E0)),
texts: [LuckyText('Gift')],
weight: 1,
),
CapsulePrize(
topFill: LuckyFill.color(Color(0xFF64B5F6)),
bottomFill: LuckyFill.color(Color(0xFFFFF3E0)),
texts: [LuckyText('Grand')],
weight: 1,
),
],
options: CapsuleOptions(physics: LuckyPhysics()),
);
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
LuckyCapsuleMachine(
config: _config,
controller: _controller,
width: 300,
height: 400,
onStart: () {
_controller.play();
},
onEnd: (result) => debugPrint('Capsule: ${result.index}'),
),
TextButton(
onPressed: () {
_controller.stop(1);
},
child: const Text('Server result'),
),
],
);
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
Number wheel #
Stops by number instead of index: stopNumber(8) lands the ball in pocket 8.
import 'package:flutter/material.dart';
import 'package:luckdraw/number_wheel.dart';
class NumberWheelDemo extends StatefulWidget {
const NumberWheelDemo({super.key});
@override
State<NumberWheelDemo> createState() => _NumberWheelDemoState();
}
class _NumberWheelDemoState extends State<NumberWheelDemo> {
final _controller = NumberWheelController();
static final _config = NumberWheelConfig.range(0, 12);
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
LuckyNumberWheel(
config: _config,
controller: _controller,
width: 300,
height: 300,
onStart: () {
_controller.play();
},
onEnd: (result) => debugPrint('Number: ${result.prize?.number}'),
),
TextButton(
onPressed: () {
_controller.stopNumber(8);
},
child: const Text('Server result'),
),
],
);
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
Drawing lots #
Shake the cylinder, a stick comes out and unfolds. weight sets the default odds; stop(0) forces stick 0.
import 'package:flutter/material.dart';
import 'package:luckdraw/lots.dart';
class LotsDemo extends StatefulWidget {
const LotsDemo({super.key});
@override
State<LotsDemo> createState() => _LotsDemoState();
}
class _LotsDemoState extends State<LotsDemo> {
final _controller = LotsController();
static const _config = LotsConfig(sticks: [
LotsStick(label: 'Great luck', weight: 1),
LotsStick(label: 'Good luck', weight: 2),
LotsStick(label: 'Small luck', weight: 3),
]);
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
LuckyLots(
config: _config,
controller: _controller,
width: 300,
height: 400,
onStart: () {
_controller.play();
},
onEnd: (result) => debugPrint('Lots: ${result.prize?.label}'),
),
TextButton(
onPressed: () {
_controller.stop(0);
},
child: const Text('Server result'),
),
],
);
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
Super lotto #
LottoConfig.superLotto is the 5 + 2 preset. stopWith(LottoDraw(...)) applies a server-drawn set of numbers; onBallDrawn reports each ball as it appears.
import 'package:flutter/material.dart';
import 'package:luckdraw/lotto.dart';
class LottoDemo extends StatefulWidget {
const LottoDemo({super.key});
@override
State<LottoDemo> createState() => _LottoDemoState();
}
class _LottoDemoState extends State<LottoDemo> {
final _controller = LottoController();
static final _config = LottoConfig.superLotto(
options: const LottoOptions(physics: LuckyPhysics()),
);
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
LuckyLotto(
config: _config,
controller: _controller,
width: 300,
height: 400,
onStart: () {
_controller.play();
},
onBallDrawn: (pool, number) => debugPrint('Pool $pool: $number'),
onEnd: (result) => debugPrint('Lotto: ${result.draw?.numbers}'),
),
TextButton(
onPressed: () {
_controller.stopWith(const LottoDraw([
[7, 1, 18, 25, 35],
[12, 3],
]));
},
child: const Text('Server result'),
),
],
);
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
Controller #
A Controller must be attached to a game Widget (or to a headless clock) before its commands work.
A command that returns a bool tells you whether the request was accepted. For example, play()
returns false while a round is running, and a stop request during acceleration waits for deceleration.
| API | Use |
|---|---|
play() |
Start from idle, settled or idle-spinning. |
stop(index) |
Request a zero-based prize index, bypassing weights. |
stop() |
Let the picker select; the default is WeightedPrizePicker. |
pause() / resume() |
Freeze/unfreeze effective time without resetting the round. |
reset() |
Return to idle and reset position. |
cancel() |
Void a round; ignored once deceleration starts. |
phase.value / phaseChanges |
Read the current phase / subscribe to its lazy broadcast stream. |
frameListenable / frame |
Observe frames; treat the reused frame snapshot as read-only. |
lastResult |
Read the previous result; also available through Widget onEnd. |
For weighted selection, start a new round with play(), then call stop().
The wheel example has weights 3 and 1, giving probabilities 3/4 and 1/4.
Null, non-positive and NaN weights are not selectable; with no eligible weight,
selection cancels rather than choosing uniformly. Disabled prizes are excluded by default.
The grid and slot examples use explicit indices, so they do not require weights.
To wait for a server result, add this method to _WheelDemoState above.
Pass your own request function; it must return a valid index for the current prize list.
Run one request at a time and do not change the list until it finishes.
Future<void> drawFromServer(Future<int> Function() requestIndex) async {
if (!_controller.play()) return;
try {
final index = await requestIndex();
if (!mounted) return;
_controller.stop(index);
} catch (_) {
if (mounted) _controller.cancel();
rethrow;
}
}
Or use WheelController.playUntil(resolveIndex, minSpinDuration: ...). It does start,
async selection and stop in one call and returns Future<LuckyResult<WheelPrize>>.
Its resolver is FutureOr<int?> Function(); for slots the resolver returns List<int>? covering all reels.
To watch phase changes, add this method to _WheelDemoState and pass a Future that marks
the end of the observation period. The subscription is cancelled when it completes.
To let the Widget manage the callback for you, use onPhaseChanged.
Future<void> observePhases(Future<void> untilDone) async {
final subscription = _controller.phaseChanges.listen((phase) {
debugPrint('Phase: $phase');
});
try {
await untilDone;
} finally {
await subscription.cancel();
}
}
Import only what you use #
All paths below are under package:luckdraw/. Game entries also export the core
user API from luckdraw.dart; that core entry does not export game Widgets.
| Entry | Purpose |
|---|---|
wheel.dart |
LuckyWheel, wheel configuration and Controller. |
grid.dart |
LuckyGrid, grid configuration and Controller. |
slot.dart |
LuckySlotMachine and the LuckyLeverSlotMachine variant. |
capsule.dart |
LuckyCapsuleMachine, capsule configuration and Controller. |
number_wheel.dart |
LuckyNumberWheel, numbered pockets and Controller. |
lots.dart |
LuckyLots, sticks and Controller. |
lotto.dart |
LuckyLotto, number pools, sampling and Controller. |
compat.dart |
JSON converters and CSS parsers; does not re-export games. |
extend.dart |
Custom game/rendering SPI, clocks and core user APIs exported directly from src/core/. |
testing.dart |
ManualLuckyClock, SequenceRandom, LuckyFrameRecorder. |
Core does not depend on any game, games do not depend on each other, and compat is only used when you import it. Nothing registers itself globally; the optional registry is created and owned by the caller. Dart tree-shakes by reachability, so re-exporting core does not keep every core type. ARCHITECTURE §17 records web builds that succeeded and source/symbol checks on all ten package probes, with size budgets set from measured sizes. The APK backend only parses existing size reports. Its CI job is disabled until real builds exist.
Migrate from lucky-canvas #
Choose the converter for your game; there is no universal JSON dispatcher:
| Converter | Converted configuration |
|---|---|
wheelFromLuckyCanvasConfig |
Wheel |
gridFromLuckyCanvasConfig |
Nine-grid |
slotFromLuckyCanvasConfig |
Slot machine |
import 'package:flutter/widgets.dart';
import 'package:luckdraw/compat.dart';
import 'package:luckdraw/wheel.dart';
Widget migratedWheel(Map<String, Object?> json) {
final converted = wheelFromLuckyCanvasConfig(json,
options: LuckyCanvasCompatOptions.strictUpstream());
for (final warning in converted.warnings) {
debugPrint(warning.toString());
}
return LuckyWheel(config: converted.config,
width: converted.width, height: converted.height,
alignment: Alignment.topLeft);
}
If the JSON has no dimensions, put this Widget in a parent with bounded constraints.
For ordinary migration, const LuckyCanvasCompatOptions(remBase: 16) gives the default behavior.
Only compat parses CSS strings. Typed configuration uses Color, LuckyFill
and logical pixels, plus LuckyLength.px/percent on fields that support them.
The 1:1 comparison is validated against npm lucky-canvas 1.7.26. Its baselines are locked by SHA-256,
and the source reference is recorded in NOTICE.
strictUpstream() selects LuckyTimebase.frame and UpstreamStopSolver; controlled comparisons
also need the same random sequences, fonts and assets. All 6720 numeric frames across 16 cases
match exactly after the documented mappings. Keyframes pass explicit standard, text-heavy and edge-aa
tolerances; the limits are in TEST_STRATEGY §6.5.
Default mode uses LuckyTimebase.time and MonotonicStopSolver. The intentional differences are:
- Guards against reversed or zero-displacement stops, invalid input and time jumps after returning from the background.
- Progressive images, error/fallback callbacks and controlled configuration/size updates.
- Text is split by Unicode code point. Flutter renders fonts, antialiasing and shadows differently.
onEndfires on the settled tick, not one tick later. Slot deceleration keeps its starting scroll.- Slots draw only the visible window and clip per reel, instead of using a long offscreen image.
- An invalid
stopEachlength throws. There are no DOM or platform wrappers and no source-compatible image formatter.
Strict mode keeps the documented fixes and deviations. It does not reproduce every upstream bug. See FIDELITY §8 for the full list and comparison exclusions, and UPSTREAM_ISSUES for the research behind the mitigations. The added games have separate acceptance tests; the lotto preset draws 5 of 35 and 2 of 12 without replacement. It is an animation component, not a real lottery service.
Extend #
Use extend.dart to implement a custom LuckyGame and LuckyRenderer, then pass implementations
explicitly. Renderers read layout and frame data; LuckyEasing and PrizePicker replace easing
and selection. The default backend uses Canvas; custom backends can return other Widgets.
The example below swaps only the renderer of a wheel; game logic and the Controller stay the same.
import 'package:flutter/material.dart';
import 'package:luckdraw/extend.dart';
import 'package:luckdraw/wheel.dart';
final class IndexRenderer extends LuckyRenderer<WheelConfig, WheelLayout,
WheelFrame, LuckyResult<WheelPrize>> {
const IndexRenderer();
@override
Widget buildSurface(BuildContext context,
LuckySurfaceData<WheelConfig, WheelLayout, WheelFrame> data) =>
Center(child: Text('pointer: ${data.frame.pointerIndex}'));
}
Widget customWheel(WheelController controller, WheelConfig config) =>
LuckyWheel(
config: config,
controller: controller,
renderer: const IndexRenderer(),
);
See ARCHITECTURE §6 for the extension contract.
Testing #
testing.dart provides ManualLuckyClock (advance time by hand), SequenceRandom (replay fixed random
values) and LuckyFrameRecorder (record frames). A Controller can run headless, without any Widget:
import 'package:luckdraw/testing.dart';
import 'package:luckdraw/wheel.dart';
///
int? runHeadlessWheel() {
final clock = ManualLuckyClock();
final controller = WheelController(random: SequenceRandom([0.5]));
controller.attachHeadless(
clock: clock,
config: const WheelConfig(prizes: [
WheelPrize(texts: [LuckyText('A')]),
WheelPrize(texts: [LuckyText('B')]),
WheelPrize(texts: [LuckyText('C')]),
]),
);
controller.play();
controller.stop(2);
while (controller.phase != LuckyPhase.settled) {
clock.advanceFrames(1);
}
final index = controller.lastResult!.index;
controller.dispose();
clock.dispose();
return index;
}
Performance #
All numbers below come from one vivo V2417 (Android 16). They are not a cross-device guarantee. Sections are listed newest first, and each older section only describes its own scope.
STEADY (2026-11-11): with instrumentation, grid, slot and lotto still fail the frozen gates. Lots passes in this run's three rounds. Wheel median CPU: process 39.291%, UI+platform 14.931%, Raster 18.299%. A lotto preparation-reuse candidate showed no stable net benefit and was reverted. See the STEADY report.
INSTR (2026-11-11, candidate tried on a copy of the code): caching exact text widths cut cold-frame TextPainter.layout calls for wheel/grid from 276/128 to 63/22. Median build time with instrumentation fell from 38.412/24.214 ms to 27.075/12.993 ms. Output stays equivalent for random, multilingual, emoji and lineClamp text. Subtracting the historical DEVFIN blank (2.883 ms) gives increments of 24.192/10.110 ms. The calibrated increment budgets are 26.612/11.121 ms. Both still miss the original 4 ms target, and the three rounds vary a lot. CPU uses /proc tick deltas and actual host intervals; UI and platform are reported together as UI+platform. Wheel has only 2/5 complete driver runs, so there is no three-run median. Lotto CPU covers only the mixing phase. The library changes are delivered as patches for the shared workspace and are not merged yet. See the INSTR report. The DEVFIN and MET2 text below is historical. It does not mean performance fully passes.
DEVFIN (2026-11-11) reran four scenes, three rounds each. grid_steady failed, slot_raster failed, lots_shaking is uncertain, and lotto_draw failed. The gates (12 ms combined, 4 ms UI p99) were not relaxed. Cold-push UI increments (wheel/grid/slot minus blank) were 38.087/10.520/0.245 ms; the calibrated increment budgets are 41.896/11.572/0.270 ms. Wheel and grid miss the original 4 ms estimate. Driver summaries for wheel/grid succeeded only 2/5 and 1/5 times, so the raw FrameTiming responses were kept separately. All five CPU projects had 0/5 valid attempts because the native statistics referred to stale intervals and PIDs. CPU is still unmeasured, and the collection did not pass. Calibration does not mean the design targets were met. The DEVFIN report lists the delivery results of all sustained-animation windows and the hard gates per round, and keeps the missing CPU data and driver failures visible.
The MET2 results below are the historical baseline. DEVFIN replaces only the four scenes it retested; the other scenes were not rerun.
LuckyCacheMode.auto uses bounded bitmap caching while supported segments move and vector replay when idle. Strict upstream comparison keeps picture.
MET2 (2026-11-10, offline recalculation): all 130 saved steady windows delivered about 60 fps (59.829927 to 60.176516), with complete frame delivery and no real dropped frames by the timeline delivery check. Some Raster windows are contaminated by vsync backpressure unrelated to drawing content (the reference square shows it too), so they cannot give the pure drawing cost. Initial regression budgets were calibrated from the measured device data. This does not mean all original design targets were met: one item meets its effective target (memory, with the FIN RSS method), five scenes are calibrated but miss the original targets, three scenes fail, one is uncertain, and the cold first frame is informational only.
Memory meets its effective RSS target. Wheel, slot_steady, lever, capsule and number_wheel pass calibrated regression budgets while missing original design targets. Grid, slot_raster and lotto fail the per-clean-window headroom gates (combined build+raster p99 at most 12 ms, UI p99 at most 4 ms): combined maxima are 12.231, 16.905 and 12.229 ms respectively, and lotto UI p99 reaches 4.386 ms. Lots stays uncertain because clean Raster costs vary too much; it needs a new controlled run.
Scenes that miss the original design targets (measured median / original target − 1):
| Scene | Metric and gap |
|---|---|
| wheel_steady | Raster average +1.99% |
| grid_steady | UI average +70.72%, UI P90 +18.67%, Raster average +37.49% |
| slot_steady | UI average +35.76% |
| slot_raster | UI average +6.41% |
| lever_steady | UI average +39.99%, UI P90 +4.80% |
| capsule_mixing | UI average +10.27% |
| number_wheel_spin | UI average +13.57% |
| lots_shaking | UI average +37.82%, UI P90 +1.20% |
| lotto_draw | UI average +47.92%, UI P90 +10.75% |
Ratio stability uses a 1 percentage point absolute tolerance. Timings with a median under 0.5 ms use 0.15 ms, and other timings use a 30% relative range. Normal comparisons use the frozen calibrated budgets. RSS keeps five cycles, an informational warmup and a 1.5 MiB steady-growth gate. The cold first frame (40.378 ms) and process CPU wait for the next device session. CPU busy values are estimates from frame durations, not measured process CPU.
The MET2 sample mixes DEV/PERF sample identities, as MET did, so it is not a single-APK rerun. See the metric correction report and the MET2 per-metric results.
License #
Apache-2.0. Based on lucky-canvas by Li Dong Qi (ldq), copyright 2021; luckdraw copyright 2026 codejoo. Preserve the upstream attribution in NOTICE.