perf(editor): native Windows preview and UI-first timeline navigation (#11)
Gitea CI / Check code and tests (push) Successful in 8m7s
Gitea CI / Build Windows x64 app (push) Successful in 5m48s
Gitea CI / Build Android APK (push) Successful in 5m59s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m17s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m22s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea CI / Check code and tests (push) Successful in 8m7s
Gitea CI / Build Windows x64 app (push) Successful in 5m48s
Gitea CI / Build Android APK (push) Successful in 5m59s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m17s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m22s
Gitea CI / Gitea CI passed (push) Successful in 2s
This commit was merged in pull request #11.
This commit is contained in:
1 parent
0ecf920669
commit
b4cb12cbe3
36 files changed
+3292
-148
No files matched your search
@@ -0,0 +1,109 @@
|
||||
import 'package:cutdex/diagnostics/full_app_viewport_bench/config.dart';
|
||||
import 'package:cutdex/diagnostics/full_app_viewport_bench/workload.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
ViewportBenchConfig config([Map<String, String> values = const {}]) =>
|
||||
ViewportBenchConfig.fromEnvironment({
|
||||
'CUTDEX_FULL_APP_VIEWPORT_BENCH': 'benchmark-output',
|
||||
'CUTDEX_FULL_APP_VIEWPORT_PAIRED': '1',
|
||||
...values.map(
|
||||
(key, value) => MapEntry('CUTDEX_FULL_APP_VIEWPORT_$key', value),
|
||||
),
|
||||
});
|
||||
|
||||
void main() {
|
||||
group('Full editor benchmark inputs', () {
|
||||
test('existing MIDE trajectory and six-second schedule stay unchanged', () {
|
||||
final workloads = ViewportBenchWorkload.forTimeline(
|
||||
config({'LOCAL_START_FRAME': '60137', 'EXPECTED_FRAMES': '214073.82'}),
|
||||
214073.82,
|
||||
);
|
||||
final wide = workloads[0], local = workloads[1];
|
||||
expect(wide.count, 360);
|
||||
expect(wide.hz, 60);
|
||||
expect(wide.durationMs, 6000);
|
||||
expect(
|
||||
[
|
||||
wide.idealFrame(0),
|
||||
wide.idealFrame(179),
|
||||
wide.idealFrame(180),
|
||||
wide.idealFrame(359),
|
||||
],
|
||||
[10704, 203370, 203370, 10704],
|
||||
);
|
||||
expect(
|
||||
[
|
||||
local.idealFrame(0),
|
||||
local.idealFrame(20),
|
||||
local.idealFrame(21),
|
||||
local.idealFrame(39),
|
||||
local.idealFrame(359),
|
||||
],
|
||||
[60137, 60157, 60156, 60138, 60138],
|
||||
);
|
||||
expect(local.cameraBaseFrame, 60120);
|
||||
expect(local.warmFrame, 60136);
|
||||
});
|
||||
|
||||
test(
|
||||
'another timeline derives local targets without a media-specific length',
|
||||
() {
|
||||
final workloads = ViewportBenchWorkload.forTimeline(config(), 10000);
|
||||
expect(workloads[1].idealFrame(0), 2800);
|
||||
expect(workloads[1].idealFrame(20), 2820);
|
||||
expect(config().expectedFrames, isNull);
|
||||
expect(config().nativeOnly, isTrue);
|
||||
expect(config().captureHelper, isNull);
|
||||
},
|
||||
);
|
||||
|
||||
test('rate, frame count and local span can change without escaping the timeline', () {
|
||||
final workloads = ViewportBenchWorkload.forTimeline(
|
||||
config({
|
||||
'INPUT_HZ': '120',
|
||||
'INPUT_COUNT': '720',
|
||||
'LOCAL_START_FRAME': '100',
|
||||
'LOCAL_SPAN_FRAMES': '8',
|
||||
}),
|
||||
10000,
|
||||
);
|
||||
for (final workload in workloads) {
|
||||
expect(workload.durationMs, 6000);
|
||||
for (var i = 0; i < workload.count; i++) {
|
||||
expect(workload.idealFrame(i), inInclusiveRange(0, 9999));
|
||||
}
|
||||
}
|
||||
expect(workloads[1].idealFrame(8), 108);
|
||||
expect(workloads[1].idealFrame(9), 107);
|
||||
});
|
||||
|
||||
test(
|
||||
'invalid settings fail before starting native capture or a gesture',
|
||||
() {
|
||||
expect(() => config({'INPUT_HZ': '0'}), throwsArgumentError);
|
||||
expect(() => config({'INPUT_COUNT': '359'}), throwsArgumentError);
|
||||
expect(
|
||||
() => config({'LOCAL_PIXELS_PER_FRAME': 'NaN'}),
|
||||
throwsArgumentError,
|
||||
);
|
||||
expect(() => config({'ROUNDS': 'oops'}), throwsFormatException);
|
||||
expect(() => config({'PAIRED': 'yes'}), throwsArgumentError);
|
||||
expect(() => config({'NATIVE_ONLY': '0'}), throwsArgumentError);
|
||||
expect(
|
||||
() => ViewportBenchWorkload.forTimeline(
|
||||
config({'LOCAL_START_FRAME': '9990'}),
|
||||
10000,
|
||||
),
|
||||
throwsStateError,
|
||||
);
|
||||
expect(
|
||||
() => ViewportBenchWorkload.forTimeline(
|
||||
config({'EXPECTED_FRAMES': '20000'}),
|
||||
10000,
|
||||
),
|
||||
throwsStateError,
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user