Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

perf(screenshot): 修复 macOS 选区识别并优化截图录制性能

David8f212a6cf035
diff --git a/apps/desktop/native/region-screenshot/macos-snapshot.swift b/apps/desktop/native/region-screenshot/macos-snapshot.swift
index a12394c628..beb8d47a91 100644
--- a/apps/desktop/native/region-screenshot/macos-snapshot.swift
+++ b/apps/desktop/native/region-screenshot/macos-snapshot.swift
@@ -257,6 +257,10 @@ func screenInsets() -> [[String: Any]] {
}
}
+// AppKit's window hit-testing needs an application connection even in this
+// stdin-driven helper; without it windowNumber(at:) returns 0 for real windows.
+// Stay a background-only process: no Dock entry, activation or app event loop.
+NSApplication.shared.setActivationPolicy(.prohibited)
setvbuf(stdout, nil, _IOLBF, 0)
while let line = readLine() {
guard let data = line.data(using: .utf8),
diff --git a/apps/desktop/native/remote-desktop/macos-capture.m b/apps/desktop/native/remote-desktop/macos-capture.m
index 944293f2d8..8206cbf693 100644
--- a/apps/desktop/native/remote-desktop/macos-capture.m
+++ b/apps/desktop/native/remote-desktop/macos-capture.m
@@ -25,6 +25,76 @@ typedef CFTypeRef (*CreateStream)(CGDirectDisplayID, size_t, size_t, int32_t,
CFDictionaryRef, dispatch_queue_t, FrameHandler);
typedef CGError (*StartStream)(CFTypeRef);
+static NSData *encodeCaptureSurface(CIContext *context, CGColorSpaceRef color, IOSurfaceRef surface,
+ double quality, long frameLimit, BOOL overlay) {
+ CIImage *image = [CIImage imageWithIOSurface:surface];
+ NSData *jpeg = [context JPEGRepresentationOfImage:image colorSpace:color
+ options:@{(__bridge NSString *)kCGImageDestinationLossyCompressionQuality: @(quality)}];
+ NSUInteger limit = (NSUInteger)frameLimit;
+ if (overlay) {
+ for (NSNumber *q in @[@0.45, @0.25, @0.1]) {
+ if (jpeg.length <= limit) break;
+ jpeg = [context JPEGRepresentationOfImage:image colorSpace:color
+ options:@{(__bridge NSString *)kCGImageDestinationLossyCompressionQuality: q}];
+ }
+ // Bound high-detail screens without turning them into disconnects.
+ for (int attempt = 0; jpeg.length > limit && attempt < 4; attempt++) {
+ image = [image imageByApplyingTransform:CGAffineTransformMakeScale(0.75, 0.75)];
+ jpeg = [context JPEGRepresentationOfImage:image colorSpace:color
+ options:@{(__bridge NSString *)kCGImageDestinationLossyCompressionQuality: @0.25}];
+ }
+ }
+ return jpeg.length <= limit ? jpeg : nil;
+}
+
+// The serial capture queue owns this slot. Demand mode keeps only the newest
+// surface, without copying or encoding frames the recorder will never request.
+// Pinning both the CF object and its use count prevents WindowServer reuse
+// after the callback returns (CGDisplayStreamFrameAvailableHandler contract).
+@interface CaptureFrameStore : NSObject
+- (instancetype)initWithOnRequest:(BOOL)onRequest encoder:(NSData *(^)(IOSurfaceRef))encoder;
+- (void)acceptSurface:(IOSurfaceRef)surface;
+- (NSData *)jpeg;
+- (void)clear;
+@end
+@implementation CaptureFrameStore {
+ BOOL _onRequest;
+ IOSurfaceRef _surface;
+ NSData *_jpeg;
+ NSData *(^_encoder)(IOSurfaceRef);
+}
+- (instancetype)initWithOnRequest:(BOOL)onRequest encoder:(NSData *(^)(IOSurfaceRef))encoder {
+ if ((self = [super init])) { _onRequest = onRequest; _encoder = [encoder copy]; }
+ return self;
+}
+- (void)releaseSurface {
+ if (!_surface) return;
+ IOSurfaceDecrementUseCount(_surface);
+ CFRelease(_surface);
+ _surface = NULL;
+}
+- (void)acceptSurface:(IOSurfaceRef)surface {
+ if (_onRequest) {
+ CFRetain(surface);
+ IOSurfaceIncrementUseCount(surface);
+ [self releaseSurface];
+ _surface = surface;
+ _jpeg = nil;
+ } else {
+ _jpeg = _encoder(surface);
+ }
+}
+- (NSData *)jpeg {
+ if (_surface) {
+ _jpeg = _encoder(_surface);
+ [self releaseSurface];
+ }
+ return _jpeg;
+}
+- (void)clear { [self releaseSurface]; _jpeg = nil; }
+- (void)dealloc { [self releaseSurface]; }
+@end
+
@interface PrivacyCaptureOutput : NSObject <SCStreamOutput, SCStreamDelegate>
@property(copy) FrameHandler handler;
@property(strong) SCStream *stream;
@@ -116,8 +186,10 @@ static NSDictionary *readCursor(CGRect bounds) {
int main(int argc, const char *argv[]) {
@autoreleasepool {
- // Overlay: <display> cursor-overlay <fps> <quality> <physical max edge, 0 = logical> <max JPEG bytes> [excluded | window:<id>]
- BOOL overlay = (argc == 7 || argc == 8) && strcmp(argv[2], "cursor-overlay") == 0;
+ // Local recordings opt into deferred encoding; existing invocations stay eager.
+ // Overlay: <display> cursor-overlay[-demand] <fps> <quality> <physical max edge, 0 = logical> <max JPEG bytes> [excluded | window:<id>]
+ BOOL onRequest = (argc == 7 || argc == 8) && strcmp(argv[2], "cursor-overlay-demand") == 0;
+ BOOL overlay = onRequest || ((argc == 7 || argc == 8) && strcmp(argv[2], "cursor-overlay") == 0);
if (argc != 2 && argc != 3 && !overlay) return 2;
NSString *excluded = (overlay && argc == 8) || (!overlay && argc == 3)
? [NSString stringWithUTF8String:argv[argc - 1]] : @"";
@@ -179,7 +251,9 @@ int main(int argc, const char *argv[]) {
dispatch_queue_t queue = dispatch_queue_create("cindy.desktop.capture", DISPATCH_QUEUE_SERIAL);
CIContext *context = [CIContext contextWithOptions:@{ kCIContextCacheIntermediates: @NO }];
CGColorSpaceRef color = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
- __block NSData *latest = nil;
+ CaptureFrameStore *frames = [[CaptureFrameStore alloc] initWithOnRequest:onRequest encoder:^NSData *(IOSurfaceRef surface) {
+ return encodeCaptureSurface(context, color, surface, quality, frameLimit, overlay);
+ }];
__block BOOL requested = NO;
atomic_store(&lastRequest, time(NULL));
// The first system cursor read can block on WindowServer for many seconds.
@@ -199,7 +273,9 @@ int main(int argc, const char *argv[]) {
});
};
void (^reply)(void) = ^{
- if (!requested || !latest) return;
+ if (!requested) return;
+ NSData *latest = [frames jpeg];
+ if (!latest) return;
requested = NO;
NSData *data;
if (overlay) {
@@ -224,26 +300,9 @@ int main(int argc, const char *argv[]) {
FrameHandler receiveFrame = ^(int32_t status, uint64_t timestamp, IOSurfaceRef surface, const void *update) {
@autoreleasepool {
if (status == 3) _exit(5); // stopped; never serve the previous session's frame
- if (status == 2) { latest = nil; return; } // blank display
+ if (status == 2) { [frames clear]; return; } // blank display
if (status != 0 || !surface) return;
- CIImage *image = [CIImage imageWithIOSurface:surface];
- NSData *jpeg = [context JPEGRepresentationOfImage:image colorSpace:color
- options:@{(__bridge NSString *)kCGImageDestinationLossyCompressionQuality: @(quality)}];
- NSUInteger limit = (NSUInteger)frameLimit;
- if (overlay) {
- for (NSNumber *q in @[@0.45, @0.25, @0.1]) {
- if (jpeg.length <= limit) break;
- jpeg = [context JPEGRepresentationOfImage:image colorSpace:color
- options:@{(__bridge NSString *)kCGImageDestinationLossyCompressionQuality: q}];
- }
- // Bound high-detail screens without turning them into disconnects.
- for (int attempt = 0; jpeg.length > limit && attempt < 4; attempt++) {
- image = [image imageByApplyingTransform:CGAffineTransformMakeScale(0.75, 0.75)];
- jpeg = [context JPEGRepresentationOfImage:image colorSpace:color
- options:@{(__bridge NSString *)kCGImageDestinationLossyCompressionQuality: @0.25}];
- }
- }
- latest = jpeg.length <= limit ? jpeg : nil;
+ [frames acceptSurface:surface];
reply();
}
};
diff --git a/apps/desktop/scripts/benchmark-macos-demand-capture.mjs b/apps/desktop/scripts/benchmark-macos-demand-capture.mjs
new file mode 100644
index 0000000000..4b007df513
--- /dev/null
+++ b/apps/desktop/scripts/benchmark-macos-demand-capture.mjs
@@ -0,0 +1,57 @@
+#!/usr/bin/env node
+// Explicit native integration benchmark; no display access or user image files.
+// The baseline JPEG body is taken verbatim from the selected pre-change helper.
+import assert from 'node:assert/strict';
+import { execFile, spawn } from 'node:child_process';
+import { createInterface } from 'node:readline';
+import { mkdtemp, readFile, writeFile, rm } from 'node:fs/promises';
+import { fileURLToPath } from 'node:url';
+import { promisify } from 'node:util';
+import os from 'node:os';
+import path from 'node:path';
+const exec = promisify(execFile);
+const option = name => process.argv.find(arg => arg.startsWith(`--${name}=`))?.slice(name.length + 3);
+const root = fileURLToPath(new URL('../../..', import.meta.url));
+const relative = 'apps/desktop/native/remote-desktop/macos-capture.m';
+assert.equal(process.platform, 'darwin', 'Requires macOS');
+const samples = Number(option('samples') ?? 20);
+assert(Number.isInteger(samples) && samples > 0 && samples <= 100);
+const temp = await mkdtemp(path.join(os.tmpdir(), 'cindy-demand-perf-'));
+let child;
+const summary = raw => { const sorted = [...raw].sort((a,b)=>a-b); return { p50:sorted[Math.floor(sorted.length/2)], p95:sorted[Math.ceil(sorted.length*.95)-1] }; };
+try {
+ const baseline = option('baseline-dir')
+ ? await readFile(path.join(option('baseline-dir'), relative), 'utf8')
+ : (await exec('git', ['show', `8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0:${relative}`], { cwd:root })).stdout;
+ const start = baseline.indexOf('CIImage *image = [CIImage imageWithIOSurface:surface];');
+ const end = baseline.indexOf('latest = jpeg.length <= limit ? jpeg : nil;', start);
+ assert(start >= 0 && end > start, 'Baseline must contain the original eager encoder');
+ const codec = baseline.slice(start, end) + 'return jpeg.length <= limit ? jpeg : nil;';
+ const fixture = await readFile(new URL('./fixtures/region-capture/macos-demand.m', import.meta.url), 'utf8');
+ const source = path.join(temp, 'benchmark.m'), binary = path.join(temp, 'benchmark');
+ await writeFile(source, `#define main captureHelperMain\n#include ${JSON.stringify(path.join(root, relative))}\n#undef main\n` +
+ `static NSData *baselineEncode(CIContext *context, CGColorSpaceRef color, IOSurfaceRef surface, double quality, long frameLimit, BOOL overlay) {\n${codec}\n}\n${fixture}`);
+ await exec('xcrun', ['clang', source, '-fobjc-arc', '-fblocks', '-O2',
+ ...['Foundation','AppKit','CoreGraphics','CoreImage','IOSurface','ImageIO','IOKit','ScreenCaptureKit','CoreMedia','CoreVideo'].flatMap(name=>['-framework',name]),
+ '-o', binary], { timeout:120000 });
+ const rows = [];
+ child = spawn(binary, [String(samples)], { stdio:['ignore','pipe','inherit'] });
+ const completed = new Promise((resolve,reject)=>{ child.once('error',reject); child.once('exit',code=>code===0 ? resolve() : reject(new Error(`Native checks exited ${code}`))); });
+ // Attach immediately so a native assertion failure cannot become unhandled.
+ void completed.catch(()=>{});
+ const timeout = setTimeout(()=>child.kill('SIGKILL'), 180000);
+ try {
+ for await (const line of createInterface({ input:child.stdout })) {
+ const row = JSON.parse(line); rows.push(row);
+ console.log(JSON.stringify(row.roundMs ? {...row,roundMs:summary(row.roundMs),requestMs:summary(row.requestMs)} : row));
+ }
+ await completed;
+ } finally { clearTimeout(timeout); }
+ const report = { generatedAt:new Date().toISOString(), platform:process.platform, arch:process.arch,
+ cpu:os.cpus()[0].model, baseline:option('baseline-dir') ?? '8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0',
+ scope:'Synthetic IOSurfaces, actual native codec and frame slot. 3 system updates per requested frame; not measured desktop FPS or app CPU.', rows };
+ if(option('output')) await writeFile(path.resolve(option('output')), JSON.stringify(report,null,2)+'\n');
+} finally {
+ if(child && child.exitCode===null && child.signalCode===null) child.kill('SIGKILL');
+ await rm(temp, { recursive:true, force:true });
+}
diff --git a/apps/desktop/scripts/benchmark-macos-live-capture.mjs b/apps/desktop/scripts/benchmark-macos-live-capture.mjs
new file mode 100644
index 0000000000..8e0de9c052
--- /dev/null
+++ b/apps/desktop/scripts/benchmark-macos-live-capture.mjs
@@ -0,0 +1,112 @@
+#!/usr/bin/env node
+// Explicit interactive macOS benchmark. Covers one display with generated
+// pixels, runs real pre/post capture helpers, then closes all owned processes.
+// Images stay in memory; no clipboard access or screenshot upload.
+import assert from 'node:assert/strict';
+import { execFile, spawn } from 'node:child_process';
+import { promisify } from 'node:util';
+import { mkdtemp, writeFile, rm } from 'node:fs/promises';
+import { createInterface } from 'node:readline';
+import { once } from 'node:events';
+import { fileURLToPath } from 'node:url';
+import { setTimeout as delay } from 'node:timers/promises';
+import { createHash } from 'node:crypto';
+import os from 'node:os';
+import path from 'node:path';
+const exec = promisify(execFile);
+const option = name => process.argv.find(arg=>arg.startsWith(`--${name}=`))?.slice(name.length+3);
+const root = fileURLToPath(new URL('../../..', import.meta.url));
+const relative = 'apps/desktop/native/remote-desktop/macos-capture.m';
+assert.equal(process.platform,'darwin');
+const temp = await mkdtemp(path.join(os.tmpdir(),'cindy-live-perf-'));
+const children = [];
+const report = { generatedAt:new Date().toISOString(), rows:[] };
+const summary = raw => { const v=[...raw].sort((a,b)=>a-b); return { p50:v[Math.floor(v.length/2)],p95:v[Math.ceil(v.length*.95)-1] }; };
+function connection(executable,args) {
+ const child = spawn(executable,args,{stdio:'pipe'}); children.push(child);
+ let pending, stderr='';
+ child.stderr.on('data',chunk=>{stderr+=chunk;});
+ const queue=[];
+ const fail=error=>{ pending?.reject(error);pending=null; };
+ child.once('error',fail);child.stdin.on('error',fail);
+ const exit=once(child,'exit'); void exit.catch(()=>{});
+ child.once('exit',(code,signal)=>fail(new Error(`Native helper exited code=${code} signal=${signal}`)));
+ createInterface({input:child.stdout}).on('line',line=>{
+ if(pending){const task=pending;pending=null;task.resolve(line);}else queue.push(line);
+ });
+ return { child, exit, stderr:()=>stderr, read(timeout=10000) {
+ if(queue.length)return Promise.resolve(queue.shift());
+ assert(!pending,'Only one frame request may be in flight');
+ return new Promise((resolve,reject)=>{
+ const timer=setTimeout(()=>{pending=null;reject(new Error('Native response timeout'));},timeout);
+ pending={resolve:value=>{clearTimeout(timer);resolve(value);},reject:error=>{clearTimeout(timer);reject(error);}};
+ });
+ }};
+}
+async function request(client,bytes){const value=client.read();client.child.stdin.write(bytes);return value;}
+async function close(client) {
+ if(client.child.exitCode!==null||client.child.signalCode!==null)return;
+ const timer=setTimeout(()=>client.child.kill('SIGKILL'),2000);
+ client.child.stdin.end();
+ try{await client.exit;}finally{clearTimeout(timer);}
+}
+try {
+ const baseline=(await exec('git',['show',`8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0:${relative}`],{cwd:root})).stdout;
+ const before=path.join(temp,'before.m');await writeFile(before,baseline);
+ for(const [side,source] of [['before',before],['after',path.join(root,relative)]]) {
+ await exec('xcrun',['clang',source,'-fobjc-arc','-fblocks','-O2',
+ ...['Foundation','AppKit','CoreGraphics','CoreImage','IOSurface','ImageIO','IOKit','ScreenCaptureKit','CoreMedia','CoreVideo'].flatMap(name=>['-framework',name]),
+ '-o',path.join(temp,side)],{timeout:120000});
+ }
+ await exec('xcrun',['swiftc',path.join(root,'apps/desktop/scripts/fixtures/region-capture/macos-recording-pattern.swift'),'-O','-o',path.join(temp,'pattern')],{timeout:120000});
+ const fixture=connection(path.join(temp,'pattern'),[]);
+ report.display=JSON.parse(await fixture.read());
+ console.log(JSON.stringify({display:report.display}));
+ await delay(300); // Explicit live integration: wait for WindowServer composition.
+ await request(fixture,'moving\n');
+ for(const side of ['before','after','after','before']) {
+ const client=connection('/usr/bin/time',['-l',path.join(temp,side),String(report.display.display),
+ side==='after'?'cursor-overlay-demand':'cursor-overlay','30','0.9','3840','3000000']);
+ const cold=performance.now();
+ const first=JSON.parse(await request(client,'f'));
+ assert(first.jpeg && Buffer.from(first.jpeg,'base64').subarray(0,2).equals(Buffer.from([255,216])));
+ const coldMs=performance.now()-cold;
+ const raw=[],sizes=[];const start=performance.now();
+ for(let i=0;i<30;i++) {
+ const tick=performance.now();
+ const frame=JSON.parse(await request(client,'f'));
+ assert(frame.jpeg);
+ raw.push(performance.now()-tick);sizes.push(Buffer.byteLength(frame.jpeg,'base64'));
+ await delay(Math.max(0,100-(performance.now()-tick)));
+ }
+ const sampleMs=performance.now()-start;
+ // Pause while the source keeps changing, then request another frame.
+ await delay(1000);
+ const resumed=JSON.parse(await request(client,'f'));assert(resumed.jpeg);
+ // A truly static display remains available without waiting for a new update.
+ await request(fixture,'static\n');await delay(150);
+ const staticA=JSON.parse(await request(client,'f'));
+ const staticB=JSON.parse(await request(client,'f'));
+ assert.equal(staticB.jpeg,staticA.jpeg);
+ await close(client);
+ const timing=client.stderr().match(/([\d.]+) real\s+([\d.]+) user\s+([\d.]+) sys/);
+ assert(timing,client.stderr());
+ const rss=client.stderr().match(/(\d+)\s+maximum resident set size/);
+ const row={side,coldMs,raw,requestMs:summary(raw),sampleMs,frames:30,
+ actualRequestsPerSecond:30000/sampleMs,cpuSeconds:Number(timing[2])+Number(timing[3]),
+ realSeconds:Number(timing[1]),maxRssBytes:rss?Number(rss[1]):null,meanJpegBytes:sizes.reduce((a,b)=>a+b,0)/sizes.length,
+ staticSha256:createHash('sha256').update(Buffer.from(staticA.jpeg,'base64')).digest('hex'),staticRepeatIdentical:true};
+ report.rows.push(row);console.log(JSON.stringify({...row,raw:undefined}));
+ await request(fixture,'moving\n');
+ }
+ await close(fixture);
+ report.scope='Actual system capture + native encoding + base64/pipe; generated moving desktop. Excludes Electron crop, GIF/video encoding. CPU includes cold start, 3 seconds sampled recording, 1 second pause and static repeat.';
+ if(option('output'))await writeFile(path.resolve(option('output')),JSON.stringify(report,null,2)+'\n');
+} finally {
+ for(const child of children.reverse()) {
+ if(child.exitCode!==null||child.signalCode!==null)continue;
+ const ended=once(child,'exit');const timer=setTimeout(()=>child.kill('SIGKILL'),2000);
+ child.stdin.end();try{await ended;}finally{clearTimeout(timer);}
+ }
+ await rm(temp,{recursive:true,force:true});
+}
diff --git a/apps/desktop/scripts/benchmark-region-native.mjs b/apps/desktop/scripts/benchmark-region-native.mjs
new file mode 100644
index 0000000000..a628d71cda
--- /dev/null
+++ b/apps/desktop/scripts/benchmark-region-native.mjs
@@ -0,0 +1,133 @@
+#!/usr/bin/env node
+// Explicit Electron benchmark: production live-region entry, synthetic sources.
+// No screen access, clipboard, user profile or save-dialog automation.
+import { build } from 'esbuild';
+import { execFile } from 'node:child_process';
+import { promisify } from 'node:util';
+import { mkdtemp, writeFile, rm, readFile } from 'node:fs/promises';
+import { createRequire } from 'node:module';
+import os from 'node:os';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const option = name => process.argv.find(arg => arg.startsWith(`--${name}=`))?.slice(name.length + 3);
+const desktop = fileURLToPath(new URL('..', import.meta.url));
+const root = path.resolve(desktop, '../..');
+const baseline = option('baseline-dir');
+if (process.platform !== 'darwin') throw new Error('Requires macOS');
+if (option('side') && !['before', 'after'].includes(option('side'))) throw new Error('--side must be before or after');
+if (!baseline) throw new Error('--baseline-dir is required');
+const temp = await mkdtemp(path.join(os.tmpdir(), 'cindy-native-perf-'));
+try {
+ for (const side of ['before', 'after']) {
+ const contents = await readFile(path.join(side === 'before' ? baseline : root, 'apps/desktop/src/main/region-screenshot/liveCapture.ts'), 'utf8');
+ await build({ stdin: { contents, loader: 'ts', resolveDir: path.join(desktop, 'src/main/region-screenshot') },
+ bundle: true, platform: 'node', format: 'cjs', outfile: path.join(temp, `${side}.cjs`),
+ plugins: [{ name: 'synthetic-capture-only', setup(b) {
+ b.onResolve({ filter: /^electron$/ }, args => args.namespace === 'fixture' ? { path: 'electron', external: true } : { path: 'electron', namespace: 'fixture' });
+ b.onResolve({ filter: /remote-desktop\/nativeCapture$/ }, () => ({ path: 'native', namespace: 'fixture' }));
+ b.onResolve({ filter: /remote-desktop\/captureSource$/ }, () => ({ path: 'sources', namespace: 'fixture' }));
+ b.onLoad({ filter: /.*/, namespace: 'fixture' }, ({ path: name }) => ({ contents: name === 'electron'
+ ? `const electron = require('electron'); exports.nativeImage = electron.nativeImage; exports.screen = electron.screen;
+ exports.desktopCapturer = { getSources: async () => globalThis.captureFixture.sources };`
+ : name === 'native' ? `exports.NativeDesktopCapture = class { async frame() { return { jpeg: globalThis.captureFixture.jpeg }; } stop() {} };`
+ : 'exports.enumerateDesktopSources = async operation => operation();', loader: 'js' }));
+ } }], external: ['electron'], logLevel: 'silent' });
+ }
+ await build({ entryPoints: [path.join(desktop, 'src/main/region-screenshot/encodeImage.ts')],
+ bundle: true, platform: 'node', format: 'cjs', outfile: path.join(temp, 'encode.cjs'),
+ plugins: [{ name: 'installed-sharp', setup(b) { b.onResolve({ filter: /^sharp$/ }, () => ({ path: createRequire(import.meta.url).resolve('sharp'), external: true })); } }], logLevel: 'silent' });
+ const entry = path.join(temp, 'main.cjs');
+ await writeFile(entry, `const { app, nativeImage } = require('electron');
+const fs = require('node:fs'); const assert = require('node:assert/strict');
+const crypto = require('node:crypto');
+app.setPath('userData', ${JSON.stringify(path.join(temp, 'profile'))});
+const summary = raw => { const v = [...raw].sort((a,b)=>a-b); return { p50: v[Math.floor(v.length/2)], p95: v[Math.ceil(v.length*.95)-1] }; };
+app.whenReady().then(async () => {
+ const report = { generatedAt: new Date().toISOString(), platform: process.platform, arch: process.arch,
+ electron: process.versions.electron, capture: [], save: [] };
+ const data = Buffer.alloc(3840*2160*4);
+ for (let i=0;i<data.length;i+=4) { data[i]=(i*13+(i>>>12))%256; data[i+1]=(i>>>8)%256; data[i+2]=(i>>>16)%256; data[i+3]=255; }
+ const image = nativeImage.createFromBitmap(data, { width:3840, height:2160 });
+ globalThis.captureFixture = { jpeg: image.toJPEG(90).toString('base64'), sources:[{display_id:'1',thumbnail:image}] };
+ const display={id:1,bounds:{x:0,y:0,width:1920,height:1080},scaleFactor:2};
+ const modules = { before: require('./before.cjs'), after: require('./after.cjs') };
+ if (!['save','parity'].includes(${JSON.stringify(option('only'))})) for (const [mode,selection] of [
+ ['gif',{x:13,y:17,width:400,height:250}],
+ ['video',{x:13,y:17,width:960,height:540}],
+ ['scroll',{x:13,y:17,width:1600,height:1000}],
+ ['gif',{x:13,y:17,width:1200,height:800}],
+ ]) {
+ let baseline;
+ for (const side of ['before','after','after','before']) {
+ const capture = new modules[side].RegionVideoCapture({}); const raw=[];
+ let frame;
+ for(let i=-3;i<30;i++) {
+ const start=performance.now();
+ frame=mode==='scroll' ? await modules[side].captureLiveRegion(display,selection,mode) : await capture.frame(display,selection,mode);
+ if(i>=0)raw.push(performance.now()-start);
+ }
+ const value={width:frame.width,height:frame.height,pixels:Buffer.from(frame.data)};
+ if(!baseline)baseline=value; else assert.deepEqual(value,baseline,'Every returned BGRA byte must match');
+ capture.stop();
+ const row={side,mode,selection,raw,...summary(raw),bytes:frame.data.length,hash:crypto.createHash('sha256').update(frame.data).digest('hex')};
+ report.capture.push(row); console.log(JSON.stringify({...row,raw:undefined}));
+ }
+ }
+ report.regression=[];
+ for(const [scale,alpha] of [[2,0],[2,127],[1.5,255]]) {
+ const pixels=Buffer.alloc(800*600*4);
+ for(let i=0;i<pixels.length;i+=4){pixels[i]=Math.floor((i%256)*alpha/255);pixels[i+1]=Math.floor(((i>>>5)%256)*alpha/255);pixels[i+2]=alpha;pixels[i+3]=alpha;}
+ globalThis.captureFixture.sources=[{display_id:'1',thumbnail:nativeImage.createFromBitmap(pixels,{width:800,height:600})}];
+ const display={id:1,bounds:{x:0,y:0,width:400,height:300},scaleFactor:scale};
+ const selection={x:13.5,y:17.25,width:200.25,height:150.5};
+ const before=await modules.before.captureLiveRegion(display,selection,'scroll');
+ const after=await modules.after.captureLiveRegion(display,selection,'scroll');
+ assert.deepEqual(after,before,'Alpha/mixed-density region crop must match');
+ report.regression.push({scale,alpha,width:after.width,height:after.height,identical:true});
+ }
+ // Encoding is synchronous even though fs.writeFile is async. Measure that
+ // separately; never include a native dialog or pretend to measure disk speed.
+ if (${JSON.stringify(option('only'))} !== 'parity') for (const [width,height] of ${option('memory') ? '[[1600,10000]]' : '[[1920,1080],[3840,2160],[1600,10000]]'}) {
+ const pixels=Buffer.alloc(width*height*4); for(let i=0;i<pixels.length;i+=4){pixels[i]=i%256;pixels[i+1]=(i>>>9)%256;pixels[i+2]=(i>>>17)%256;pixels[i+3]=255;}
+ let source;
+ for(const format of ${option('memory') ? "['png']" : "['png','jpeg']"}) for(const side of ${JSON.stringify(option('side') ? [option('side'), option('side')] : ['before','after','after','before'])}) {
+ const raw=[],synchronous=[],timerDelay=[];let bytes;
+ for(let i=0;i<10;i++) {
+ source=nativeImage.createFromBitmap(pixels,{width,height});
+ const start=performance.now();
+ const timer=new Promise(resolve=>setTimeout(()=>resolve(performance.now()-start),0));
+ const pending=side==='before' ? (format==='png'?source.toPNG():source.toJPEG(92)) : require('./encode.cjs').encodeScreenshotImage(source,format==='jpeg');
+ synchronous.push(performance.now()-start);
+ bytes=await pending;raw.push(performance.now()-start);timerDelay.push(await timer);
+ }
+ // Independent Electron decoding checks every BGRA output byte. JPEG keeps
+ // the exact encoder, so compare encoded bytes as well.
+ if(format==='png') assert.deepEqual(nativeImage.createFromBuffer(bytes).toBitmap(),source.toBitmap(),'PNG pixels');
+ else assert.deepEqual(bytes,source.toJPEG(92),'JPEG bytes');
+ const row={side,width,height,format,raw,synchronous,timerDelay,...summary(raw),mainThread:summary(synchronous),timer:summary(timerDelay),bytes:bytes.length};
+ report.save.push(row);console.log(JSON.stringify({...row,raw:undefined,synchronous:undefined,timerDelay:undefined}));
+ }
+ }
+ for(const alpha of [0,1,127,254]) {
+ const pixels=Buffer.alloc(2000*1000*4,alpha),source=nativeImage.createFromBitmap(pixels,{width:2000,height:1000});
+ assert.deepEqual(await require('./encode.cjs').encodeScreenshotImage(source),source.toPNG(),'Transparent PNG must keep original encoding');
+ }
+
+ fs.writeFileSync(${JSON.stringify(path.join(temp, 'result.json'))},JSON.stringify(report,null,2));
+ app.quit();
+}).catch(error=>{console.error(error);app.exit(1);});`);
+ const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => /^(PATH|SYSTEMROOT|WINDIR|TEMP|TMP|TMPDIR|DISPLAY|LANG|LC_ALL)$/i.test(key)));
+ const executable = createRequire(import.meta.url)('electron');
+ const { stdout, stderr } = await promisify(execFile)(option('memory') ? '/usr/bin/time' : executable,
+ option('memory') ? ['-l', executable, entry] : [entry], { env, timeout: 180000, maxBuffer: 1024 * 1024 });
+ console.log(stdout);
+ const report = JSON.parse(await readFile(path.join(temp, 'result.json'), 'utf8'));
+ if (option('memory')) {
+ report.memory = { side: option('side'), maximumResidentSetBytes: Number(stderr.match(/(\d+)\s+maximum resident set size/)?.[1]),
+ scope: 'macOS time -l maximum RSS of isolated Electron main process, including synthetic fixture allocations and native codec caches; not the interactive Cindy app peak.' };
+ if (!Number.isFinite(report.memory.maximumResidentSetBytes)) throw new Error('Could not read time -l maximum RSS');
+ console.log(JSON.stringify(report.memory));
+ }
+ if (option('output')) await writeFile(path.resolve(option('output')), JSON.stringify(report, null, 2) + '\n');
+} finally { await rm(temp, { recursive: true, force: true }); }
diff --git a/apps/desktop/scripts/benchmark-region-screenshot.mjs b/apps/desktop/scripts/benchmark-region-screenshot.mjs
index e820868913..91bbd2e69a 100644
--- a/apps/desktop/scripts/benchmark-region-screenshot.mjs
+++ b/apps/desktop/scripts/benchmark-region-screenshot.mjs
@@ -4,7 +4,7 @@
// node apps/desktop/scripts/benchmark-region-screenshot.mjs --baseline=HEAD --samples=30
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
-import { mkdtemp, mkdir, writeFile, rm } from 'node:fs/promises';
+import { mkdtemp, mkdir, writeFile, rm, readFile, readdir } from 'node:fs/promises';
import { createRequire } from 'node:module';
import os from 'node:os';
import path from 'node:path';
@@ -18,9 +18,22 @@ const samples = Number(option('samples') ?? 30), baseline = option('baseline') ?
assert.ok(Number.isInteger(samples) && samples >= 5 && samples <= 200);
const git = args => execFileSync('git', args, { cwd: root, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
const baselineSha = git(['rev-parse', '--verify', `${baseline}^{commit}`]).trim();
-const files = git(['ls-tree', '-r', '--name-only', baselineSha, '--', 'apps/desktop/src/renderer/features/region-screenshot']).trim().split('\n');
+const files = git(['ls-tree', '-r', '--name-only', baselineSha, '--', 'apps/desktop/src/renderer/features/region-screenshot', 'apps/desktop/src/shared/scrollCapture.ts']).trim().split('\n');
+const baselineDir = option('baseline-dir');
+if (baselineDir) {
+ files.length = 0;
+ const walk = async dir => {
+ for (const entry of await readdir(path.join(baselineDir, dir), { withFileTypes: true })) {
+ const file = path.join(dir, entry.name);
+ if (entry.isDirectory()) await walk(file); else files.push(file);
+ }
+ };
+ await walk('apps/desktop/src/renderer/features/region-screenshot');
+ files.push('apps/desktop/src/shared/scrollCapture.ts');
+}
const old = new Map(files.map(file => [path.normalize(path.join(root, file)), file]));
const contents = new Map();
+if (baselineDir) for (const file of files) contents.set(file, await readFile(path.join(baselineDir, file), 'utf8'));
const overlay = {
resolve: () => undefined,
has: file => old.has(path.normalize(file)),
@@ -37,8 +50,8 @@ const temp = await mkdtemp(path.join(os.tmpdir(), 'cindy-screenshot-perf-'));
const bundleDir = path.join(temp, 'bundle');
const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => /^(PATH|SYSTEMROOT|WINDIR|TEMP|TMP|TMPDIR|DISPLAY|WAYLAND_DISPLAY|XDG_RUNTIME_DIR|DBUS_SESSION_BUS_ADDRESS|LANG|LC_ALL)$/i.test(key)));
let app;
-const report = { generatedAt: new Date().toISOString(), baseline: baselineSha, samples, platform: process.platform, arch: process.arch, cpu: os.cpus()[0]?.model,
- scope: 'Real Electron offscreen renderer (1040x760 DIP, 2x density), synthetic opaque BGRA source at the stated dimensions. Excludes OS capture, native window startup, IPC serialization, clipboard and disk. 3 warmups per batch; alternating before/after batches. First-paint timing includes two animation frames and is sensitive to vsync/GC.', results: [], regression: [] };
+const report = { generatedAt: new Date().toISOString(), baseline: baselineDir ? JSON.parse(await readFile(path.join(baselineDir, 'baseline.json'), 'utf8')) : baselineSha, samples, platform: process.platform, arch: process.arch, cpu: os.cpus()[0]?.model,
+ scope: 'Real Electron offscreen renderer (1040x760 DIP, 2x density), synthetic opaque BGRA source at the stated dimensions. Excludes OS capture, native window startup, IPC serialization, clipboard and disk. 3 warmups per screenshot/scroll batch; GIF streams include their first frame. Alternating before/after batches. First-paint timing includes two animation frames and is sensitive to vsync/GC. Pipeline probes use production scroll matching and GIF encoding; hover probes count real pointer-driven canvas size assignments; they do not measure presentation latency or allocated memory.', results: [], pipeline: [], regression: [] };
const summary = values => {
const sorted = [...values].sort((a, b) => a - b);
const middle = sorted.length / 2;
@@ -69,6 +82,23 @@ try {
await page.goto(`${origin}/${side}-${theme}.html`);
await page.waitForFunction(() => window.__uiPage?.ready && window.screenshotPerf);
};
+ report.annotations = [];
+ for (const readFrequently of option('only') === 'annotations' ? [true, false] : [true]) for (const side of ['before', 'after', 'after', 'before']) {
+ await load(side);
+ const result = await page.evaluate(([count, frequent]) => window.screenshotPerf.annotations(count, frequent), [samples, readFrequently]);
+ report.annotations.push({ side, readFrequently, ...result, timing: summary(result.raw), synchronousMs: summary(result.synchronous) });
+ console.log(JSON.stringify({ annotations: side, readFrequently, timing: summary(result.raw), synchronous: summary(result.synchronous), hash: result.hash }));
+ }
+ for (const row of report.annotations) {
+ const first = report.annotations.find(value => value.readFrequently === row.readFrequently);
+ assert.equal(row.hash, first.hash, 'Annotation pixels must match baseline');
+ assert.deepEqual(row.regression, first.regression, 'Annotation edit/undo/source/scale pixels must match baseline');
+ }
+ if (option('only') === 'annotations') {
+ assert.deepEqual(errors, []);
+ if (option('output')) await writeFile(path.resolve(option('output')), JSON.stringify(report, null, 2) + '\n');
+ console.log('Annotation parity passed');
+ } else {
for (const [width, height, scale] of [[1920, 1080, 1], [3840, 2160, 2], [1600, 10000, 2]]) {
const values = { before: [], after: [] };
// Alternate order to reduce JIT, temperature and background-load bias.
@@ -111,14 +141,97 @@ try {
await page.mouse.move(100, 100); await page.mouse.down(); await page.mouse.move(300, 200); await page.mouse.up();
await page.evaluate(() => window.screenshotPerf.export());
report.regression.push({ theme, side, name: 'rectangle-annotation', ...await page.evaluate(() => window.screenshotPerf.verify(true)) });
+ await load(side, theme);
+ await page.evaluate(() => window.screenshotPerf.begin(1920, 1080, 1, undefined, false, 1, false));
+ // Move across the frame and back to its clipped edge. Reusing the backing
+ // store must not retain old pixels where the source extends off-screen.
+ for (const [x, y] of [[200, 200], [1, 1], [1038, 758], [200, 200]]) {
+ await page.mouse.move(x, y);
+ await page.getByText(`${x}, ${y}`, { exact: true }).waitFor();
+ const { canvasResizes: _resizes, ...pixels } = await page.evaluate(() => window.screenshotPerf.hoverProbe());
+ report.regression.push({ theme, side, name: `magnifier-${x}-${y}`, ...pixels });
+ }
+ }
+ for (const side of ['before', 'after', 'after', 'before']) {
+ await load(side);
+ await page.evaluate(() => window.screenshotPerf.begin(1920, 1080, 1, undefined, false, 1, false));
+ await page.mouse.move(80, 100);
+ await page.getByText('80, 100', { exact: true }).waitFor();
+ await page.evaluate(() => window.screenshotPerf.hoverProbe(true));
+ for (let i = 1; i <= 60; i++) await page.mouse.move(80 + i * 3, 100 + i * 2);
+ await page.getByText('260, 220', { exact: true }).waitFor();
+ const hover = await page.evaluate(() => window.screenshotPerf.hoverProbe());
+ if (side === 'after') assert.equal(hover.canvasResizes, 0, 'Pointer movement must reuse the magnifier backing store');
+ const stages = await page.evaluate(count => window.screenshotPerf.pipeline(count), samples);
+ const row = { side, hover, ...stages,
+ scroll: stages.scroll.map(stage => ({ ...stage, ...summary(stage.raw) })),
+ gif: { ...stages.gif, ...summary(stages.gif.raw), mainThreadMs: summary(stages.gif.mainThread), timerDelayMs: summary(stages.gif.timerDelay) } };
+ report.pipeline.push(row);
+ console.log(JSON.stringify({ side, hover: row.hover,
+ scroll: row.scroll.map(({ name, p50, p95 }) => ({ name, p50, p95 })), gif: { p50: row.gif.p50, p95: row.gif.p95, mainThreadMs: row.gif.mainThreadMs, timerDelayMs: row.gif.timerDelayMs } }));
+ }
+ for (const row of report.pipeline.slice(1)) {
+ const first = report.pipeline[0];
+ assert.deepEqual({ ...row.hover, canvasResizes: undefined }, { ...first.hover, canvasResizes: undefined }, 'Magnifier pixels must remain identical');
+ assert.deepEqual(row.stitched, first.stitched, 'Stitched export must remain byte-identical');
+ assert.deepEqual(row.scroll.map(r => r.result), first.scroll.map(r => r.result), 'Scroll decisions must be identical');
+ assert.deepEqual([row.gif.bytes, row.gif.hash], [first.gif.bytes, first.gif.hash], 'GIF pixels/timing must remain byte-identical');
}
for (const after of report.regression.filter(row => row.side === 'after')) {
const before = report.regression.find(row => row.side === 'before' && row.name === after.name && row.theme === after.theme);
assert.deepEqual({ ...after, side: undefined }, { ...before, side: undefined }, `Baseline parity: ${after.name}/${after.theme}`);
}
+ report.gifMotion = [];
+ for (const side of ['before', 'after', 'after', 'before']) {
+ await load(side);
+ const result = await page.evaluate(count => window.screenshotPerf.gifMotion(count), samples);
+ report.gifMotion.push({ side, ...result, timing: summary(result.raw) });
+ console.log(JSON.stringify({ gifMotion: side, timing: summary(result.raw), bytes: result.bytes, hash: result.hash }));
+ }
+ assert.ok(report.gifMotion.every(row => row.hash === report.gifMotion[0].hash && row.bytes === report.gifMotion[0].bytes), 'Motion GIF must match baseline');
+ const gifs = [];
+ // WebCodecs is unavailable on the harness's HTTP test origin. Decode in an
+ // isolated local-file window (a secure context), without changing app CSP,
+ // disabling web security or enabling insecure-origin command-line switches.
+ const decoderPage = path.join(temp, 'decode.html');
+ await writeFile(decoderPage, '<!doctype html><title>Local GIF decoder</title>');
+ for (const side of ['before', 'after']) {
+ await load(side);
+ const bytes = await page.evaluate(() => window.screenshotPerf.gifParity());
+ const decoded = await app.evaluate(async ({ BrowserWindow }, { bytes, decoderPage }) => {
+ const win = new BrowserWindow({ show: false, webPreferences: { sandbox: true, contextIsolation: true, nodeIntegration: false } });
+ try {
+ await win.loadFile(decoderPage);
+ const decode = async bytes => {
+ const decoder = new ImageDecoder({ data: new Uint8Array(bytes), type: 'image/gif' });
+ const frames = [];
+ try {
+ await decoder.tracks.ready;
+ for (let frameIndex = 0; frameIndex < decoder.tracks.selectedTrack.frameCount; frameIndex++) {
+ const { image } = await decoder.decode({ frameIndex });
+ try {
+ const pixels = new Uint8Array(image.allocationSize({ format: 'RGBA' }));
+ await image.copyTo(pixels, { format: 'RGBA' });
+ frames.push({ width: image.displayWidth, height: image.displayHeight,
+ duration: image.duration, timestamp: image.timestamp, pixels: Array.from(pixels) });
+ } finally { image.close(); }
+ }
+ return { frames, repeat: String(decoder.tracks.selectedTrack.repetitionCount) };
+ } finally { decoder.close(); }
+ };
+ return await win.webContents.executeJavaScript(`(${decode.toString()})(${JSON.stringify(bytes)})`);
+ } finally { win.destroy(); }
+ }, { bytes, decoderPage });
+ gifs.push({ bytes, decoded: decoded.frames, repeat: decoded.repeat });
+ }
+ assert.deepEqual(gifs[1], gifs[0], 'Every GIF byte and every decoded RGBA frame/timestamp must match the baseline');
+ assert.deepEqual(gifs[1].decoded.map(frame => frame.duration), [230000, 140000, 110000, 210000, 120000]);
+ report.gifParity = { bytes: gifs[0].bytes.length, identical: true, repeat: gifs[1].repeat,
+ decoded: gifs[1].decoded.map(({ pixels, ...metadata }) => ({ ...metadata, rgbaBytes: pixels.length })) };
assert.deepEqual(errors, []);
if (option('output')) await writeFile(path.resolve(option('output')), JSON.stringify(report, null, 2) + '\n');
console.log(JSON.stringify({ regressions: report.regression, versions: report.versions, passed: true }));
+ }
} finally {
await app?.close();
await rm(temp, { recursive: true, force: true });
diff --git a/apps/desktop/scripts/benchmark-region-startup.mjs b/apps/desktop/scripts/benchmark-region-startup.mjs
new file mode 100644
index 0000000000..7efcb31fc9
--- /dev/null
+++ b/apps/desktop/scripts/benchmark-region-startup.mjs
@@ -0,0 +1,71 @@
+#!/usr/bin/env node
+// Native startup stage only. Queries geometry, never captures desktop pixels.
+import assert from 'node:assert/strict';
+import { execFileSync, spawn } from 'node:child_process';
+import { mkdtemp, rm, writeFile, readFile } from 'node:fs/promises';
+import { createInterface } from 'node:readline';
+import { once } from 'node:events';
+import os from 'node:os';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const option = name => process.argv.find(arg => arg.startsWith(`--${name}=`))?.slice(name.length + 3);
+const desktop = fileURLToPath(new URL('..', import.meta.url)), root = path.resolve(desktop, '../..');
+assert.equal(process.platform, 'darwin');
+assert.ok(option('baseline-dir'), '--baseline-dir required');
+const temp = await mkdtemp(path.join(os.tmpdir(), 'cindy-startup-perf-'));
+const summary = raw => { const v = [...raw].sort((a,b)=>a-b); return { p50:v[Math.floor(v.length/2)], p95:v[Math.ceil(v.length*.95)-1] }; };
+const results = [];
+try {
+ for (const side of ['before', 'after']) {
+ const original = await readFile(path.join(side === 'before' ? option('baseline-dir') : root, 'apps/desktop/native/region-screenshot/macos-snapshot.swift'), 'utf8');
+ // Reproduce the rejected batching experiment without changing production.
+ // The measured cold-start improvement was not stable enough to retain it.
+ const candidate = side === 'before' ? original : original.replace(
+ 'emit(["id": id, "windows": onScreenWindows()])',
+ 'emit(["id": id, "windows": onScreenWindows(), "pid": NSWorkspace.shared.frontmostApplication.map { Int($0.processIdentifier) } ?? NSNull(), "screens": screenInsets()])');
+ const source = path.join(temp, `${side}.swift`); await writeFile(source, candidate);
+ execFileSync('swiftc', [source, '-O', '-o', path.join(temp, side)]);
+ }
+ for (const side of ['before', 'after', 'after', 'before']) {
+ const raw = [], warm = [];
+ for (let i=0;i<15;i++) {
+ const started = performance.now();
+ const child = spawn(path.join(temp, side), [], { stdio: ['pipe', 'pipe', 'pipe'] });
+ const lines = createInterface({ input: child.stdout });
+ let nextId = 0;
+ const pending = new Map();
+ const fail = error => { for (const task of pending.values()) task.reject(error); pending.clear(); };
+ child.on('error', fail); child.stdin.on('error', fail); child.stdout.on('error', fail); child.stderr.resume();
+ child.on('exit', () => fail(new Error('helper exited')));
+ lines.on('line', line => {
+ try { const value=JSON.parse(line); pending.get(value.id)?.resolve(value); pending.delete(value.id); }
+ catch (error) { fail(error); child.kill(); }
+ });
+ const ask = payload => new Promise((resolve,reject) => {
+ const id=++nextId; const timer=setTimeout(()=>{pending.delete(id);reject(new Error('helper timeout'));child.kill();},5000);
+ pending.set(id,{resolve:v=>{clearTimeout(timer);resolve(v);},reject:e=>{clearTimeout(timer);reject(e);}});
+ child.stdin.write(JSON.stringify({id,...payload})+'\n');
+ });
+ const snapshot = async () => {
+ if(side==='after') return ask({op:'windows',snapshot:true});
+ const windows=await ask({op:'windows'}), front=await ask({op:'frontmost'}), screens=await ask({op:'screens'});
+ return {...windows,pid:front.pid,screens:screens.screens};
+ };
+ try {
+ const result=await snapshot(); raw.push(performance.now()-started);
+ assert.ok(Array.isArray(result.windows) && Array.isArray(result.screens));
+ assert.ok(result.pid===null || Number.isInteger(result.pid));
+ const start=performance.now(); await snapshot(); warm.push(performance.now()-start);
+ } finally {
+ if (child.exitCode === null && child.signalCode === null) { const exit=once(child,'exit'); child.stdin.end(); await exit; }
+ lines.close();
+ }
+ }
+ const row={side,raw,warm,cold:summary(raw),queries:summary(warm)};results.push(row);
+ console.log(JSON.stringify({side,cold:row.cold,queries:row.queries}));
+ }
+ if(option('output')) await writeFile(path.resolve(option('output')),JSON.stringify({generatedAt:new Date().toISOString(),platform:process.platform,arch:process.arch,
+ candidate:'Batch three startup queries; rejected, production unchanged',
+ scope:'Native process spawn + initial geometry snapshot, excluding Electron/system capture/overlay. Warm second query shown separately; no persistent helper proposed.',results},null,2)+'\n');
+} finally { await rm(temp,{recursive:true,force:true}); }
diff --git a/apps/desktop/scripts/check-macos-region-snapping.mjs b/apps/desktop/scripts/check-macos-region-snapping.mjs
new file mode 100644
index 0000000000..bc540176e5
--- /dev/null
+++ b/apps/desktop/scripts/check-macos-region-snapping.mjs
@@ -0,0 +1,130 @@
+#!/usr/bin/env node
+// Explicit native E2E: node apps/desktop/scripts/check-macos-region-snapping.mjs
+// Production entry: macos-snapshot.swift's JSON protocol against owned AppKit
+// windows. #7661 added window-at without initializing NSApplication, returning
+// 0 even over a real window. Unit tests mock native replies and cannot catch it.
+// Minimal failure: a fresh helper + window-at at the visible window's center.
+// --helper=<binary> runs the same assertions against a pre-fix shipping helper.
+// Requires a logged-in Mac desktop; AX region checks also require Accessibility.
+import assert from 'node:assert/strict';
+import { spawn, execFileSync } from 'node:child_process';
+import { mkdtemp, rm } from 'node:fs/promises';
+import { once } from 'node:events';
+import { createInterface } from 'node:readline';
+import { fileURLToPath } from 'node:url';
+import os from 'node:os';
+import path from 'node:path';
+import { setTimeout as delay } from 'node:timers/promises';
+
+assert.equal(process.platform, 'darwin', 'Requires an interactive macOS desktop');
+const desktop = fileURLToPath(new URL('..', import.meta.url));
+const temp = await mkdtemp(path.join(os.tmpdir(), 'cindy-macos-snapping-'));
+const started = performance.now();
+const clients = [];
+function client(binary) {
+ const child = spawn(binary, [], { stdio: ['pipe', 'pipe', 'inherit'] });
+ const pending = new Map();
+ let sequence = 0;
+ const fail = (error) => {
+ for (const task of pending.values()) task.reject(error);
+ pending.clear();
+ };
+ child.on('error', fail);
+ child.stdin.on('error', fail);
+ child.on('exit', () => fail(new Error('Native process exited')));
+ createInterface({ input: child.stdout }).on('line', line => {
+ try {
+ const reply = JSON.parse(line);
+ pending.get(reply.id)?.resolve(reply);
+ pending.delete(reply.id);
+ } catch (error) { fail(error); }
+ });
+ const ask = (payload) => new Promise((resolve, reject) => {
+ const id = ++sequence;
+ const timeout = setTimeout(() => {
+ pending.delete(id);
+ reject(new Error(`Native timeout: ${payload.op}`));
+ }, 5000);
+ pending.set(id, {
+ resolve: value => { clearTimeout(timeout); resolve(value); },
+ reject: error => { clearTimeout(timeout); reject(error); },
+ });
+ child.stdin.write(`${JSON.stringify({ ...payload, id })}\n`);
+ });
+ clients.push(child);
+ return ask;
+}
+async function eventually(operation, predicate, label) {
+ const deadline = Date.now() + 3000;
+ let result;
+ do {
+ result = await operation();
+ if (predicate(result)) return result;
+ // E2E: allow WindowServer composition / AX exposure to catch up.
+ await delay(30);
+ } while (Date.now() < deadline);
+ assert.fail(`${label}: ${JSON.stringify(result)}`);
+}
+try {
+ const fixtureBinary = path.join(temp, 'windows');
+ execFileSync('swiftc', [path.join(desktop, 'scripts/fixtures/region-capture/macos-windows.swift'), '-O', '-o', fixtureBinary]);
+ let binary = process.argv.find(arg => arg.startsWith('--helper='))?.slice(9);
+ if (!binary) {
+ binary = path.join(temp, 'snapshot');
+ execFileSync('swiftc', [path.join(desktop, 'native/region-screenshot/macos-snapshot.swift'), '-O', '-o', binary]);
+ }
+ const fixture = client(fixtureBinary);
+ const geometry = await fixture({ op: 'state' });
+ const [left, top, right, bottom] = geometry.rect;
+ const point = { x: (left + right) / 2, y: (top + bottom) / 2 };
+ const helper = client(binary);
+ const windows = (await helper({ op: 'windows' })).windows;
+ assert.ok(windows.some(w => w.hwnd === geometry.hwnd), 'Fixture is in production window snapshot');
+ const hit = (p = point, exclude = []) => helper({ op: 'window-at', ...p, exclude });
+ await eventually(() => hit(), r => r.hwnd === geometry.hwnd, 'Cold helper must hit a real window');
+ const after = await fixture({ op: 'state' });
+ assert.equal(after.frontmost, geometry.frontmost, 'Helper startup must not activate an application');
+ assert.deepEqual(after.pointer, geometry.pointer, 'Helper must not move the system pointer');
+
+ const content = await eventually(() => helper({ op: 'elements', pid: geometry.pid,
+ hwnd: geometry.hwnd, rect: geometry.rect, ...point }), r => r.preferredRect?.every((v, i) =>
+ Math.abs(v - geometry.content[i]) <= 2), 'AX must select the scroll content region (requires Accessibility)');
+ assert.ok(content.rects.length > 1, 'Fine element chain remains available');
+ const toolbar = await helper({ op: 'elements', pid: geometry.pid, hwnd: geometry.hwnd,
+ rect: geometry.rect, x: point.x, y: top + 10 });
+ assert.deepEqual(toolbar.preferredRect, geometry.rect, 'Title bar selects the whole window');
+
+ const overlay = await fixture({ op: 'overlay' });
+ const opaque = { x: right - 80, y: point.y };
+ const transparent = { x: left + 80, y: point.y };
+ await eventually(() => hit(opaque), r => r.hwnd === overlay.overlay, 'Opaque front window must occlude the target');
+ await eventually(() => hit(opaque, [overlay.overlay]), r => r.hwnd === geometry.hwnd, 'Exclude only the screenshot overlay');
+ const coveredContent = await helper({ op: 'elements', pid: geometry.pid, hwnd: geometry.hwnd,
+ rect: geometry.rect, ...point });
+ assert.deepEqual(coveredContent.preferredRect, content.preferredRect, 'Content region remains identifiable underneath the screenshot overlay');
+ await fixture({ op: 'overlay', ignore: true });
+ await eventually(() => hit(opaque), r => r.hwnd === geometry.hwnd, 'Input-ignoring overlay must not intercept snapping');
+ // Re-enable input: a real occluder must block again, including on systems
+ // whose hit-testing treats visually transparent pixels as input regions.
+ await fixture({ op: 'overlay', ignore: false });
+ await eventually(() => hit(opaque), r => r.hwnd === overlay.overlay, 'Re-enabled opaque region must block again');
+ const reference = await fixture({ op: 'state' });
+ assert.ok([geometry.hwnd, overlay.overlay].includes(reference.transparentHit), 'Reference hit belongs to an owned window');
+ assert.equal((await hit(transparent)).hwnd, reference.transparentHit, 'Transparent pixel follows native AppKit hit testing');
+ await fixture({ op: 'hide' });
+ // A second fresh process catches accidental reliance on a previous session.
+ const second = client(binary);
+ assert.equal((await second({ op: 'window-at', ...point, exclude: [] })).hwnd, geometry.hwnd);
+ console.log(JSON.stringify({ result: 'passed', seconds: +((performance.now() - started) / 1000).toFixed(2),
+ checks: ['cold-start', 'focus', 'pointer', 'content-region', 'title-bar', 'opaque-occluder',
+ 'exclude-overlay', 'covered-content-region', 'native-transparent-hit', 'ignores-mouse-events', 'second-session'] }));
+} finally {
+ for (const child of clients.reverse()) {
+ if (child.exitCode !== null || child.signalCode !== null) continue;
+ const exited = once(child, 'exit');
+ const timer = setTimeout(() => child.kill('SIGKILL'), 2000);
+ child.stdin.end();
+ try { await exited; } finally { clearTimeout(timer); }
+ }
+ await rm(temp, { recursive: true, force: true });
+}
diff --git a/apps/desktop/scripts/fixtures/region-capture/macos-demand.m b/apps/desktop/scripts/fixtures/region-capture/macos-demand.m
new file mode 100644
index 0000000000..d6c0f82c87
--- /dev/null
+++ b/apps/desktop/scripts/fixtures/region-capture/macos-demand.m
@@ -0,0 +1,164 @@
+// Integration/performance fixture, appended after the real native source with
+// main renamed. Uses actual IOSurfaces, frame ownership and the production JPEG
+// codec; no display capture, user pixels, synthetic timers or unit-test mocks.
+#import <sys/resource.h>
+#import <CommonCrypto/CommonDigest.h>
+#import <assert.h>
+
+static IOSurfaceRef fixtureSurface(size_t width, size_t height, unsigned seed, BOOL noise) {
+ CVPixelBufferRef buffer = NULL;
+ CVReturn created = CVPixelBufferCreate(kCFAllocatorDefault, width, height, kCVPixelFormatType_32BGRA,
+ (__bridge CFDictionaryRef)@{(id)kCVPixelBufferIOSurfacePropertiesKey:@{}}, &buffer);
+ assert(created == kCVReturnSuccess);
+ IOSurfaceRef surface = CVPixelBufferGetIOSurface(buffer);
+ CFRetain(surface);
+ CVPixelBufferRelease(buffer);
+ assert(surface);
+ IOSurfaceLock(surface, 0, NULL);
+ uint32_t *pixels = IOSurfaceGetBaseAddress(surface);
+ size_t stride = IOSurfaceGetBytesPerRow(surface) / 4;
+ uint32_t random = 12345 + seed;
+ for (size_t y = 0; y < height; y++) for (size_t x = 0; x < width; x++) {
+ random = random * 1664525 + 1013904223;
+ pixels[y * stride + x] = noise ? (random | 0xff000000) :
+ (0xff000000 | (((x + seed * 9) % 256) << 16) | ((y % 256) << 8) | ((x / 16 + y / 16) % 256));
+ }
+ IOSurfaceUnlock(surface, 0, NULL);
+ return surface;
+}
+
+static double cpuMs(void) {
+ struct rusage usage;
+ getrusage(RUSAGE_SELF, &usage);
+ return (usage.ru_utime.tv_sec + usage.ru_stime.tv_sec) * 1000.0 +
+ (usage.ru_utime.tv_usec + usage.ru_stime.tv_usec) / 1000.0;
+}
+static NSString *digest(NSData *data) {
+ unsigned char hash[CC_SHA256_DIGEST_LENGTH];
+ CC_SHA256(data.bytes, (CC_LONG)data.length, hash);
+ NSMutableString *result = [NSMutableString string];
+ for (size_t i = 0; i < sizeof(hash); i++) [result appendFormat:@"%02x", hash[i]];
+ return result;
+}
+static void emit(NSDictionary *value) {
+ NSData *data = [NSJSONSerialization dataWithJSONObject:value options:0 error:NULL];
+ fwrite(data.bytes, 1, data.length, stdout); putchar('\n'); fflush(stdout);
+}
+
+static void ownershipChecks(void) {
+ IOSurfaceRef a = fixtureSurface(8, 8, 1, NO), b = fixtureSurface(8, 8, 2, NO);
+ __block int calls = 0;
+ CaptureFrameStore *store = [[CaptureFrameStore alloc] initWithOnRequest:YES encoder:^NSData *(IOSurfaceRef surface) {
+ calls++;
+ assert(IOSurfaceIsInUse(surface));
+ return [NSData dataWithBytes:IOSurfaceGetBaseAddress(surface) length:4];
+ }];
+ assert(!store.jpeg); // request before the first complete frame
+ [store acceptSurface:a];
+ [store acceptSurface:b];
+ assert(calls == 0 && !IOSurfaceIsInUse(a) && IOSurfaceIsInUse(b));
+ NSData *first = store.jpeg;
+ assert(first && calls == 1 && !IOSurfaceIsInUse(b));
+ assert([first isEqualToData:[NSData dataWithBytes:IOSurfaceGetBaseAddress(b) length:4]]);
+ assert([store.jpeg isEqualToData:first] && calls == 1); // static screen
+ [store acceptSurface:a];
+ [store clear]; // display blanked: no stale image, no pinned surface
+ assert(!store.jpeg && !IOSurfaceIsInUse(a));
+ [store acceptSurface:b];
+ assert(store.jpeg && calls == 2); // resume must return the latest frame
+ [store acceptSurface:a];
+ store = nil;
+ assert(!IOSurfaceIsInUse(a)); // disposal with an unencoded frame
+ __block int failed = 0;
+ store = [[CaptureFrameStore alloc] initWithOnRequest:YES encoder:^NSData *(IOSurfaceRef surface) {
+ return ++failed == 1 ? nil : first;
+ }];
+ [store acceptSurface:a];
+ assert(!store.jpeg && !IOSurfaceIsInUse(a));
+ assert(!store.jpeg && failed == 1); // no retry storm on the same bad frame
+ [store acceptSurface:b];
+ assert(store.jpeg && failed == 2);
+ [store clear];
+ CFRelease(a); CFRelease(b);
+ emit(@{@"checks": @[@"cold-request", @"latest-frame", @"skip-unused", @"surface-reuse-protection",
+ @"static-repeat", @"blank-invalidates", @"resume", @"dispose", @"encode-failure", @"failure-recovery"]});
+}
+
+int main(int argc, char **argv) {
+ @autoreleasepool {
+ ownershipChecks();
+ int samples = argc > 1 ? atoi(argv[1]) : 20;
+ CGColorSpaceRef color = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
+ for (NSArray *scenario in @[@[@1920, @1080, @NO], @[@3840, @2160, @NO], @[@3840, @2160, @YES]]) {
+ size_t width = [scenario[0] unsignedLongValue], height = [scenario[1] unsignedLongValue];
+ BOOL noise = [scenario[2] boolValue];
+ IOSurfaceRef surfaces[3];
+ for (int i = 0; i < 3; i++) surfaces[i] = fixtureSurface(width, height, i, noise);
+ CIContext *reference = [CIContext contextWithOptions:@{ kCIContextCacheIntermediates: @NO }];
+ NSMutableArray *parity = [NSMutableArray array];
+ // Real pre-change codec extracted from the specified baseline source.
+ // Test both normal and forced size fallback; compare every JPEG byte.
+ for (NSNumber *budget in @[@3000000, @100000]) {
+ CaptureFrameStore *store = [[CaptureFrameStore alloc] initWithOnRequest:YES encoder:^NSData *(IOSurfaceRef surface) {
+ return encodeCaptureSurface(reference, color, surface, 0.9, budget.longValue, YES);
+ }];
+ for (int i = 0; i < 3; i++) {
+ NSData *before = baselineEncode(reference, color, surfaces[i], 0.9, budget.longValue, YES);
+ [store acceptSurface:surfaces[(i + 1) % 3]];
+ [store acceptSurface:surfaces[(i + 2) % 3]];
+ [store acceptSurface:surfaces[i]];
+ NSData *after = store.jpeg;
+ if (!before || ![before isEqualToData:after]) emit(@{@"parityFailure":@YES, @"width":@(width), @"height":@(height),
+ @"noise":@(noise), @"frame":@(i), @"budget":budget, @"beforeBytes":@(before.length), @"afterBytes":@(after.length),
+ @"beforeHash":digest(before), @"afterHash":digest(after)});
+ assert(before && [before isEqualToData:after]);
+ assert([store.jpeg isEqualToData:before]);
+ [parity addObject:@{@"budget":budget, @"frame":@(i), @"bytes":@(after.length), @"sha256":digest(after)}];
+ }
+ [store clear];
+ }
+ emit(@{@"parity":parity, @"width":@(width), @"height":@(height), @"noise":@(noise)});
+ for (NSNumber *mode in @[@NO, @YES, @YES, @NO]) {
+ @autoreleasepool {
+ BOOL demand = mode.boolValue;
+ __block int encoded = 0;
+ CIContext *context = [CIContext contextWithOptions:@{ kCIContextCacheIntermediates: @NO }];
+ CaptureFrameStore *store = [[CaptureFrameStore alloc] initWithOnRequest:demand encoder:^NSData *(IOSurfaceRef surface) {
+ encoded++;
+ return demand ? encodeCaptureSurface(context, color, surface, 0.9, 3000000, YES)
+ : baselineEncode(context, color, surface, 0.9, 3000000, YES);
+ }];
+ NSMutableArray *roundMs = [NSMutableArray array], *requestMs = [NSMutableArray array];
+ double cpuStart = cpuMs();
+ for (int n = 0; n < samples; n++) {
+ @autoreleasepool {
+ double start = NSProcessInfo.processInfo.systemUptime;
+ for (int i = 0; i < 3; i++) [store acceptSurface:surfaces[(n + i) % 3]];
+ double requested = NSProcessInfo.processInfo.systemUptime;
+ NSData *jpeg = store.jpeg;
+ double done = NSProcessInfo.processInfo.systemUptime;
+ assert(jpeg);
+ [roundMs addObject:@((done - start) * 1000)];
+ [requestMs addObject:@((done - requested) * 1000)];
+ }
+ }
+ double cpu = cpuMs() - cpuStart;
+ assert(encoded == samples * (demand ? 1 : 3));
+ // Paused consumers may still receive changing system surfaces, but
+ // must not cause any demand encodes. Clear before resuming.
+ int beforePause = encoded;
+ for (int i = 0; i < 30; i++) [store acceptSurface:surfaces[i % 3]];
+ int pausedEncodes = encoded - beforePause;
+ assert(pausedEncodes == (demand ? 0 : 30));
+ [store clear];
+ for (int i = 0; i < 3; i++) assert(!IOSurfaceIsInUse(surfaces[i]));
+ emit(@{@"side":demand ? @"after" : @"before", @"width":@(width), @"height":@(height),
+ @"noise":@(noise), @"samples":@(samples), @"encodes":@(beforePause), @"pausedEncodes":@(pausedEncodes),
+ @"roundMs":roundMs, @"requestMs":requestMs, @"cpuMs":@(cpu)});
+ }
+ }
+ for (int i = 0; i < 3; i++) CFRelease(surfaces[i]);
+ }
+ CGColorSpaceRelease(color);
+ }
+}
diff --git a/apps/desktop/scripts/fixtures/region-capture/macos-recording-pattern.swift b/apps/desktop/scripts/fixtures/region-capture/macos-recording-pattern.swift
new file mode 100644
index 0000000000..01acf28b50
--- /dev/null
+++ b/apps/desktop/scripts/fixtures/region-capture/macos-recording-pattern.swift
@@ -0,0 +1,53 @@
+// Explicit live-capture benchmark only. A generated pattern covers one display;
+// no desktop image is persisted. EOF closes it without activating another app.
+import AppKit
+
+let app = NSApplication.shared
+app.setActivationPolicy(.accessory)
+let screen = NSScreen.screens[0]
+final class Pattern: NSView {
+ var tick = 0
+ var moving = false
+ override var isOpaque: Bool { true }
+ override func draw(_ dirtyRect: NSRect) {
+ for row in 0..<12 { for col in 0..<20 {
+ NSColor(calibratedRed: CGFloat((col * 13 + tick * 3) % 256) / 255,
+ green: CGFloat((row * 23 + tick) % 256) / 255,
+ blue: CGFloat((row + col) % 12) / 12, alpha: 1).setFill()
+ NSRect(x: CGFloat(col) * bounds.width / 20, y: CGFloat(row) * bounds.height / 12,
+ width: bounds.width / 20 + 1, height: bounds.height / 12 + 1).fill()
+ } }
+ ("Cindy capture performance test — synthetic pixels" as NSString).draw(at: NSPoint(x: 80, y: 80),
+ withAttributes: [.font: NSFont.systemFont(ofSize: 28), .foregroundColor: NSColor.white])
+ }
+}
+let window = NSPanel(contentRect: screen.frame, styleMask: [.borderless, .nonactivatingPanel], backing: .buffered, defer: false)
+window.level = NSWindow.Level(rawValue: Int(CGWindowLevelForKey(.statusWindow)) + 1)
+window.ignoresMouseEvents = true
+window.hasShadow = false
+window.isOpaque = true
+let pattern = Pattern(frame: NSRect(origin: .zero, size: screen.frame.size))
+window.contentView = pattern
+window.orderFrontRegardless()
+window.displayIfNeeded()
+let timer = Timer.scheduledTimer(withTimeInterval: 1.0 / 30, repeats: true) { _ in
+ if pattern.moving { pattern.tick += 1; pattern.needsDisplay = true }
+}
+func emit(_ object: [String: Any]) {
+ let bytes = try! JSONSerialization.data(withJSONObject: object)
+ FileHandle.standardOutput.write(bytes + Data([10]))
+}
+emit(["display": screen.deviceDescription[NSDeviceDescriptionKey("NSScreenNumber")]!,
+ "width": screen.frame.width, "height": screen.frame.height, "scale": screen.backingScaleFactor,
+ "window": window.windowNumber, "pid": getpid()])
+DispatchQueue.global().async {
+ while let command = readLine() {
+ DispatchQueue.main.async {
+ pattern.moving = command == "moving"
+ if command == "static" { pattern.tick = 0; pattern.needsDisplay = true; window.displayIfNeeded() }
+ emit(["state": command])
+ }
+ }
+ DispatchQueue.main.async { timer.invalidate(); window.orderOut(nil); app.terminate(nil) }
+}
+app.run()
diff --git a/apps/desktop/scripts/fixtures/region-capture/macos-windows.swift b/apps/desktop/scripts/fixtures/region-capture/macos-windows.swift
new file mode 100644
index 0000000000..70a10e58bc
--- /dev/null
+++ b/apps/desktop/scripts/fixtures/region-capture/macos-windows.swift
@@ -0,0 +1,93 @@
+// Owned windows for check-macos-region-snapping.mjs; no user content is read.
+import AppKit
+
+let app = NSApplication.shared
+app.setActivationPolicy(.accessory)
+let previousApp = NSWorkspace.shared.frontmostApplication
+let screen = NSScreen.screens[0]
+let target = NSWindow(contentRect: CGRect(x: screen.visibleFrame.minX + 80,
+ y: screen.visibleFrame.minY + 80, width: 600, height: 400),
+ styleMask: [.titled, .closable], backing: .buffered, defer: false)
+target.title = "Cindy region snapping regression"
+target.level = .floating
+let scroll = NSScrollView(frame: CGRect(x: 30, y: 30, width: 540, height: 300))
+scroll.hasVerticalScroller = true
+let document = NSView(frame: CGRect(x: 0, y: 0, width: 520, height: 600))
+let button = NSButton(title: "Region test", target: nil, action: nil)
+button.frame = CGRect(x: 30, y: 30, width: 140, height: 40)
+document.addSubview(button)
+scroll.documentView = document
+target.contentView!.addSubview(scroll)
+target.makeKeyAndOrderFront(nil)
+app.activate(ignoringOtherApps: true)
+
+final class HalfOpaqueView: NSView {
+ override var isOpaque: Bool { false }
+ override func draw(_ dirtyRect: NSRect) {
+ NSColor.clear.setFill()
+ bounds.fill(using: .copy)
+ NSColor.windowBackgroundColor.setFill()
+ NSRect(x: bounds.midX, y: 0, width: bounds.width / 2, height: bounds.height).fill()
+ }
+}
+// Like the display-wide screenshot panel, the overlay covers more than the
+// target window; equal bounds would model an indistinguishable sibling AX window.
+let overlay = NSPanel(contentRect: target.frame.insetBy(dx: -10, dy: -10), styleMask: [.borderless, .nonactivatingPanel],
+ backing: .buffered, defer: false)
+overlay.level = NSWindow.Level(rawValue: target.level.rawValue + 1)
+overlay.isOpaque = false
+overlay.backgroundColor = .clear
+overlay.hasShadow = false
+overlay.contentView = HalfOpaqueView(frame: CGRect(origin: .zero, size: overlay.frame.size))
+overlay.contentView!.wantsLayer = true
+
+func rect(_ value: CGRect) -> [Double] {
+ let top = screen.frame.maxY - value.maxY
+ return [value.minX, top, value.maxX, top + value.height]
+}
+func emit(_ object: [String: Any]) {
+ let data = try! JSONSerialization.data(withJSONObject: object)
+ FileHandle.standardOutput.write(data + Data([10]))
+}
+func state() -> [String: Any] {
+ ["frontmost": NSWorkspace.shared.frontmostApplication?.processIdentifier ?? 0,
+ "pointer": [NSEvent.mouseLocation.x, NSEvent.mouseLocation.y]]
+}
+DispatchQueue.global().async {
+ while let line = readLine() {
+ guard let data = line.data(using: .utf8),
+ let request = try? JSONSerialization.jsonObject(with: data) as? [String: Any]
+ else { continue }
+ DispatchQueue.main.async {
+ switch request["op"] as? String {
+ case "overlay":
+ overlay.ignoresMouseEvents = request["ignore"] as? Bool ?? false
+ overlay.orderFrontRegardless()
+ overlay.displayIfNeeded()
+ case "hide": overlay.orderOut(nil)
+ default: break
+ }
+ var result = state()
+ // Independent reference from a fully running AppKit application. Pixel
+ // transparency alone does not guarantee input pass-through on every OS.
+ result["transparentHit"] = NSWindow.windowNumber(at: CGPoint(x: target.frame.minX + 80,
+ y: target.frame.midY), belowWindowWithWindowNumber: 0)
+ result["id"] = request["id"]
+ result["hwnd"] = target.windowNumber
+ result["overlay"] = overlay.windowNumber
+ result["pid"] = ProcessInfo.processInfo.processIdentifier
+ result["rect"] = rect(target.frame)
+ result["content"] = rect(target.convertToScreen(scroll.frame))
+ emit(result)
+ }
+ }
+ DispatchQueue.main.async {
+ overlay.orderOut(nil)
+ target.orderOut(nil)
+ if NSWorkspace.shared.frontmostApplication?.processIdentifier == getpid() {
+ previousApp?.activate(options: [])
+ }
+ app.terminate(nil)
+ }
+}
+app.run()
diff --git a/apps/desktop/scripts/fixtures/region-capture/performance.tsx b/apps/desktop/scripts/fixtures/region-capture/performance.tsx
index 4c40b738d1..7f2ec18152 100644
--- a/apps/desktop/scripts/fixtures/region-capture/performance.tsx
+++ b/apps/desktop/scripts/fixtures/region-capture/performance.tsx
@@ -5,6 +5,10 @@ import { mountPage } from '../../ui-page/harness';
import { RegionScreenshotOverlay } from '../../../src/renderer/features/region-screenshot/RegionScreenshotOverlay';
import type { RegionScreenshotOverlayBridge } from '../../../src/renderer/features/region-screenshot/bridge';
import type { RegionRect, RegionScreenshotBitmap, RegionScreenshotExport } from '../../../src/shared/regionScreenshot';
+import { matchScrollFrames, ScrollCapture } from '../../../src/shared/scrollCapture';
+import * as annotationDrawing from '../../../src/renderer/features/region-screenshot/annotations';
+import type { Annotation } from '../../../src/renderer/features/region-screenshot/annotations';
+import { CaptureRecorder } from '../../../src/renderer/features/region-screenshot/captureRecorder';
let begin: Parameters<RegionScreenshotOverlayBridge['onBegin']>[0];
let end: () => void;
@@ -18,6 +22,13 @@ let sequence = 0;
let exportMs = 0;
let exportStart = 0;
let frameWrites = 0;
+let canvasResizes = 0;
+for (const property of ['width', 'height'] as const) {
+ const descriptor = Object.getOwnPropertyDescriptor(HTMLCanvasElement.prototype, property)!;
+ Object.defineProperty(HTMLCanvasElement.prototype, property, { ...descriptor,
+ set(value: number) { canvasResizes++; descriptor.set!.call(this, value); },
+ });
+}
const put = CanvasRenderingContext2D.prototype.putImageData;
CanvasRenderingContext2D.prototype.putImageData = function (...args: Parameters<typeof put>) {
if (frame && args[0].width === frame.width && args[0].height === frame.height) frameWrites++;
@@ -26,7 +37,7 @@ CanvasRenderingContext2D.prototype.putImageData = function (...args: Parameters<
const key = (value: string) => flushSync(() => window.dispatchEvent(new KeyboardEvent('keydown', { key: value, bubbles: true })));
Object.assign(window, { screenshotPerf: {
- async begin(width: number, height: number, scale = 1, crop?: RegionRect, alpha = false, oversample = 1) {
+ async begin(width: number, height: number, scale = 1, crop?: RegionRect, alpha = false, oversample = 1, selected = true) {
flushSync(() => end?.());
const w = Math.round(width * oversample), h = Math.round(height * oversample);
const data = new Uint8Array(w * h * 4);
@@ -53,9 +64,194 @@ Object.assign(window, { screenshotPerf: {
const syncMs = performance.now() - start;
await painted;
const paintedMs = performance.now() - start;
- key('r');
+ if (selected) key('r');
return { syncMs, paintedMs, frameWrites };
},
+ hoverProbe(reset = false) {
+ if (reset) canvasResizes = 0;
+ const canvases = document.querySelectorAll('canvas');
+ if (canvases.length < 3) throw new Error('Hover probe did not render the magnifier');
+ const magnifier = canvases[canvases.length - 1];
+ const pixels = magnifier.getContext('2d')!.getImageData(0, 0, magnifier.width, magnifier.height).data;
+ let hash = 2166136261;
+ for (const byte of pixels) hash = Math.imul(hash ^ byte, 16777619);
+ return { canvasResizes, hash: hash >>> 0, width: magnifier.width, height: magnifier.height };
+ },
+ annotations(count: number, readFrequently = true) {
+ const { drawAnnotations } = annotationDrawing;
+ const sourceCanvas = document.createElement('canvas');
+ sourceCanvas.width = 3840; sourceCanvas.height = 2160;
+ const sourceCtx = sourceCanvas.getContext('2d')!;
+ const pixels = new ImageData(3840, 2160);
+ for (let i = 0; i < pixels.data.length; i++) pixels.data[i] = (i * 31 + (i >>> 12)) % 256;
+ sourceCtx.putImageData(pixels, 0, 0);
+ const source = { frame: sourceCanvas, ratioX: 2, ratioY: 2 };
+ const canvas = document.createElement('canvas'); canvas.width = 3840; canvas.height = 2160;
+ const ctx = canvas.getContext('2d', { willReadFrequently: readFrequently })!;
+ const marks: Annotation[] = Array.from({ length: 8 }, (_, i) => ({
+ id: String(i), kind: i % 2 ? 'mosaic' : 'blur', color: 'red', size: 2,
+ from: { x: i * 120 - 10.5, y: i * 50 - 3.5 }, to: { x: i * 120 + 450.25, y: i * 50 + 240.75 },
+ }));
+ for (let i = 0; i < 40; i++) marks.push({ id: `pen-${i}`, kind: i % 2 ? 'pen' : 'marker', color: 'yellow', size: 1,
+ points: Array.from({ length: 500 }, (_, j) => ({ x: 20 + j * 6, y: 20 + i * 20 + Math.sin(j / 4) * 15 })) });
+ const raw: number[] = [], synchronous: number[] = [];
+ let drawingMs = 0, drawScale = 2, translate = 0;
+ let hash = 2166136261;
+ // Force raster completion in both versions, not merely Canvas command enqueue.
+ const render = (list: Annotation[], cached = true, draft: Annotation | null = null) => {
+ ctx.resetTransform(); ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.setTransform(drawScale, 0, 0, drawScale, translate, translate);
+ const started = performance.now();
+ const all = draft ? [...list, draft] : list;
+ drawAnnotations(ctx, cached ? all : all.map(a => 'points' in a ? { ...a, points: a.points.map(p => ({ ...p })) } : a), source);
+ drawingMs = performance.now() - started;
+ return ctx.getImageData(0, 0, canvas.width, canvas.height).data;
+ };
+ for (let i = -3; i < count; i++) {
+ const draft: Annotation = { id: 'draft', kind: 'marker', color: 'yellow', size: 2,
+ points: [{ x: 30, y: 40 }, { x: 200 + i, y: 150 + i }] };
+ const start = performance.now();
+ const actual = render(marks, true, draft);
+ if (i >= 0) { raw.push(performance.now() - start); synchronous.push(drawingMs); }
+ if (i === count - 1) {
+ const expected = render(marks, false, draft);
+ for (let j = 0; j < actual.length; j++) {
+ if (actual[j] !== expected[j]) throw new Error(`Cached annotation changed byte ${j}`);
+ hash = Math.imul(hash ^ actual[j], 16777619);
+ }
+ }
+ }
+ // Edit, undo, reorder, source replacement and coordinate changes all preserve pixels.
+ const regression: number[] = [];
+ const verify = (list: Annotation[]) => {
+ const actual = render(list), expected = render(list, false);
+ if (actual.some((byte, i) => byte !== expected[i])) throw new Error('Annotation path reuse changed pixels');
+ let value = 2166136261; for (const byte of actual) value = Math.imul(value ^ byte, 16777619);
+ regression.push(value >>> 0);
+ };
+ verify(marks.map(a => 'points' in a ? { ...a, points: a.points.map(p => ({ x: p.x + 2.25, y: p.y - 3.5 })) } : a));
+ verify(marks.slice().reverse());
+ verify(marks.slice(1)); verify(marks);
+ verify(marks.map(a => 'from' in a ? { ...a, to: { x: a.to.x + 3.25, y: a.to.y + 5.5 } } : a));
+ source.ratioX = 1.5; source.ratioY = 1.5; verify(marks);
+ drawScale = 1.5; translate = -17.25; verify(marks);
+ drawScale = 0.75; translate = 13.5; verify(marks);
+ sourceCtx.clearRect(0, 0, 3840, 2160); verify(marks);
+ return { raw, synchronous, regression, hash: hash >>> 0, pixelsIdentical: true, width: 3840, height: 2160, effects: marks.length };
+ },
+ async gifMotion(count: number) {
+ const width = 960, height = 540;
+ const canvas = document.createElement('canvas'); canvas.width = width; canvas.height = height;
+ const ctx = canvas.getContext('2d', { willReadFrequently: true })!;
+ const original = new Uint8ClampedArray(width * height * 4);
+ for (let i = 0; i < original.length; i += 4) {
+ let seed = Math.imul(i + 1, 2654435761) >>> 0; seed ^= seed >>> 13;
+ original[i] = seed & 255; original[i + 1] = seed >>> 8 & 255;
+ original[i + 2] = seed >>> 16 & 255; original[i + 3] = 255;
+ }
+ const raw: number[] = [];
+ const recorder = new CaptureRecorder(canvas, 'gif', () => { throw new Error('Unexpected size limit'); });
+ for (let i = 0; i < count; i++) {
+ // Move all colors without changing their distribution. This is deliberately
+ // separate from the existing changing-distribution stress scenario.
+ const data = new Uint8ClampedArray(original.length), shift = i * 4 * 97;
+ data.set(original.subarray(shift)); data.set(original.subarray(0, shift), original.length - shift);
+ ctx.putImageData(new ImageData(data, width, height), 0, 0);
+ const start = performance.now(); await recorder.add(i * 130); raw.push(performance.now() - start);
+ }
+ const bytes = await recorder.finish(count * 130); recorder.dispose();
+ let hash = 2166136261; for (const byte of bytes) hash = Math.imul(hash ^ byte, 16777619);
+ return { raw, bytes: bytes.length, hash: hash >>> 0 };
+ },
+ async pipeline(count: number) {
+ // Deterministic opaque texture, with independent rows to avoid ambiguous
+ // scrolling matches. Generation and putImageData are outside encode timing.
+ const texture = (width: number, height: number, offset = 0): RegionScreenshotBitmap => {
+ const data = new Uint8Array(width * height * 4);
+ for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {
+ let seed = ((y + offset + 1) * 2654435761 + x * 2246822519) >>> 0;
+ seed ^= seed >>> 13;
+ const at = (y * width + x) * 4;
+ data[at] = seed & 255; data[at + 1] = seed >>> 8 & 255;
+ data[at + 2] = seed >>> 16 & 255; data[at + 3] = 255;
+ }
+ return { width, height, data };
+ };
+ const first = texture(960, 1600), next = texture(960, 1600, 240), unrelated = texture(960, 1600, 6000);
+ const scroll = [];
+ for (const [name, a, b] of [['stationary', first, first], ['forward', first, next], ['reverse', next, first], ['unmatched', first, unrelated]] as const) {
+ const raw: number[] = [];
+ let result;
+ for (let i = -3; i < count; i++) {
+ const started = performance.now();
+ result = matchScrollFrames(a, b);
+ if (i >= 0) raw.push(performance.now() - started);
+ }
+ scroll.push({ name, raw, result });
+ }
+ const capture = new ScrollCapture(first);
+ capture.add(next);
+ const output = capture.image();
+ const hash = (data: Uint8Array) => {
+ let value = 2166136261;
+ for (const byte of data) value = Math.imul(value ^ byte, 16777619);
+ return value >>> 0;
+ };
+ const canvas = document.createElement('canvas'); canvas.width = 960; canvas.height = 540;
+ const ctx = canvas.getContext('2d', { willReadFrequently: true })!;
+ const pixels = new ImageData(new Uint8ClampedArray(texture(960, 540).data), 960, 540);
+ const recorder = new CaptureRecorder(canvas, 'gif', () => { throw new Error('Unexpected GIF limit'); });
+ const gif: number[] = [];
+ const mainThread: number[] = [], timerDelay: number[] = [];
+ for (let i = 0; i < count; i++) {
+ ctx.putImageData(pixels, 0, 0);
+ ctx.fillStyle = 'white'; ctx.fillRect(20 + i * 2, 30, 10, 20);
+ const started = performance.now();
+ // Same-thread timer cannot run until synchronous encoding returns. Worker
+ // completion is awaited separately, preserving the production backpressure.
+ const responsive = new Promise<void>(resolve => setTimeout(() => { timerDelay.push(performance.now() - started); resolve(); }, 0));
+ const pending = recorder.add(i * 100);
+ mainThread.push(performance.now() - started);
+ await pending;
+ gif.push(performance.now() - started);
+ await responsive;
+ }
+ const finishStarted = performance.now();
+ const bytes = await recorder.finish(count * 100);
+ const gifFinishMs = performance.now() - finishStarted;
+ recorder.dispose();
+ return { scroll, stitched: { height: output.height, hash: hash(output.data) },
+ gif: { raw: gif, mainThread, timerDelay, finishMs: gifFinishMs, bytes: bytes.length, hash: hash(bytes) } };
+ },
+ async gifParity() {
+ const canvas = document.createElement('canvas'); canvas.width = 64; canvas.height = 48;
+ const ctx = canvas.getContext('2d', { willReadFrequently: true })!;
+ const recorder = new CaptureRecorder(canvas, 'gif', () => { throw new Error('Unexpected GIF limit'); });
+ // No timing mocks: actual worker + canvas. Fixed supplied times make the
+ // complete old/new GIF comparable, including identical frames and pause.
+ ctx.fillStyle = 'white'; ctx.fillRect(0, 0, 64, 48);
+ ctx.fillStyle = 'black'; ctx.fillText('GIF 文字', 2, 20);
+ await recorder.add(0); await recorder.add(100);
+ ctx.fillStyle = 'red'; ctx.fillRect(63, 47, 1, 1);
+ const changing = recorder.add(230);
+ recorder.pause(370);
+ await changing;
+ recorder.resume();
+ await recorder.add(370);
+ const pixels = ctx.createImageData(64, 48);
+ for (let i = 0; i < pixels.data.length; i += 4) {
+ pixels.data[i] = i * 17 % 251; pixels.data[i + 1] = i * 29 % 253;
+ pixels.data[i + 2] = i * 37 % 255; pixels.data[i + 3] = (i / 4) % 2 ? 127 : 255;
+ }
+ ctx.putImageData(pixels, 0, 0);
+ await recorder.add(480); await recorder.add(520);
+ ctx.fillStyle = 'blue'; ctx.fillRect(0, 0, 64, 48);
+ const last = recorder.add(690);
+ const finishing = recorder.finish(810);
+ await last;
+ const bytes = await finishing;
+ recorder.dispose();
+ return Array.from(bytes);
+ },
async export() {
exported = null;
exportStart = performance.now();
diff --git a/apps/desktop/scripts/ui-page/build.mjs b/apps/desktop/scripts/ui-page/build.mjs
index a86cb94188..d6234604c1 100644
--- a/apps/desktop/scripts/ui-page/build.mjs
+++ b/apps/desktop/scripts/ui-page/build.mjs
@@ -139,6 +139,31 @@ function boundaries(stubs, replaced, overlay) {
const sourcePath = (file) => path.resolve(root, file.replace(/ with \{[^}]*\}$/, ''));
+// Bundle Vite's ?worker imports as real module workers, including --compare
+// sources. Keep their inputs in the page fingerprint and affected-page scan.
+function workerModules(definition, overlay, inputs, outputs) {
+ return {
+ name: 'ui-page-workers',
+ setup(build) {
+ build.onResolve({ filter: /\?worker$/ }, args => ({
+ path: path.resolve(args.resolveDir, args.path.slice(0, -7)), namespace: 'ui-worker',
+ }));
+ build.onLoad({ filter: /.*/, namespace: 'ui-worker' }, async args => {
+ const result = await esbuild.build({
+ ...common(definition, [boundaries(new Map(), {}, overlay)]),
+ entryPoints: [args.path], entryNames: 'worker-[hash]',
+ });
+ for (const file of Object.keys(result.metafile.inputs)) inputs.add(sourcePath(file));
+ outputs.push(...result.outputFiles);
+ const script = result.outputFiles.find(file => file.path.endsWith('.js'));
+ if (!script) throw new Error(`Worker did not emit JavaScript: ${args.path}`);
+ const url = `./${path.relative(outdir, script.path).split(path.sep).join('/')}`;
+ return { contents: `export default class extends Worker { constructor(options) { super(new URL(${JSON.stringify(url)}, import.meta.url), { ...options, type: 'module' }); } }`, loader: 'js' };
+ });
+ },
+ };
+}
+
function entryContents(definition) {
const entry = path.resolve(definition.dir, definition.entry);
return {
@@ -206,17 +231,19 @@ async function sharedStyleInputs() {
/** Everything a page is built from; used to decide which pages a changed file affects. */
export async function scanPage(definition) {
const replaced = {};
+ const workerInputs = new Set();
const { contents } = entryContents(definition);
const result = await esbuild.build({
- ...common(definition, [boundaries(stubTable(definition), replaced)]),
+ ...common(definition, [workerModules(definition, undefined, workerInputs, []), boundaries(stubTable(definition), replaced)]),
stdin: { contents, resolveDir: root, sourcefile: 'ui-page-entry.ts', loader: 'ts' },
entryNames: 'page',
});
return {
inputs: [
...Object.keys(result.metafile.inputs)
- .filter((file) => !file.startsWith('ui-stub:') && file !== 'ui-page-entry.ts')
+ .filter((file) => !file.startsWith('ui-stub:') && !file.startsWith('ui-worker:') && file !== 'ui-page-entry.ts')
.map(sourcePath),
+ ...workerInputs,
...(await sharedStyleInputs()),
],
replaced,
@@ -230,15 +257,17 @@ export async function scanPage(definition) {
*/
export async function buildPage(definition, overlay) {
const replaced = {};
+ const workerInputs = new Set();
+ const workerOutputs = [];
const { contents, entry } = entryContents(definition);
const result = await esbuild.build({
- ...common(definition, [boundaries(stubTable(definition), replaced, overlay)]),
+ ...common(definition, [workerModules(definition, overlay, workerInputs, workerOutputs), boundaries(stubTable(definition), replaced, overlay)]),
stdin: { contents, resolveDir: root, sourcefile: 'ui-page-entry.ts', loader: 'ts' },
entryNames: 'page',
});
- const inputs = Object.keys(result.metafile.inputs)
- .filter((file) => !file.startsWith('ui-stub:') && file !== 'ui-page-entry.ts')
- .map(sourcePath);
+ const inputs = [...new Set([...Object.keys(result.metafile.inputs)
+ .filter((file) => !file.startsWith('ui-stub:') && !file.startsWith('ui-worker:') && file !== 'ui-page-entry.ts')
+ .map(sourcePath), ...workerInputs])];
// Tailwind scans exactly the imported source (and overlay text in compare mode).
const config = loadConfig(configPath);
const scanned = inputs.filter(
@@ -260,7 +289,7 @@ export async function buildPage(definition, overlay) {
entryNames: 'styles',
});
const files = new Map();
- for (const output of [...result.outputFiles, ...styles.outputFiles]) {
+ for (const output of [...result.outputFiles, ...styles.outputFiles, ...workerOutputs]) {
const url = `/${path.relative(outdir, output.path).split(path.sep).join('/')}`;
files.set(url, {
contentType: CONTENT_TYPES[path.extname(output.path)] ?? 'application/octet-stream',
diff --git a/apps/desktop/scripts/ui-page/runner.selftest.mjs b/apps/desktop/scripts/ui-page/runner.selftest.mjs
index 4a5f1d8a88..93024362ff 100644
--- a/apps/desktop/scripts/ui-page/runner.selftest.mjs
+++ b/apps/desktop/scripts/ui-page/runner.selftest.mjs
@@ -3,11 +3,13 @@
import assert from 'node:assert/strict';
import { spawn, execFileSync } from 'node:child_process';
import { existsSync } from 'node:fs';
-import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
+import { mkdtemp, readFile, realpath, rm, writeFile } from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import { after, before, test } from 'node:test';
import { fileURLToPath } from 'node:url';
+import { scanPage, buildPage } from './build.mjs';
+import { adhocPage } from './registry.mjs';
const cli = fileURLToPath(new URL('./cli.mjs', import.meta.url));
const harness = fileURLToPath(new URL('./harness/index.tsx', import.meta.url));
@@ -51,12 +53,49 @@ async function entry(name, source) {
}
before(async () => {
- dir = await mkdtemp(path.join(os.tmpdir(), 'cindy-ui-selftest-'));
+ dir = await realpath(await mkdtemp(path.join(os.tmpdir(), 'cindy-ui-selftest-')));
});
after(async () => {
await rm(dir, { recursive: true, force: true });
});
+// GIF encoding now imports a Vite worker. Guard the real worker runtime, transfer
+// semantics and source tracking; replacing it with a synchronous stub would hide
+// precisely the scheduling boundary the recording tests need. Explicit E2E tier.
+test('bundles a real worker and tracks its transitive sources for compare and changed scans', async () => {
+ const value = path.join(dir, 'worker-value.ts');
+ const worker = path.join(dir, 'sample.worker.ts');
+ await writeFile(value, 'export const value = 17;');
+ await writeFile(worker, `import { value } from './worker-value';
+self.onmessage = ({ data }) => {
+ if (typeof document !== 'undefined') throw new Error('Worker ran on the page');
+ data[0] += value;
+ self.postMessage(data, [data.buffer]);
+};`);
+ const file = await entry('worker', `import SampleWorker from './sample.worker.ts?worker';
+const worker = new SampleWorker();
+const input = new Uint8Array([3]);
+await new Promise<void>((resolve, reject) => {
+ worker.onerror = reject;
+ worker.onmessage = ({ data }) => { worker.terminate(); data[0] === 20 ? resolve() : reject(new Error('Wrong worker result')); };
+ worker.postMessage(input, [input.buffer]);
+ if (input.byteLength !== 0) reject(new Error('Input was not transferred'));
+});
+mountPage({ render: () => <div>Worker finished</div> });`);
+ const definition = adhocPage(file);
+ const scanned = await scanPage(definition);
+ assert.ok(scanned.inputs.includes(value));
+ const bundle = await buildPage(definition);
+ const alternate = await buildPage(definition, {
+ has: file => file === value,
+ get: file => file === value ? 'export const value = 18;' : undefined,
+ resolve: () => undefined,
+ });
+ assert.notEqual(bundle.fingerprints.get(value), alternate.fingerprints.get(value));
+ assert.notEqual(bundle.bundleDigest, alternate.bundleDigest);
+ assert.equal((await run(['--entry', file, '--theme', 'light', '--json'])).code, 0);
+});
+
test('one run reports each failure kind on its own variant', async () => {
const file = await entry(
'matrix',
diff --git a/apps/desktop/src/main/region-screenshot/__tests__/encodeImage.test.ts b/apps/desktop/src/main/region-screenshot/__tests__/encodeImage.test.ts
new file mode 100644
index 0000000000..c3e5854889
--- /dev/null
+++ b/apps/desktop/src/main/region-screenshot/__tests__/encodeImage.test.ts
@@ -0,0 +1,53 @@
+import type { NativeImage } from 'electron';
+import sharp from 'sharp';
+import { expect, it, vi } from 'vitest';
+import { encodeScreenshotImage } from '../encodeImage';
+
+vi.mock('sharp', async original => {
+ const actual = await original<typeof import('sharp')>();
+ return { ...actual, default: vi.fn(actual.default) };
+});
+
+// Unit: the new async PNG branch must preserve pixels and leave alpha/JPEG on
+// the native codec. No existing save/compose test exercises actual PNG encoding.
+// Smallest branch input is 2000x1000; no Electron process, files or real waits.
+function source(alpha = 255) {
+ const pixels = Buffer.alloc(2000 * 1000 * 4);
+ for (let i = 0; i < pixels.length; i += 4) pixels.set([11, 57, 203, alpha], i);
+ return {
+ getSize: () => ({ width: 2000, height: 1000 }),
+ toBitmap: () => Buffer.from(pixels),
+ toPNG: () => Buffer.from('native-png'),
+ toJPEG: (quality: number) => Buffer.from(`native-jpeg-${quality}`),
+ } as NativeImage;
+}
+
+it('encodes opaque BGRA as lossless RGBA without modifying the source', async () => {
+ const image = source(), before = image.toBitmap();
+ const encoded = await encodeScreenshotImage(image);
+ const { data, info } = await sharp(encoded).ensureAlpha().raw().toBuffer({ resolveWithObject: true });
+ expect([info.width, info.height, info.channels]).toEqual([2000, 1000, 4]);
+ const expected = Buffer.alloc(data.length);
+ for (let i = 0; i < expected.length; i += 4) expected.set([203, 57, 11, 255], i);
+ expect(data.equals(expected)).toBe(true);
+ expect(image.toBitmap().equals(before)).toBe(true);
+});
+
+it('keeps translucent PNG bytes on the original native path', async () => {
+ const image = source(127);
+ expect(await encodeScreenshotImage(image)).toEqual(image.toPNG());
+});
+
+it('keeps small PNGs and JPEG quality without reading raw pixels', async () => {
+ const image = source();
+ image.getSize = () => ({ width: 2, height: 2 });
+ image.toBitmap = () => { throw new Error('unnecessary pixel extraction'); };
+ expect(await encodeScreenshotImage(image)).toEqual(image.toPNG());
+ expect(await encodeScreenshotImage(image, true)).toEqual(image.toJPEG(92));
+});
+
+it('falls back to the native PNG if the optional encoder fails', async () => {
+ const image = source();
+ vi.mocked(sharp).mockImplementationOnce(() => { throw new Error('native binding unavailable'); });
+ expect(await encodeScreenshotImage(image)).toEqual(image.toPNG());
+});
diff --git a/apps/desktop/src/main/region-screenshot/__tests__/liveCapture.test.ts b/apps/desktop/src/main/region-screenshot/__tests__/liveCapture.test.ts
index c1be506af7..e572f38bff 100644
--- a/apps/desktop/src/main/region-screenshot/__tests__/liveCapture.test.ts
+++ b/apps/desktop/src/main/region-screenshot/__tests__/liveCapture.test.ts
@@ -2,13 +2,17 @@ import type { Display } from 'electron';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { SnapshotHelper } from '../snapshotHost';
-const mocks = vi.hoisted(() => ({ sources: vi.fn(), capture: vi.fn() }));
+const mocks = vi.hoisted(() => ({ sources: vi.fn(), capture: vi.fn(), nativeOptions: vi.fn(), frame: vi.fn(), pixels: null as Buffer | null }));
vi.mock('electron', () => ({
desktopCapturer: { getSources: mocks.sources },
- nativeImage: {},
+ nativeImage: { createFromBuffer: () => bitmap(200, 400) },
screen: { dipToScreenRect: (_window: unknown, rect: unknown) => rect },
}));
-vi.mock('../../remote-desktop/nativeCapture', () => ({ NativeDesktopCapture: class {} }));
+vi.mock('../../remote-desktop/nativeCapture', () => ({ NativeDesktopCapture: class {
+ constructor(options: unknown) { mocks.nativeOptions(options); }
+ frame = mocks.frame;
+ stop() {}
+} }));
import { captureLiveRegion, RegionVideoCapture } from '../liveCapture';
const display = { id: 1, bounds: { x: 0, y: 0, width: 100, height: 200 }, scaleFactor: 2 } as Display;
@@ -20,7 +24,7 @@ function bitmap(width: number, height: number) {
getSize: () => ({ width, height }),
crop: (rect: { width: number; height: number }) => { crop(rect); return bitmap(rect.width, rect.height); },
resize: (size: { width: number; height: number }) => bitmap(size.width, size.height),
- toBitmap: () => Buffer.alloc(width * height * 4),
+ toBitmap: () => mocks.pixels ?? Buffer.alloc(width * height * 4),
};
}
const helper = { capture: mocks.capture } as unknown as SnapshotHelper;
@@ -31,6 +35,7 @@ describe('live region capture recovery', () => {
beforeEach(() => {
vi.stubGlobal('process', Object.create(process, { platform: { value: 'win32' } }));
vi.clearAllMocks();
+ mocks.pixels = null;
mocks.capture.mockResolvedValue(null);
mocks.sources.mockResolvedValue([{ display_id: '1', thumbnail: bitmap(200, 400) }]);
});
@@ -59,4 +64,34 @@ describe('live region capture recovery', () => {
resolve(null);
await expect(frame).rejects.toThrow('Region capture unavailable');
});
+
+ // Unit: avoiding a copy must not expose a larger backing buffer through IPC.
+ // Electron's real native bitmap path is additionally covered by the benchmark.
+ it('copies a sliced native buffer so only selection bytes can cross IPC', async () => {
+ const bytes = 60 * 80 * 4;
+ const backing = Buffer.alloc(bytes + 8, 99);
+ mocks.pixels = backing.subarray(4, bytes + 4).fill(17);
+ const frame = await captureLiveRegion(display, selection, 'scroll', helper);
+ expect(frame.data.byteOffset).toBe(0);
+ expect(frame.data.buffer.byteLength).toBe(bytes);
+ expect(frame.data.every(value => value === 17)).toBe(true);
+ });
+
+ // Unit: only local Mac recording opts in, with the same crop and late-frame
+ // rejection. The remote adapter tests cannot establish this caller boundary.
+ it('uses on-request Mac frames and still discards a frame after stopping', async () => {
+ vi.stubGlobal('process', Object.create(process, { platform: { value: 'darwin' } }));
+ mocks.frame.mockResolvedValue({ jpeg: 'anBlZw==', cursor: null });
+ const recording = new RegionVideoCapture(helper);
+ const frame = await recording.frame(display, selection, 'gif');
+ expect(mocks.nativeOptions).toHaveBeenCalledWith({ encodeOnRequest: true });
+ expect([frame.width, frame.height, frame.data.byteLength]).toEqual([60, 80, 60 * 80 * 4]);
+ expect(crop).toHaveBeenCalledWith({ x: 20, y: 40, width: 60, height: 80 });
+ let finish!: (value: { jpeg: string; cursor: null }) => void;
+ mocks.frame.mockReturnValueOnce(new Promise(resolve => { finish = resolve; }));
+ const pending = recording.frame(display, selection, 'gif');
+ recording.stop();
+ finish({ jpeg: 'anBlZw==', cursor: null });
+ await expect(pending).rejects.toThrow('Region capture unavailable');
+ });
});
diff --git a/apps/desktop/src/main/region-screenshot/encodeImage.ts b/apps/desktop/src/main/region-screenshot/encodeImage.ts
new file mode 100644
index 0000000000..970aab6d02
--- /dev/null
+++ b/apps/desktop/src/main/region-screenshot/encodeImage.ts
@@ -0,0 +1,29 @@
+import type { NativeImage } from 'electron';
+import sharp from 'sharp';
+
+const littleEndian = new Uint8Array(new Uint32Array([1]).buffer)[0] === 1;
+
+/** Large opaque PNGs use the existing libvips thread pool. NativeImage owns
+ * premultiplied BGRA pixels, so translucent images retain Electron's exact
+ * unpremultiplication and encoding. JPEG quality and small exports stay native. */
+export async function encodeScreenshotImage(image: NativeImage, jpeg = false): Promise<Buffer> {
+ if (jpeg) return image.toJPEG(92);
+ const { width, height } = image.getSize();
+ if (!littleEndian || width * height < 2_000_000) return image.toPNG();
+ const bitmap = image.toBitmap();
+ if (bitmap.byteOffset % 4 !== 0 || bitmap.byteLength !== width * height * 4) return image.toPNG();
+ const pixels = new Uint32Array(bitmap.buffer, bitmap.byteOffset, bitmap.byteLength / 4);
+ // toBitmap returns a copy. Swapping that owned buffer avoids another full
+ // RGBA allocation and cannot mutate the NativeImage used by other actions.
+ for (let i = 0; i < pixels.length; i++) {
+ const pixel = pixels[i];
+ if ((pixel >>> 24) !== 255) return image.toPNG();
+ pixels[i] = (pixel & 0xff00ff00) | ((pixel & 0xff) << 16) | ((pixel >>> 16) & 0xff);
+ }
+ try {
+ return await sharp(bitmap, { raw: { width, height, channels: 4 } }).removeAlpha().png({ compressionLevel: 3, adaptiveFiltering: true }).toBuffer();
+ } catch {
+ // An encoder failure must not break save.
+ return image.toPNG();
+ }
+}
diff --git a/apps/desktop/src/main/region-screenshot/liveCapture.ts b/apps/desktop/src/main/region-screenshot/liveCapture.ts
index 661a370fcf..f72cb111bb 100644
--- a/apps/desktop/src/main/region-screenshot/liveCapture.ts
+++ b/apps/desktop/src/main/region-screenshot/liveCapture.ts
@@ -22,12 +22,14 @@ export async function captureLiveRegion(display: Display, selection: RegionRect,
if (!source || source.thumbnail.isEmpty()) throw new Error('Display capture unavailable');
const mapping = regionSelectionToImageCrop(selection, display.bounds, source.thumbnail.getSize(), display.scaleFactor);
if (!mapping) throw new Error('Invalid capture region');
- let image = source.thumbnail.crop(mapping.crop).resize(mapping.output);
+ let image = source.thumbnail.crop(mapping.crop);
+ if (image.getSize().width !== mapping.output.width || image.getSize().height !== mapping.output.height) image = image.resize(mapping.output);
const maxSide = mode === 'gif' ? 960 : mode === 'video' ? 1920 : 32768;
const ratio = Math.min(1, maxSide / Math.max(mapping.output.width, mapping.output.height));
if (ratio < 1) image = image.resize({ width: Math.max(1, Math.round(mapping.output.width * ratio)), height: Math.max(1, Math.round(mapping.output.height * ratio)) });
const size = image.getSize();
- return { ...size, data: new Uint8Array(image.toBitmap()) };
+ const pixels = image.toBitmap();
+ return { ...size, data: pixels.buffer instanceof ArrayBuffer && pixels.byteLength === pixels.buffer.byteLength ? new Uint8Array(pixels.buffer) : new Uint8Array(pixels) };
}
/** Reuses one user-session capture backend for the recording; never opens the
@@ -46,7 +48,7 @@ export class RegionVideoCapture {
return result;
}
if (!this.native) {
- this.native = new NativeDesktopCapture();
+ this.native = new NativeDesktopCapture({ encodeOnRequest: true });
}
const frame = await this.native.frame(String(display.id), true, { quality: 'hd', fps: 30, audio: false });
if (generation !== this.generation || !frame || typeof frame === 'string') throw new Error('Region capture unavailable');
@@ -54,8 +56,14 @@ export class RegionVideoCapture {
const mapping = regionSelectionToImageCrop(selection, display.bounds, source.getSize(), display.scaleFactor);
if (!mapping) throw new Error('Invalid capture region');
const ratio = Math.min(1, edge / Math.max(mapping.output.width, mapping.output.height));
- const image = source.crop(mapping.crop).resize({ width: Math.max(1, Math.round(mapping.output.width * ratio)), height: Math.max(1, Math.round(mapping.output.height * ratio)) });
- return { ...image.getSize(), data: new Uint8Array(image.toBitmap()) };
+ const output = { width: Math.max(1, Math.round(mapping.output.width * ratio)), height: Math.max(1, Math.round(mapping.output.height * ratio)) };
+ let image = source.crop(mapping.crop);
+ if (image.getSize().width !== output.width || image.getSize().height !== output.height) image = image.resize(output);
+ // toBitmap owns this buffer; a view avoids copying the entire selected frame
+ // again before Electron serializes it. Copy sliced buffers so IPC cannot
+ // clone bytes outside the selection from a larger backing buffer.
+ const pixels = image.toBitmap();
+ return { ...image.getSize(), data: pixels.buffer instanceof ArrayBuffer && pixels.byteLength === pixels.buffer.byteLength ? new Uint8Array(pixels.buffer) : new Uint8Array(pixels) };
}
stop(): void { this.generation++; this.native?.stop(); this.native = null; }
diff --git a/apps/desktop/src/main/region-screenshot/save.ts b/apps/desktop/src/main/region-screenshot/save.ts
index f077ed5763..1e9d4a0b9f 100644
--- a/apps/desktop/src/main/region-screenshot/save.ts
+++ b/apps/desktop/src/main/region-screenshot/save.ts
@@ -4,6 +4,7 @@ import path from 'node:path';
import { createLogger } from '../logger';
import { t } from '../i18n';
+import { encodeScreenshotImage } from './encodeImage';
const log = createLogger('region-screenshot:save');
@@ -37,7 +38,7 @@ export async function saveScreenshotImage(image: NativeImage): Promise<boolean>
const isJpeg = extension === '.jpg' || extension === '.jpeg';
const filePath = extension ? result.filePath : `${result.filePath}.png`;
try {
- await fs.writeFile(filePath, isJpeg ? image.toJPEG(92) : image.toPNG());
+ await fs.writeFile(filePath, await encodeScreenshotImage(image, isJpeg));
lastDirectory = path.dirname(filePath);
return true;
} catch (error) {
diff --git a/apps/desktop/src/main/remote-desktop/__tests__/macNativeCapture.test.ts b/apps/desktop/src/main/remote-desktop/__tests__/macNativeCapture.test.ts
index 2db2adcfce..c704508920 100644
--- a/apps/desktop/src/main/remote-desktop/__tests__/macNativeCapture.test.ts
+++ b/apps/desktop/src/main/remote-desktop/__tests__/macNativeCapture.test.ts
@@ -23,7 +23,7 @@ afterEach(() => {
// A failed fake-timer case must not leave later cases waiting on frozen time.
vi.useRealTimers();
});
-function setup() {
+function setup(encodeOnRequest = false) {
const child = Object.assign(new EventEmitter(), {
stdin: new PassThrough(),
stdout: new PassThrough(),
@@ -31,7 +31,7 @@ function setup() {
kill: vi.fn(),
});
h.spawn.mockReturnValue(child);
- const owner = new NativeDesktopCapture();
+ const owner = new NativeDesktopCapture({ encodeOnRequest });
owners.push(owner);
return { child, owner };
}
@@ -47,6 +47,25 @@ it.each([
expect(h.spawn.mock.calls[0][1]).toEqual(['1', 'cursor-overlay', ...args]);
});
+// Unit: the local recording mode must preserve frame parsing, cancellation and
+// the private helper boundary. Existing tests only cover eager remote streams.
+// Minimum input: opt-in + one frame, then stop while the second frame is pending.
+it('opts local recording into demand encoding without changing replies or cancellation', async () => {
+ const { child, owner } = setup(true);
+ const settings = { fps: 30, quality: 'hd', audio: false } as const;
+ const frame = { jpeg: 'anBlZw==', cursor: null };
+ const first = owner.frame('1', true, settings);
+ await vi.waitFor(() => expect(h.spawn).toHaveBeenCalledOnce());
+ expect(h.spawn.mock.calls[0][1]).toEqual(['1', 'cursor-overlay-demand', '30', '0.9', '3840', '3000000']);
+ child.stdout.write(JSON.stringify(frame) + '\n');
+ await expect(first).resolves.toEqual(frame);
+ const pending = owner.frame('1', true, settings);
+ owner.stop();
+ await expect(pending).resolves.toBeNull();
+ child.stdout.write(JSON.stringify(frame) + '\n');
+ expect(child.kill).toHaveBeenCalledOnce();
+});
+
it('accepts frames up to the tier budget and stops capture beyond it', async () => {
const frame = { jpeg: 'a'.repeat(2_666_668), cursor: null };
const hd = setup();
diff --git a/apps/desktop/src/main/remote-desktop/nativeCapture.ts b/apps/desktop/src/main/remote-desktop/nativeCapture.ts
index 8c2aeadf6d..a6c80d0311 100644
--- a/apps/desktop/src/main/remote-desktop/nativeCapture.ts
+++ b/apps/desktop/src/main/remote-desktop/nativeCapture.ts
@@ -148,6 +148,10 @@ export async function photographMacWindow(
* No adapter keeps frame history on disk.
*/
export class NativeDesktopCapture {
+ // Local recording can defer JPEG work until a frame is requested. Remote
+ // desktop and window-only callers retain their existing eager stream.
+ constructor(private readonly options: { encodeOnRequest?: boolean } = {}) {}
+
private excludedWindows = '';
private confirmedExclusion = '';
setExcludedWindows(ids: number[]): void {
@@ -267,7 +271,7 @@ export class NativeDesktopCapture {
: overlay
? [
display,
- 'cursor-overlay',
+ this.options.encodeOnRequest ? 'cursor-overlay-demand' : 'cursor-overlay',
String(fps),
String(quality),
String(profile.physicalMaxEdge),
diff --git a/apps/desktop/src/renderer/features/region-screenshot/LiveCapturePanel.tsx b/apps/desktop/src/renderer/features/region-screenshot/LiveCapturePanel.tsx
index f58763bd76..17a902fa4c 100644
--- a/apps/desktop/src/renderer/features/region-screenshot/LiveCapturePanel.tsx
+++ b/apps/desktop/src/renderer/features/region-screenshot/LiveCapturePanel.tsx
@@ -92,7 +92,8 @@ export function LiveCapturePanel({ begin, token, bridge }: { begin: RegionCaptur
state.startedAt = performance.now(); state.elapsed = 0;
state.recorder = new CaptureRecorder(state.canvas!, begin.mode === 'gif' ? 'gif' : 'webm', () => { setStatus('limit'); void finish(); });
}
- state.recorder.add(currentTime());
+ await state.recorder.add(currentTime());
+ if (!state.active || state.phase !== 'capturing') return;
setElapsed(Math.floor(currentTime() / 1000) * 1000);
if (currentTime() >= MAX_RECORDING_MS) { setStatus('limit'); queueMicrotask(() => void finish()); }
}
diff --git a/apps/desktop/src/renderer/features/region-screenshot/Magnifier.tsx b/apps/desktop/src/renderer/features/region-screenshot/Magnifier.tsx
index b382c25e60..6ba646ef08 100644
--- a/apps/desktop/src/renderer/features/region-screenshot/Magnifier.tsx
+++ b/apps/desktop/src/renderer/features/region-screenshot/Magnifier.tsx
@@ -55,8 +55,11 @@ export function Magnifier({
const canvas = canvasRef.current;
if (!canvas || !frame) return;
const dpr = window.devicePixelRatio || 1;
- canvas.width = Math.round(VIEW * dpr);
- canvas.height = Math.round(VIEW * dpr);
+ const pixels = Math.round(VIEW * dpr);
+ // Assigning even an unchanged size resets the backing store and context.
+ // Pointer movement only needs a repaint; resize when the density changes.
+ if (canvas.width !== pixels) canvas.width = pixels;
+ if (canvas.height !== pixels) canvas.height = pixels;
const ctx = canvas.getContext('2d');
if (!ctx) return;
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
diff --git a/apps/desktop/src/renderer/features/region-screenshot/annotations.ts b/apps/desktop/src/renderer/features/region-screenshot/annotations.ts
index 9328770689..adbb89fd77 100644
--- a/apps/desktop/src/renderer/features/region-screenshot/annotations.ts
+++ b/apps/desktop/src/renderer/features/region-screenshot/annotations.ts
@@ -200,20 +200,28 @@ function drawArrow(
ctx.fill();
}
+// Point arrays are immutable, including drafts, edits and undo/redo. Weak keys
+// release paths together with their annotations; no raster/alpha cache is used.
+const strokePaths = new WeakMap<readonly RegionPoint[], Path2D>();
+
function drawStroke(ctx: CanvasRenderingContext2D, points: readonly RegionPoint[]): void {
if (points.length === 0) return;
- ctx.beginPath();
- ctx.moveTo(points[0].x, points[0].y);
- if (points.length === 1) ctx.lineTo(points[0].x + 0.01, points[0].y);
- for (let i = 1; i < points.length - 1; i++) {
- const mid = { x: (points[i].x + points[i + 1].x) / 2, y: (points[i].y + points[i + 1].y) / 2 };
- ctx.quadraticCurveTo(points[i].x, points[i].y, mid.x, mid.y);
- }
- if (points.length > 1) {
- const last = points[points.length - 1];
- ctx.lineTo(last.x, last.y);
+ let path = strokePaths.get(points);
+ if (!path) {
+ path = new Path2D();
+ path.moveTo(points[0].x, points[0].y);
+ if (points.length === 1) path.lineTo(points[0].x + 0.01, points[0].y);
+ for (let i = 1; i < points.length - 1; i++) {
+ const mid = { x: (points[i].x + points[i + 1].x) / 2, y: (points[i].y + points[i + 1].y) / 2 };
+ path.quadraticCurveTo(points[i].x, points[i].y, mid.x, mid.y);
+ }
+ if (points.length > 1) {
+ const last = points[points.length - 1];
+ path.lineTo(last.x, last.y);
+ }
+ strokePaths.set(points, path);
}
- ctx.stroke();
+ ctx.stroke(path);
}
export function drawAnnotation(
diff --git a/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.test.ts b/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.test.ts
index 1efcf3c40f..65e7bd537b 100644
--- a/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.test.ts
+++ b/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.test.ts
@@ -1,6 +1,8 @@
import { afterEach, expect, it, vi } from 'vitest';
import { CaptureRecorder } from './captureRecorder';
import { finalizeWebmDuration } from './webmDuration';
+import { GifEncoding, type GifRequest } from './gifEncoding';
+import { GIFEncoder, quantize, applyPalette } from 'gifenc';
// Real playback reported Infinity and could not show a timeline. Existing tests
// only decoded pixels. Minimal streaming WebM Info without Duration; tier: unit.
@@ -17,7 +19,7 @@ it('finalizes streaming WebM duration without changing its encoded frames', () =
// Unit regression: the UI matrix produced an empty short WebM that was reported
// as saved. Exercise the encoder's real finish boundary with an empty browser
// stop event; geometry and browser playback tests do not cover this outcome.
-afterEach(() => vi.unstubAllGlobals());
+afterEach(() => { vi.unstubAllGlobals(); vi.useRealTimers(); });
it('rejects a recording when the browser stops without encoded frames', async () => {
class EmptyRecorder {
@@ -31,7 +33,7 @@ it('rejects a recording when the browser stops without encoded frames', async ()
const track = { stop: vi.fn(), requestFrame: vi.fn() };
const canvas = { captureStream: () => ({ getTracks: () => [track], getVideoTracks: () => [track] }) } as unknown as HTMLCanvasElement;
const recorder = new CaptureRecorder(canvas, 'webm', () => {});
- recorder.add(0);
+ await recorder.add(0);
await expect(recorder.finish(1)).rejects.toThrow('No video frames were encoded');
expect(track.stop).toHaveBeenCalled();
});
@@ -67,17 +69,109 @@ it('coalesces identical GIF frames without losing elapsed time or changes after
const canvas = { width: 2, height: 1, getContext: () => ({
getImageData: () => ({ data: pixels.slice() }),
}) } as unknown as HTMLCanvasElement;
- const recorder = new CaptureRecorder(canvas, 'gif', () => {});
- recorder.add(0);
- recorder.add(100);
- recorder.add(200);
+ const recorder = new CaptureRecorder(canvas, 'gif', () => {}, () => new TestGifWorker() as unknown as Worker);
+ await recorder.add(0);
+ await recorder.add(100);
+ await recorder.add(200);
pixels.set([0, 0, 255, 255], 4);
- recorder.add(300);
+ await recorder.add(300);
recorder.pause(400);
recorder.resume();
- recorder.add(400);
- recorder.add(500);
+ await recorder.add(400);
+ await recorder.add(500);
const bytes = await recorder.finish(600);
expect(frameDelays(bytes)).toEqual([300, 100, 200]);
recorder.dispose();
});
+
+// The unit transport delivers the actual encoder's results; the Electron benchmark
+// exercises the real Worker separately. Structured clone models buffer ownership.
+class TestGifWorker {
+ onmessage: Worker['onmessage'] = null;
+ onerror: Worker['onerror'] = null;
+ onmessageerror: Worker['onmessageerror'] = null;
+ terminated = false;
+ messages: GifRequest[] = [];
+ private encoder: GifEncoding | null = null;
+ constructor(private readonly automatic = true) {}
+ postMessage(message: GifRequest, transfer: Transferable[] = []) {
+ this.messages.push(structuredClone(message, { transfer }));
+ if (this.automatic) queueMicrotask(() => this.deliver());
+ }
+ deliver() {
+ if (this.terminated) return;
+ for (const data of this.messages.splice(0)) {
+ if (data.kind === 'init') this.encoder = new GifEncoding(data.width, data.height);
+ else if (data.kind === 'pause') this.encoder!.pause(data.at);
+ else {
+ const response = data.kind === 'add'
+ ? { kind: 'added', id: data.id, limit: this.encoder!.add(data.pixels, data.at) }
+ : { kind: 'finished', id: data.id, bytes: this.encoder!.finish(data.at) };
+ this.onmessage?.call(this as unknown as Worker, { data: response } as MessageEvent);
+ }
+ }
+ }
+ terminate() { this.terminated = true; }
+}
+
+const gifCanvas = () => ({ width: 2, height: 1, getContext: () => ({
+ getImageData: () => ({ data: new Uint8ClampedArray([255, 0, 0, 255, 0, 0, 255, 255]) }),
+}) }) as unknown as HTMLCanvasElement;
+
+// Unit: equal rgb444 bin counts alone do not imply equal palettes. Compare the
+// real worker-facing encoder with independent, unconditionally quantized frames.
+// Spatial permutations may reuse quantization; RGB-sum changes must invalidate it.
+it('preserves every GIF byte for moved colors, same-bin color changes and resume', () => {
+ const encoder = new GifEncoding(32, 16), reference = GIFEncoder();
+ const original = new Uint8ClampedArray(32 * 16 * 4);
+ for (let i = 0; i < original.length; i += 4) {
+ original[i] = (i * 13) % 256; original[i + 1] = (i >>> 2) % 256;
+ original[i + 2] = (i >>> 4) % 256; original[i + 3] = 255;
+ }
+ const moved = new Uint8ClampedArray(original.length);
+ moved.set(original.subarray(4)); moved.set(original.subarray(0, 4), moved.length - 4);
+ const changed = moved.slice(); changed[0] += 1;
+ const alpha = changed.slice(); alpha[3] = 120;
+ const frames = [original, moved, changed, alpha, original];
+ frames.forEach((pixels, i) => {
+ encoder.add(pixels, i * 100);
+ if (i === 2) encoder.pause((i + 1) * 100);
+ const palette = quantize(pixels, 256, { format: 'rgb444' });
+ reference.writeFrame(applyPalette(pixels, palette, 'rgb444'), 32, 16, { palette, delay: 100, repeat: 0 });
+ });
+ reference.finish();
+ expect(encoder.finish(500)).toEqual(reference.bytes());
+});
+
+// Worker migration creates new timing boundaries. Existing synchronous GIF tests
+// cannot cover pause/finish during encoding, cancellation or worker failure. Unit:
+// one accepted 2x1 frame must settle before finish, without buffering a second frame.
+it('orders pause and finish behind an in-flight GIF frame and bounds the queue', async () => {
+ const worker = new TestGifWorker(false);
+ const recorder = new CaptureRecorder(gifCanvas(), 'gif', () => {}, () => worker as unknown as Worker);
+ const adding = recorder.add(0);
+ await expect(recorder.add(100)).rejects.toThrow('still in flight');
+ recorder.pause(200);
+ const finishing = recorder.finish(300);
+ worker.deliver();
+ await adding;
+ worker.deliver();
+ expect(frameDelays(await finishing)).toEqual([200]);
+ expect(worker.terminated).toBe(true);
+ await expect(recorder.finish(400)).rejects.toThrow('already stopped');
+});
+
+it.each(['cancel', 'error', 'messageerror', 'timeout'] as const)('settles a pending GIF frame on %s and releases its worker', async (cause) => {
+ vi.useFakeTimers();
+ const worker = new TestGifWorker(false);
+ const recorder = new CaptureRecorder(gifCanvas(), 'gif', () => {}, () => worker as unknown as Worker);
+ const rejected = expect(recorder.add(0)).rejects.toThrow(/disposed|failed|timed out/);
+ if (cause === 'cancel') recorder.dispose();
+ else if (cause === 'error') worker.onerror?.call(worker as unknown as Worker, {} as ErrorEvent);
+ else if (cause === 'messageerror') worker.onmessageerror?.call(worker as unknown as Worker, {} as MessageEvent);
+ else await vi.advanceTimersByTimeAsync(15_000);
+ await rejected;
+ expect(worker.terminated).toBe(true);
+ expect(vi.getTimerCount()).toBe(0);
+ recorder.dispose();
+});
diff --git a/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.ts b/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.ts
index 6ce806b50a..3c69d0e4f4 100644
--- a/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.ts
+++ b/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.ts
@@ -1,20 +1,20 @@
-import { GIFEncoder, applyPalette, quantize } from 'gifenc';
+import { GifWorker } from './gifWorker';
import { MAX_RECORDING_BYTES } from '../../../shared/regionCapture';
import { finalizeWebmDuration } from './webmDuration';
/** Bounded, local-only encoding. Source pixels are supplied by the host's selected region. */
export class CaptureRecorder {
- private readonly gif;
+ private readonly gif: GifWorker | null;
+ private inFlight: Promise<void> | null = null;
private readonly recorder: MediaRecorder | null;
private readonly stream: MediaStream | null;
private readonly chunks: Blob[] = [];
private bytes = 0;
- private previous: { pixels: Uint8ClampedArray; index: Uint8Array; palette: number[][]; at: number } | null = null;
private stopped = false;
private failure: Error | null = null;
- constructor(private readonly canvas: HTMLCanvasElement, readonly format: 'webm' | 'gif', private readonly onLimit: () => void) {
- this.gif = format === 'gif' ? GIFEncoder() : null;
+ constructor(private readonly canvas: HTMLCanvasElement, readonly format: 'webm' | 'gif', private readonly onLimit: () => void, createGifWorker?: () => Worker) {
+ this.gif = format === 'gif' ? new GifWorker(canvas.width, canvas.height, createGifWorker) : null;
this.stream = format === 'webm' ? canvas.captureStream(0) : null;
if (this.stream) {
const mimeType = ['video/webm;codecs=vp9', 'video/webm;codecs=vp8', 'video/webm'].find((type) => MediaRecorder.isTypeSupported(type));
@@ -36,33 +36,23 @@ export class CaptureRecorder {
} else this.recorder = null;
}
- add(at: number): void {
- if (this.stopped) return;
+ add(at: number): Promise<void> {
+ if (this.stopped) return Promise.resolve();
+ if (this.inFlight) return Promise.reject(new Error('Recording frame still in flight'));
if (this.recorder) {
(this.stream!.getVideoTracks()[0] as CanvasCaptureMediaStreamTrack).requestFrame();
- } else if (this.gif) {
- const pixels = this.canvas.getContext('2d', { willReadFrequently: true })!.getImageData(0, 0, this.canvas.width, this.canvas.height);
- // Hold identical frames until the next change, pause or finish. Exact RGBA
- // comparison preserves small cursor/text changes and the full hold duration.
- if (this.previous && samePixels(this.previous.pixels, pixels.data)) return;
- this.flushGif(at);
- const palette = quantize(pixels.data, 256, { format: 'rgb444' });
- this.previous = { pixels: pixels.data, palette, index: applyPalette(pixels.data, palette, 'rgb444'), at };
- if (this.gif.bytesView().length > MAX_RECORDING_BYTES - 4 * 1024 * 1024) this.onLimit();
+ return Promise.resolve();
}
- }
-
- private flushGif(at: number): void {
- if (!this.previous || !this.gif) return;
- this.gif.writeFrame(this.previous.index, this.canvas.width, this.canvas.height, {
- palette: this.previous.palette, delay: Math.max(20, at - this.previous.at), repeat: 0,
- });
- this.previous = null;
+ const pixels = this.canvas.getContext('2d', { willReadFrequently: true })!.getImageData(0, 0, this.canvas.width, this.canvas.height);
+ this.inFlight = this.gif!.add(pixels.data, at).then((limit) => {
+ if (limit && !this.stopped) this.onLimit();
+ }).finally(() => { this.inFlight = null; });
+ return this.inFlight;
}
pause(at: number): void {
if (this.recorder?.state === 'recording') this.recorder.pause();
- this.flushGif(at);
+ this.gif?.pause(at);
}
resume(): void { if (this.recorder?.state === 'paused') this.recorder.resume(); }
@@ -82,11 +72,8 @@ export class CaptureRecorder {
if (bytes.length > MAX_RECORDING_BYTES) throw new Error('Recording size limit');
return bytes;
}
- this.flushGif(at);
- this.gif!.finish();
- const bytes = this.gif!.bytes();
- if (bytes.length > MAX_RECORDING_BYTES) throw new Error('Recording size limit');
- return bytes;
+ await this.inFlight;
+ return this.gif!.finish(at);
}
dispose(): void {
@@ -94,14 +81,6 @@ export class CaptureRecorder {
if (this.recorder && this.recorder.state !== 'inactive') this.recorder.stop();
this.stream?.getTracks().forEach((track) => track.stop());
this.chunks.length = 0;
- this.previous = null;
+ this.gif?.dispose();
}
}
-
-function samePixels(a: Uint8ClampedArray, b: Uint8ClampedArray): boolean {
- if (a.length !== b.length) return false;
- const left = new Uint32Array(a.buffer, a.byteOffset, a.length / 4);
- const right = new Uint32Array(b.buffer, b.byteOffset, b.length / 4);
- for (let i = 0; i < left.length; i++) if (left[i] !== right[i]) return false;
- return true;
-}
diff --git a/apps/desktop/src/renderer/features/region-screenshot/gifEncoding.ts b/apps/desktop/src/renderer/features/region-screenshot/gifEncoding.ts
new file mode 100644
index 0000000000..e382970dcc
--- /dev/null
+++ b/apps/desktop/src/renderer/features/region-screenshot/gifEncoding.ts
@@ -0,0 +1,70 @@
+import { GIFEncoder, applyPalette, quantize } from 'gifenc';
+import { MAX_RECORDING_BYTES } from '../../../shared/regionCapture';
+
+/** The original GIF algorithm, isolated from Canvas and scheduling. One instance
+ * owns one recording; no approximate palettes, frame dropping or quality changes. */
+export class GifEncoding {
+ private readonly gif = GIFEncoder();
+ private histogram = new Uint32Array(4096 * 4);
+ private nextHistogram = new Uint32Array(4096 * 4);
+ private palette: number[][] | null = null;
+ private previous: { pixels: Uint8ClampedArray; index: Uint8Array; palette: number[][]; at: number } | null = null;
+
+ constructor(private readonly width: number, private readonly height: number) {}
+
+ add(pixels: Uint8ClampedArray, at: number): boolean {
+ if (this.previous && samePixels(this.previous.pixels, pixels)) return false;
+ this.pause(at);
+ // gifenc's rgb444 quantizer depends only on each bin's count and RGB sums.
+ // Compare all integers, not a hash or approximate palette. Spatially moved
+ // colors can reuse quantization while still mapping and encoding every frame.
+ const bins = this.nextHistogram;
+ bins.fill(0);
+ for (let i = 0; i < pixels.length; i += 4) {
+ const r = pixels[i], g = pixels[i + 1], b = pixels[i + 2];
+ const at = (((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4)) * 4;
+ bins[at]++; bins[at + 1] += r; bins[at + 2] += g; bins[at + 3] += b;
+ }
+ if (!this.palette || !bins.every((value, i) => value === this.histogram[i])) {
+ this.palette = quantize(pixels, 256, { format: 'rgb444' });
+ }
+ [this.histogram, this.nextHistogram] = [bins, this.histogram];
+ const palette = this.palette;
+ this.previous = { pixels, palette, index: applyPalette(pixels, palette, 'rgb444'), at };
+ return this.gif.bytesView().length > MAX_RECORDING_BYTES - 4 * 1024 * 1024;
+ }
+
+ pause(at: number): void {
+ if (!this.previous) return;
+ this.gif.writeFrame(this.previous.index, this.width, this.height, {
+ palette: this.previous.palette, delay: Math.max(20, at - this.previous.at), repeat: 0,
+ });
+ this.previous = null;
+ }
+
+ finish(at: number): Uint8Array<ArrayBuffer> {
+ this.pause(at);
+ this.gif.finish();
+ const bytes = this.gif.bytes();
+ if (bytes.length > MAX_RECORDING_BYTES) throw new Error('Recording size limit');
+ return bytes;
+ }
+}
+
+function samePixels(a: Uint8ClampedArray, b: Uint8ClampedArray): boolean {
+ if (a.length !== b.length) return false;
+ const left = new Uint32Array(a.buffer, a.byteOffset, a.length / 4);
+ const right = new Uint32Array(b.buffer, b.byteOffset, b.length / 4);
+ for (let i = 0; i < left.length; i++) if (left[i] !== right[i]) return false;
+ return true;
+}
+
+export type GifRequest =
+ | { kind: 'init'; width: number; height: number }
+ | { kind: 'add'; id: number; pixels: Uint8ClampedArray<ArrayBuffer>; at: number }
+ | { kind: 'pause'; at: number }
+ | { kind: 'finish'; id: number; at: number };
+export type GifResponse =
+ | { kind: 'added'; id: number; limit: boolean }
+ | { kind: 'finished'; id: number; bytes: Uint8Array<ArrayBuffer> }
+ | { kind: 'error'; message: string };
diff --git a/apps/desktop/src/renderer/features/region-screenshot/gifEncoding.worker.ts b/apps/desktop/src/renderer/features/region-screenshot/gifEncoding.worker.ts
new file mode 100644
index 0000000000..a67b1fd321
--- /dev/null
+++ b/apps/desktop/src/renderer/features/region-screenshot/gifEncoding.worker.ts
@@ -0,0 +1,23 @@
+import { GifEncoding, type GifRequest, type GifResponse } from './gifEncoding';
+
+let encoder: GifEncoding | null = null;
+const send = (response: GifResponse, transfer: Transferable[] = []) => (self as unknown as Worker).postMessage(response, transfer);
+
+// A worker processes these messages in order. Pause cannot overtake an accepted
+// frame, and finish cannot overtake pause, even while encoding blocks this thread.
+self.onmessage = ({ data }: MessageEvent<GifRequest>) => {
+ try {
+ if (data.kind === 'init') encoder = new GifEncoding(data.width, data.height);
+ else if (!encoder) throw new Error('GIF encoder unavailable');
+ else if (data.kind === 'add') send({ kind: 'added', id: data.id, limit: encoder.add(data.pixels, data.at) });
+ else if (data.kind === 'pause') encoder.pause(data.at);
+ else {
+ const bytes = encoder.finish(data.at);
+ send({ kind: 'finished', id: data.id, bytes }, [bytes.buffer]);
+ encoder = null;
+ }
+ } catch (error) {
+ encoder = null;
+ send({ kind: 'error', message: error instanceof Error ? error.message : 'GIF encoding failed' });
+ }
+};
diff --git a/apps/desktop/src/renderer/features/region-screenshot/gifWorker.ts b/apps/desktop/src/renderer/features/region-screenshot/gifWorker.ts
new file mode 100644
index 0000000000..9d0c823532
--- /dev/null
+++ b/apps/desktop/src/renderer/features/region-screenshot/gifWorker.ts
@@ -0,0 +1,71 @@
+import EncodingWorker from './gifEncoding.worker?worker';
+import type { GifRequest, GifResponse } from './gifEncoding';
+
+/** At most one frame is in flight. Pixels and final bytes are transferred, not
+ * cloned. Cancelling terminates work immediately and settles the awaiting sample. */
+export class GifWorker {
+ private readonly worker: Worker;
+ private sequence = 0;
+ private failure: Error | null = null;
+ private pending: { id: number; resolve: (response: GifResponse) => void; reject: (error: Error) => void; timer: ReturnType<typeof setTimeout> } | null = null;
+
+ constructor(width: number, height: number, createWorker = () => new EncodingWorker()) {
+ this.worker = createWorker();
+ this.worker.onmessage = ({ data }: MessageEvent<GifResponse>) => {
+ if (data.kind === 'error') { this.fail(new Error(data.message)); return; }
+ if (this.pending?.id !== data.id) return;
+ const pending = this.pending;
+ this.pending = null;
+ clearTimeout(pending.timer);
+ pending.resolve(data);
+ };
+ this.worker.onerror = () => this.fail(new Error('GIF worker failed'));
+ this.worker.onmessageerror = () => this.fail(new Error('GIF worker response failed'));
+ try { this.worker.postMessage({ kind: 'init', width, height } satisfies GifRequest); }
+ catch (error) { this.worker.terminate(); throw error; }
+ }
+
+ private request(message: GifRequest & { id: number }, transfer: Transferable[] = []): Promise<GifResponse> {
+ if (this.failure) return Promise.reject(this.failure);
+ if (this.pending) return Promise.reject(new Error('GIF frame still in flight'));
+ return new Promise((resolve, reject) => {
+ const timer = setTimeout(() => this.fail(new Error('GIF encoding timed out')), 15_000);
+ this.pending = { id: message.id, resolve, reject, timer };
+ try { this.worker.postMessage(message, transfer); }
+ catch (error) { this.fail(error instanceof Error ? error : new Error('GIF worker unavailable')); }
+ });
+ }
+
+ async add(pixels: Uint8ClampedArray<ArrayBuffer>, at: number): Promise<boolean> {
+ const result = await this.request({ kind: 'add', id: ++this.sequence, pixels, at }, [pixels.buffer]);
+ if (result.kind !== 'added') throw new Error('Invalid GIF frame response');
+ return result.limit;
+ }
+
+ pause(at: number): void {
+ if (this.failure) return;
+ try { this.worker.postMessage({ kind: 'pause', at } satisfies GifRequest); }
+ catch (error) { this.fail(error instanceof Error ? error : new Error('GIF worker unavailable')); }
+ }
+
+ async finish(at: number): Promise<Uint8Array<ArrayBuffer>> {
+ try {
+ const result = await this.request({ kind: 'finish', id: ++this.sequence, at });
+ if (result.kind !== 'finished') throw new Error('Invalid GIF finish response');
+ return result.bytes;
+ } finally { this.dispose(); }
+ }
+
+ private fail(error: Error): void {
+ this.failure ??= error;
+ this.worker.terminate();
+ if (this.pending) {
+ const pending = this.pending;
+ this.pending = null;
+ clearTimeout(pending.timer);
+ pending.reject(this.failure);
+ }
+ }
+
+ dispose(): void { this.fail(new Error('GIF recording disposed')); }
+}
diff --git a/apps/desktop/src/shared/scrollCapture.ts b/apps/desktop/src/shared/scrollCapture.ts
index d8889d412a..7529a690e5 100644
--- a/apps/desktop/src/shared/scrollCapture.ts
+++ b/apps/desktop/src/shared/scrollCapture.ts
@@ -82,6 +82,7 @@ function matchSampledFrames(previous: RegionScreenshotBitmap, next: RegionScreen
}
const rowErrors = Array.from({ length: height }, (_, y) => errorAt(previous, next, y, y, columns));
if (rowErrors.every((error) => error < 2)) return { kind: 'same' };
+ const mostlyStationary = rowErrors.filter((error) => error < 2).length / height >= 0.9;
let header = 0;
let footer = 0;
const fixedLimit = Math.floor(height / 3);
@@ -102,10 +103,15 @@ function matchSampledFrames(previous: RegionScreenshotBitmap, next: RegionScreen
for (let sample = 0; sample < rows; sample++) {
const y = start + Math.floor((sample / rows) * overlap);
sum += errorAt(previous, next, y + offset, y, columns);
- // Errors are nonnegative. Once a reliable candidate exists, an offset
- // already outside its ambiguity margin can neither win nor invalidate it.
- // Keep searching all offsets, but stop reading rows for this loser.
- if (bestScore <= 3 && sum / rows > bestScore + Math.max(0.15, bestScore * 0.5)) break;
+ // Errors are nonnegative: this partial mean is a lower bound. An accepted
+ // score is <= 3 and its largest ambiguity margin is 1.5, so a candidate
+ // already above 4.5 cannot win or invalidate any accepted match. Prune it
+ // even before finding a winner (especially valuable for unrelated frames).
+ // Keep full scores for mostly-stationary frames: their zero-motion winner
+ // may intentionally be accepted above 3, so its ordering still matters.
+ const cutoff = bestScore <= 3 ? bestScore + Math.max(0.15, bestScore * 0.5)
+ : mostlyStationary ? Infinity : 4.5;
+ if (sum / rows > cutoff) break;
}
const score = sum / rows;
candidates.push({ offset, score });
@@ -117,7 +123,7 @@ function matchSampledFrames(previous: RegionScreenshotBitmap, next: RegionScreen
const reverse = matchSampledFrames(next, previous, false);
return reverse.kind === 'append' ? { ...reverse, kind: 'prepend', offset: -reverse.offset } : { kind: 'unmatched' };
}
- if (best?.offset === 0 && (best.score <= 3 || rowErrors.filter((error) => error < 2).length / height >= 0.9)) return { kind: 'same' };
+ if (best?.offset === 0 && (best.score <= 3 || mostlyStationary)) return { kind: 'same' };
if (!best || best.offset <= 0 || best.score > 3) return { kind: 'unmatched' };
const rival = candidates.find((candidate) => Math.abs(candidate.offset - best.offset) > 2);
// White space dilutes the mean error on text pages. Compare relative confidence:
diff --git a/docs/acceptance/macos-region-snapping-2026-10-29.md b/docs/acceptance/macos-region-snapping-2026-10-29.md
new file mode 100644
index 0000000000..09f3c4a510
--- /dev/null
+++ b/docs/acceptance/macos-region-snapping-2026-10-29.md
@@ -0,0 +1,41 @@
+# macOS 截图窗口识别回归验证
+
+环境:macOS 26.4(25E246),Apple Silicon,单显示器。
+
+用户验收:2026-10-29 从本 worktree 启动的独立 Global 开发版中,用户完成选区测试并明确确认
+“选区验收通过”。此人工结论限于选区行为,不扩展为滚动截图、录制或多屏验收。
+
+## 问题与修复
+
+PR #7661 的 `window-at` 使用 AppKit 窗口命中,但 stdin 驱动的原生 helper
+没有初始化 `NSApplication`,在可见窗口内仍返回 `hwnd: 0`。主进程据此取消吸附目标。
+在读取首条请求前初始化应用连接,并使用 `.prohibited` 保持后台身份;请求结构、
+窗口排除规则和未知遮挡处理均未改动。
+
+## 验证结果
+
+- `node apps/desktop/scripts/check-macos-region-snapping.mjs`:通过,3.53 秒(含两份 Swift
+ 编译)。实际运行生产 helper,验证冷启动与第二次启动、焦点/鼠标保持、滚动内容区、
+ 标题栏整窗、真实遮挡、排除截图浮层、浮层覆盖下的内容区、忽略鼠标事件,以及重新接收事件。
+- 同一脚本在修复前源码和本机安装版 helper 上均失败:可枚举到测试窗口,但冷启动命中
+ 持续返回 `hwnd: 0`。使用 `--helper=<binary>` 可复现,无需修改已安装应用。
+- Desktop 截图 main、renderer 和 shared 定向单测:9 个文件、111 项通过,1.69 秒。
+- `pnpm --filter desktop run --if-present typecheck`:通过。
+- `pnpm ui:check --page region-capture --case snapping --theme all`:2/2 通过,4.5 秒;
+ 已查看本地总览图,Light/Dark 的选框、区域切换和锁定正常。未上传截图。
+- `pnpm check:test-hygiene`、`pnpm check:dev-docs`、`git diff --check`:通过。
+
+## 测试价值和边界
+
+新增脚本属于显式原生 E2E,不进入默认 unit。既有单测替换原生进程回复,无法发现
+AppKit 未初始化;最小失败输入是新 helper 对真实可见窗口中心的一次 `window-at`。
+测试临时二进制使用独立系统临时目录,结束后关闭测试进程、清理目录并恢复原前台应用
+(仅在测试应用仍在前台时)。不读取用户窗口内容,不移动系统鼠标,不修改系统权限。
+
+透明像素不等于鼠标穿透:本机系统对半透明测试窗的透明部分仍命中前窗,独立 AppKit
+应用与 helper 结果一致;用例验证遵从系统实际命中,不把“无条件穿透透明像素”记为通过。
+测试浮层覆盖目标且边界不同,模拟截图面板;未覆盖同进程、完全相同边界的 AX 兄弟窗口。
+
+原生测试使用受控 AppKit 窗口;UI 验证使用生产截图组件和模拟截图源,不能冒充完整
+Desktop 快捷键到截屏的端到端验收。未验证 Windows 实机、Intel Mac、多显示器、未授权
+辅助功能和签名安装包;生产改动仅在 macOS helper,未替换当前运行的安装版。
diff --git a/docs/acceptance/region-gif-worker-performance-2026-10-29.json b/docs/acceptance/region-gif-worker-performance-2026-10-29.json
new file mode 100644
index 0000000000..a936cd19b3
--- /dev/null
+++ b/docs/acceptance/region-gif-worker-performance-2026-10-29.json
@@ -0,0 +1,2698 @@
+{
+ "generatedAt": "2026-10-29T06:23:38.518Z",
+ "baseline": "8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0",
+ "samples": 30,
+ "platform": "darwin",
+ "arch": "arm64",
+ "cpu": "Apple M5",
+ "scope": "Real Electron offscreen renderer (1040x760 DIP, 2x density), synthetic opaque BGRA source at the stated dimensions. Excludes OS capture, native window startup, IPC serialization, clipboard and disk. 3 warmups per screenshot/scroll batch; GIF streams include their first frame. Alternating before/after batches. First-paint timing includes two animation frames and is sensitive to vsync/GC. Pipeline probes use production scroll matching and GIF encoding; hover probes count real pointer-driven canvas size assignments; they do not measure presentation latency or allocated memory.",
+ "results": [
+ {
+ "width": 1920,
+ "height": 1080,
+ "scale": 1,
+ "before": {
+ "beginSyncMs": {
+ "p50": 3,
+ "p95": 4.7
+ },
+ "paintedMs": {
+ "p50": 33.4,
+ "p95": 34.3
+ },
+ "exportMs": {
+ "p50": 2.8,
+ "p95": 5
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 3.399999976158142,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 4
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 3.100000023841858
+ },
+ {
+ "syncMs": 4.699999928474426,
+ "paintedMs": 33.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 4.200000047683716
+ },
+ {
+ "syncMs": 5.700000047683716,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 4.399999976158142
+ },
+ {
+ "syncMs": 3.200000047683716,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 3.399999976158142
+ },
+ {
+ "syncMs": 2.799999952316284,
+ "paintedMs": 33.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.700000047683716
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 34.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 34.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.60000002384186,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 3.399999976158142,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 3.600000023841858
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.700000047683716
+ },
+ {
+ "syncMs": 4.100000023841858,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 4
+ },
+ {
+ "syncMs": 3.5,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 4.299999952316284
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 5
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 30.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 3.200000047683716,
+ "paintedMs": 33.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 2.299999952316284
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.3000000715255737
+ },
+ {
+ "syncMs": 3.299999952316284,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 5.100000023841858
+ },
+ {
+ "syncMs": 2.4000000953674316,
+ "paintedMs": 31.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.1999999284744263
+ },
+ {
+ "syncMs": 2.4000000953674316,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.100000023841858
+ },
+ {
+ "syncMs": 2.3000000715255737,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.5
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.5999999046325684
+ },
+ {
+ "syncMs": 2.399999976158142,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.10000002384186,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ }
+ ]
+ },
+ "after": {
+ "beginSyncMs": {
+ "p50": 2.9,
+ "p95": 4.9
+ },
+ "paintedMs": {
+ "p50": 33.4,
+ "p95": 34.1
+ },
+ "exportMs": {
+ "p50": 2.8,
+ "p95": 4.5
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 3.4000000953674316,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 3.799999952316284
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 4.900000095367432,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 4.099999904632568
+ },
+ {
+ "syncMs": 5.5,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 5.199999928474426
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.5
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 34.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 2.700000047683716,
+ "paintedMs": 33.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 2.600000023841858
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 2.9000000953674316
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 3.200000047683716,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 3.600000023841858
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.700000047683716
+ },
+ {
+ "syncMs": 2.5,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.600000023841858
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.700000047683716,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 3.399999976158142,
+ "paintedMs": 33.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 3.799999952316284
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.700000047683716
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 4.200000047683716
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 4.5
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33,
+ "frameWrites": 1,
+ "exportMs": 2.600000023841858
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 34.10000002384186,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 2.799999952316284,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 3.3000000715255737,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.5999999046325684
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 2.700000047683716
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.6999999284744263
+ }
+ ]
+ }
+ },
+ {
+ "width": 3840,
+ "height": 2160,
+ "scale": 2,
+ "before": {
+ "beginSyncMs": {
+ "p50": 7.7,
+ "p95": 8.4
+ },
+ "paintedMs": {
+ "p50": 21.65,
+ "p95": 23.1
+ },
+ "exportMs": {
+ "p50": 8.7,
+ "p95": 13.5
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 13.799999952316284,
+ "paintedMs": 25.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 13.099999904632568
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 17.5,
+ "frameWrites": 1,
+ "exportMs": 13.5
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 13.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 9.100000023841858
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 10.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 9.899999976158142
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 18.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.200000047683716
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 23.09999990463257,
+ "frameWrites": 1,
+ "exportMs": 8.800000071525574
+ },
+ {
+ "syncMs": 7.599999904632568,
+ "paintedMs": 20.59999990463257,
+ "frameWrites": 1,
+ "exportMs": 8.200000047683716
+ },
+ {
+ "syncMs": 8.200000047683716,
+ "paintedMs": 23.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.800000071525574,
+ "paintedMs": 22,
+ "frameWrites": 1,
+ "exportMs": 9.5
+ },
+ {
+ "syncMs": 8,
+ "paintedMs": 19,
+ "frameWrites": 1,
+ "exportMs": 9.199999928474426
+ },
+ {
+ "syncMs": 7.699999928474426,
+ "paintedMs": 20.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 22.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 8,
+ "paintedMs": 21.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 21.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.699999928474426
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 22.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 8.400000095367432,
+ "paintedMs": 10.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 13.700000047683716
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 15.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 13.099999904632568
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 15.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 9.5
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 10,
+ "frameWrites": 1,
+ "exportMs": 8.900000095367432
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 18.5,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 9.100000023841858
+ },
+ {
+ "syncMs": 7.199999928474426,
+ "paintedMs": 20.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.799999952316284,
+ "paintedMs": 22.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.200000047683716
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 23,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 7.900000095367432,
+ "paintedMs": 22.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 22.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 22.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.299999952316284,
+ "paintedMs": 21.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 22.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.100000023841858
+ },
+ {
+ "syncMs": 7.200000047683716,
+ "paintedMs": 23,
+ "frameWrites": 1,
+ "exportMs": 8.599999904632568
+ }
+ ]
+ },
+ "after": {
+ "beginSyncMs": {
+ "p50": 7.5,
+ "p95": 8.7
+ },
+ "paintedMs": {
+ "p50": 21.6,
+ "p95": 23.3
+ },
+ "exportMs": {
+ "p50": 8.4,
+ "p95": 13.4
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 8.699999928474426,
+ "paintedMs": 21,
+ "frameWrites": 1,
+ "exportMs": 13.399999976158142
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 17.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 13.299999952316284
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 15.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 8.899999976158142
+ },
+ {
+ "syncMs": 7.100000023841858,
+ "paintedMs": 10.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.699999928474426
+ },
+ {
+ "syncMs": 7.200000047683716,
+ "paintedMs": 19.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.200000047683716,
+ "paintedMs": 11.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 9.099999904632568
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 19.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.799999952316284,
+ "paintedMs": 11.5,
+ "frameWrites": 1,
+ "exportMs": 8.799999952316284
+ },
+ {
+ "syncMs": 7.300000071525574,
+ "paintedMs": 20.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 21.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.300000071525574
+ },
+ {
+ "syncMs": 8.099999904632568,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 8
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 23.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 9.099999904632568
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 21.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.800000071525574,
+ "paintedMs": 22.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 7.899999976158142
+ },
+ {
+ "syncMs": 7.400000095367432,
+ "paintedMs": 23.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 8.599999904632568
+ },
+ {
+ "syncMs": 9.100000023841858,
+ "paintedMs": 27.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 14.100000023841858
+ },
+ {
+ "syncMs": 7.599999904632568,
+ "paintedMs": 17,
+ "frameWrites": 1,
+ "exportMs": 13.200000047683716
+ },
+ {
+ "syncMs": 6.899999976158142,
+ "paintedMs": 16.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 8
+ },
+ {
+ "syncMs": 7,
+ "paintedMs": 12.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.299999952316284,
+ "paintedMs": 21,
+ "frameWrites": 1,
+ "exportMs": 8.100000023841858
+ },
+ {
+ "syncMs": 7.299999952316284,
+ "paintedMs": 23.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.199999928474426
+ },
+ {
+ "syncMs": 7.799999952316284,
+ "paintedMs": 22,
+ "frameWrites": 1,
+ "exportMs": 8.199999928474426
+ },
+ {
+ "syncMs": 8.700000047683716,
+ "paintedMs": 22,
+ "frameWrites": 1,
+ "exportMs": 8.300000071525574
+ },
+ {
+ "syncMs": 7.599999904632568,
+ "paintedMs": 20.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.200000047683716
+ },
+ {
+ "syncMs": 7.300000071525574,
+ "paintedMs": 21.5,
+ "frameWrites": 1,
+ "exportMs": 8.300000071525574
+ },
+ {
+ "syncMs": 7.599999904632568,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 8.100000023841858
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 22.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 8.100000023841858
+ },
+ {
+ "syncMs": 7.200000047683716,
+ "paintedMs": 22.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.799999952316284,
+ "paintedMs": 22.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.200000047683716
+ },
+ {
+ "syncMs": 7.300000071525574,
+ "paintedMs": 22.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.199999928474426
+ }
+ ]
+ }
+ },
+ {
+ "width": 1600,
+ "height": 10000,
+ "scale": 2,
+ "before": {
+ "beginSyncMs": {
+ "p50": 13.85,
+ "p95": 15.9
+ },
+ "paintedMs": {
+ "p50": 29.5,
+ "p95": 32.2
+ },
+ "exportMs": {
+ "p50": 15.8,
+ "p95": 25.8
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 16.399999976158142,
+ "paintedMs": 26.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 25.800000071525574
+ },
+ {
+ "syncMs": 13,
+ "paintedMs": 19.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 24.399999976158142
+ },
+ {
+ "syncMs": 13.600000023841858,
+ "paintedMs": 19.5,
+ "frameWrites": 1,
+ "exportMs": 17.5
+ },
+ {
+ "syncMs": 14,
+ "paintedMs": 28.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.100000023841858
+ },
+ {
+ "syncMs": 13.600000023841858,
+ "paintedMs": 16.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 17.5
+ },
+ {
+ "syncMs": 12.600000023841858,
+ "paintedMs": 29.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 15.300000071525574
+ },
+ {
+ "syncMs": 15.899999976158142,
+ "paintedMs": 32.60000002384186,
+ "frameWrites": 1,
+ "exportMs": 15.200000047683716
+ },
+ {
+ "syncMs": 13.200000047683716,
+ "paintedMs": 15.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 15.399999976158142
+ },
+ {
+ "syncMs": 13.400000095367432,
+ "paintedMs": 30.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 16.09999990463257
+ },
+ {
+ "syncMs": 14.5,
+ "paintedMs": 31,
+ "frameWrites": 1,
+ "exportMs": 15
+ },
+ {
+ "syncMs": 13.900000095367432,
+ "paintedMs": 30.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 15
+ },
+ {
+ "syncMs": 13.299999952316284,
+ "paintedMs": 17.5,
+ "frameWrites": 1,
+ "exportMs": 15.399999976158142
+ },
+ {
+ "syncMs": 14.5,
+ "paintedMs": 31.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 15.399999976158142
+ },
+ {
+ "syncMs": 13.699999928474426,
+ "paintedMs": 15.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 15.699999928474426
+ },
+ {
+ "syncMs": 14.5,
+ "paintedMs": 31.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 14.700000047683716
+ },
+ {
+ "syncMs": 15.200000047683716,
+ "paintedMs": 26.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 24.399999976158142
+ },
+ {
+ "syncMs": 13.200000047683716,
+ "paintedMs": 18.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 26.5
+ },
+ {
+ "syncMs": 14.399999976158142,
+ "paintedMs": 17.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 16.299999952316284
+ },
+ {
+ "syncMs": 15.599999904632568,
+ "paintedMs": 30.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 14.899999976158142
+ },
+ {
+ "syncMs": 13.700000047683716,
+ "paintedMs": 31.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 16.600000023841858
+ },
+ {
+ "syncMs": 14.100000023841858,
+ "paintedMs": 30.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 15.600000023841858
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 31.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 15.5
+ },
+ {
+ "syncMs": 13.600000023841858,
+ "paintedMs": 31.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 16.300000071525574
+ },
+ {
+ "syncMs": 14.799999952316284,
+ "paintedMs": 29.5,
+ "frameWrites": 1,
+ "exportMs": 15.5
+ },
+ {
+ "syncMs": 13.800000071525574,
+ "paintedMs": 32.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 16.899999976158142
+ },
+ {
+ "syncMs": 14.100000023841858,
+ "paintedMs": 29.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 15.300000071525574
+ },
+ {
+ "syncMs": 13.399999976158142,
+ "paintedMs": 16.5,
+ "frameWrites": 1,
+ "exportMs": 18.199999928474426
+ },
+ {
+ "syncMs": 14.100000023841858,
+ "paintedMs": 27.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 15.899999976158142
+ },
+ {
+ "syncMs": 13.700000047683716,
+ "paintedMs": 31.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 17
+ },
+ {
+ "syncMs": 13.699999928474426,
+ "paintedMs": 29.5,
+ "frameWrites": 1,
+ "exportMs": 16.40000009536743
+ }
+ ]
+ },
+ "after": {
+ "beginSyncMs": {
+ "p50": 14.15,
+ "p95": 16.1
+ },
+ "paintedMs": {
+ "p50": 30.1,
+ "p95": 32
+ },
+ "exportMs": {
+ "p50": 16.35,
+ "p95": 25
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 13.699999928474426,
+ "paintedMs": 24.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 16.800000071525574
+ },
+ {
+ "syncMs": 14.899999976158142,
+ "paintedMs": 30.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 25
+ },
+ {
+ "syncMs": 14.399999976158142,
+ "paintedMs": 21.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 25
+ },
+ {
+ "syncMs": 15.600000023841858,
+ "paintedMs": 21.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 16.100000023841858
+ },
+ {
+ "syncMs": 14.399999976158142,
+ "paintedMs": 29.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 16.699999928474426
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 30.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 15
+ },
+ {
+ "syncMs": 14.200000047683716,
+ "paintedMs": 31.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 17.399999976158142
+ },
+ {
+ "syncMs": 13.300000071525574,
+ "paintedMs": 30.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 16.899999976158142
+ },
+ {
+ "syncMs": 13,
+ "paintedMs": 30.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 15.800000071525574
+ },
+ {
+ "syncMs": 13.399999976158142,
+ "paintedMs": 16.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 18
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 28.5,
+ "frameWrites": 1,
+ "exportMs": 16.100000023841858
+ },
+ {
+ "syncMs": 13.5,
+ "paintedMs": 31.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 17.100000023841858
+ },
+ {
+ "syncMs": 13.300000071525574,
+ "paintedMs": 30.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 15.899999976158142
+ },
+ {
+ "syncMs": 13.399999976158142,
+ "paintedMs": 16.09999990463257,
+ "frameWrites": 1,
+ "exportMs": 18.399999976158142
+ },
+ {
+ "syncMs": 15.899999976158142,
+ "paintedMs": 29.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.5
+ },
+ {
+ "syncMs": 16,
+ "paintedMs": 27.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 24.600000023841858
+ },
+ {
+ "syncMs": 13.799999952316284,
+ "paintedMs": 21,
+ "frameWrites": 1,
+ "exportMs": 25.100000023841858
+ },
+ {
+ "syncMs": 13.5,
+ "paintedMs": 18,
+ "frameWrites": 1,
+ "exportMs": 16.799999952316284
+ },
+ {
+ "syncMs": 14.100000023841858,
+ "paintedMs": 31.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 16.800000071525574
+ },
+ {
+ "syncMs": 15.100000023841858,
+ "paintedMs": 31.90000009536743,
+ "frameWrites": 1,
+ "exportMs": 15
+ },
+ {
+ "syncMs": 13.600000023841858,
+ "paintedMs": 16.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 15.600000023841858
+ },
+ {
+ "syncMs": 14.700000047683716,
+ "paintedMs": 31.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 15.399999976158142
+ },
+ {
+ "syncMs": 15.5,
+ "paintedMs": 32,
+ "frameWrites": 1,
+ "exportMs": 15.100000023841858
+ },
+ {
+ "syncMs": 14.100000023841858,
+ "paintedMs": 17.90000009536743,
+ "frameWrites": 1,
+ "exportMs": 16.5
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 29.5,
+ "frameWrites": 1,
+ "exportMs": 18.199999928474426
+ },
+ {
+ "syncMs": 16.100000023841858,
+ "paintedMs": 29.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 16.199999928474426
+ },
+ {
+ "syncMs": 15.600000023841858,
+ "paintedMs": 30.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 15.399999976158142
+ },
+ {
+ "syncMs": 14.5,
+ "paintedMs": 31.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 15
+ },
+ {
+ "syncMs": 15,
+ "paintedMs": 31.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 15.299999952316284
+ },
+ {
+ "syncMs": 16.700000047683716,
+ "paintedMs": 32,
+ "frameWrites": 1,
+ "exportMs": 15
+ }
+ ]
+ }
+ }
+ ],
+ "pipeline": [
+ {
+ "side": "before",
+ "hover": {
+ "canvasResizes": 120,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.6000000238418579,
+ 0.7000000476837158,
+ 0.7999999523162842,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.3999999761581421,
+ 0.6000000238418579,
+ 0.5999999046325684,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.8000000715255737,
+ 0.5,
+ 0.5999999046325684,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.5,
+ "p95": 0.8
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 5.399999976158142,
+ 5.800000071525574,
+ 5.299999952316284,
+ 5.5,
+ 6,
+ 5.899999976158142,
+ 6.399999976158142,
+ 6.100000023841858,
+ 5.5,
+ 6,
+ 6,
+ 5.399999976158142,
+ 5.700000047683716,
+ 5.899999976158142,
+ 5.399999976158142,
+ 5.5,
+ 6.5,
+ 5.600000023841858,
+ 5.300000071525574,
+ 5.699999928474426,
+ 5.200000047683716,
+ 5.5,
+ 5.5,
+ 5.199999928474426,
+ 5.400000095367432,
+ 5.5,
+ 5.199999928474426,
+ 5.200000047683716,
+ 5.5,
+ 5.100000023841858
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 5.5,
+ "p95": 6.4
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 9.600000023841858,
+ 9.299999952316284,
+ 9.200000047683716,
+ 9.299999952316284,
+ 9.200000047683716,
+ 9.100000023841858,
+ 9.299999952316284,
+ 9.399999976158142,
+ 9.600000023841858,
+ 9.5,
+ 9.299999952316284,
+ 9.100000023841858,
+ 9.200000047683716,
+ 9.199999928474426,
+ 9.200000047683716,
+ 9.299999952316284,
+ 9.300000071525574,
+ 9.699999928474426,
+ 9.100000023841858,
+ 9.300000071525574,
+ 9,
+ 9.299999952316284,
+ 9.100000023841858,
+ 9.299999952316284,
+ 9.200000047683716,
+ 9.199999928474426,
+ 9.600000023841858,
+ 9.200000047683716,
+ 9.199999928474426,
+ 9.100000023841858
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 9.25,
+ "p95": 9.6
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 32,
+ 32.10000002384186,
+ 32,
+ 31.799999952316284,
+ 31.800000071525574,
+ 32,
+ 31.699999928474426,
+ 31.90000009536743,
+ 31.59999990463257,
+ 31.700000047683716,
+ 31.600000023841858,
+ 31.699999928474426,
+ 31.600000023841858,
+ 31.899999976158142,
+ 31.700000047683716,
+ 31.799999952316284,
+ 32.800000071525574,
+ 33.699999928474426,
+ 33.300000071525574,
+ 33.5,
+ 33.299999952316284,
+ 33.39999997615814,
+ 33.200000047683716,
+ 33.299999952316284,
+ 33.200000047683716,
+ 33.39999997615814,
+ 34.10000002384186,
+ 33.299999952316284,
+ 33.200000047683716,
+ 33.39999997615814
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 32.05,
+ "p95": 33.7
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 124,
+ 119.30000007152557,
+ 114.40000009536743,
+ 113.89999997615814,
+ 114.60000002384186,
+ 113.30000007152557,
+ 110.5,
+ 111,
+ 109.89999997615814,
+ 109.60000002384186,
+ 110.79999995231628,
+ 111.19999992847443,
+ 111.80000007152557,
+ 111.60000002384186,
+ 111.10000002384186,
+ 112.29999995231628,
+ 110.69999992847443,
+ 112.20000004768372,
+ 112.30000007152557,
+ 113.20000004768372,
+ 111.09999990463257,
+ 116.90000009536743,
+ 110.70000004768372,
+ 112.10000002384186,
+ 113,
+ 111.39999997615814,
+ 110.89999997615814,
+ 112.10000002384186,
+ 111.20000004768372,
+ 111.29999995231628
+ ],
+ "mainThread": [
+ 124,
+ 119.30000007152557,
+ 114.40000009536743,
+ 113.89999997615814,
+ 114.60000002384186,
+ 113.30000007152557,
+ 110.5,
+ 111,
+ 109.89999997615814,
+ 109.60000002384186,
+ 110.79999995231628,
+ 111.19999992847443,
+ 111.80000007152557,
+ 111.60000002384186,
+ 111.10000002384186,
+ 112.29999995231628,
+ 110.69999992847443,
+ 112.20000004768372,
+ 112.30000007152557,
+ 113.20000004768372,
+ 111.09999990463257,
+ 116.90000009536743,
+ 110.70000004768372,
+ 112.10000002384186,
+ 113,
+ 111.39999997615814,
+ 110.89999997615814,
+ 112.10000002384186,
+ 111.20000004768372,
+ 111.29999995231628
+ ],
+ "timerDelay": [
+ 124.5,
+ 121.30000007152557,
+ 114.40000009536743,
+ 116.5,
+ 114.60000002384186,
+ 113.30000007152557,
+ 110.59999990463257,
+ 111,
+ 109.89999997615814,
+ 109.80000007152557,
+ 110.89999997615814,
+ 111.19999992847443,
+ 112,
+ 111.80000007152557,
+ 111.10000002384186,
+ 112.39999997615814,
+ 110.69999992847443,
+ 112.29999995231628,
+ 112.30000007152557,
+ 113.20000004768372,
+ 111.09999990463257,
+ 116.90000009536743,
+ 111.5,
+ 112.20000004768372,
+ 113,
+ 111.5,
+ 111,
+ 112.20000004768372,
+ 111.30000007152557,
+ 111.39999997615814
+ ],
+ "finishMs": 12.399999976158142,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 111.7,
+ "p95": 119.3,
+ "mainThreadMs": {
+ "p50": 111.7,
+ "p95": 119.3
+ },
+ "timerDelayMs": {
+ "p50": 111.9,
+ "p95": 121.3
+ }
+ }
+ },
+ {
+ "side": "after",
+ "hover": {
+ "canvasResizes": 0,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.6000000238418579,
+ 0.7999999523162842,
+ 0.7000000476837158,
+ 0.7000000476837158,
+ 0.6999999284744263,
+ 0.7000000476837158,
+ 0.6999999284744263,
+ 0.8000000715255737,
+ 0.6000000238418579,
+ 0.5999999046325684,
+ 0.6000000238418579,
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.5999999046325684,
+ 0.6000000238418579,
+ 0.7000000476837158,
+ 0.6999999284744263,
+ 0.7000000476837158,
+ 0.7999999523162842,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5,
+ 0.6999999284744263,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.6000000238418579
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.6,
+ "p95": 0.8
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 2.4000000953674316,
+ 1.6999999284744263,
+ 1.5,
+ 1.399999976158142,
+ 1.5,
+ 1.600000023841858,
+ 2,
+ 1.600000023841858,
+ 1.899999976158142,
+ 2.700000047683716,
+ 2.5,
+ 1.7999999523162842,
+ 1.7000000476837158,
+ 1.600000023841858,
+ 1.6999999284744263,
+ 1.600000023841858,
+ 1.600000023841858,
+ 1.7999999523162842,
+ 2.600000023841858,
+ 1.600000023841858,
+ 2.100000023841858,
+ 1.7999999523162842,
+ 1.5,
+ 1.5,
+ 1.7000000476837158,
+ 1.5,
+ 1.5,
+ 2.299999952316284,
+ 1.899999976158142,
+ 1.600000023841858
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 1.7,
+ "p95": 2.6
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 2.200000047683716,
+ 3.5,
+ 3.299999952316284,
+ 3.100000023841858,
+ 3,
+ 2.6999999284744263,
+ 2.9000000953674316,
+ 4.099999904632568,
+ 3,
+ 2.8000000715255737,
+ 2.799999952316284,
+ 3,
+ 3,
+ 3.5,
+ 2.899999976158142,
+ 2.700000047683716,
+ 2.799999952316284,
+ 2.9000000953674316,
+ 3.899999976158142,
+ 3,
+ 2.899999976158142,
+ 2.899999976158142,
+ 3,
+ 2.899999976158142,
+ 3.3000000715255737,
+ 2.6999999284744263,
+ 2.700000047683716,
+ 2.700000047683716,
+ 2.899999976158142,
+ 3.100000023841858
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 2.9,
+ "p95": 3.9
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 9.299999952316284,
+ 9.300000071525574,
+ 9.699999928474426,
+ 9,
+ 9.100000023841858,
+ 9,
+ 8.899999976158142,
+ 9.200000047683716,
+ 9.299999952316284,
+ 9,
+ 8.600000023841858,
+ 9.899999976158142,
+ 9.200000047683716,
+ 9.399999976158142,
+ 8.899999976158142,
+ 9.300000071525574,
+ 9,
+ 9,
+ 8.899999976158142,
+ 9.100000023841858,
+ 9.199999928474426,
+ 8.5,
+ 9.600000023841858,
+ 9,
+ 9.200000047683716,
+ 8.899999976158142,
+ 9,
+ 8.699999928474426,
+ 9,
+ 9
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 9,
+ "p95": 9.7
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 85.30000007152557,
+ 91.39999997615814,
+ 92,
+ 114.5,
+ 115.09999990463257,
+ 113.60000002384186,
+ 118.89999997615814,
+ 85.10000002384186,
+ 112.60000002384186,
+ 117.70000004768372,
+ 114.19999992847443,
+ 113.60000002384186,
+ 114.10000002384186,
+ 112.90000009536743,
+ 112.30000007152557,
+ 113.39999997615814,
+ 116.5,
+ 113.60000002384186,
+ 113.20000004768372,
+ 114.30000007152557,
+ 113,
+ 123.79999995231628,
+ 113.29999995231628,
+ 112.89999997615814,
+ 113.70000004768372,
+ 113.20000004768372,
+ 113,
+ 114.59999990463257,
+ 114,
+ 113
+ ],
+ "mainThread": [
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.40000009536743164,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.5999999046325684,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421
+ ],
+ "timerDelay": [
+ 0.9000000953674316,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.40000009536743164,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.5999999046325684,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5
+ ],
+ "finishMs": 12.100000023841858,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 113.5,
+ "p95": 118.9,
+ "mainThreadMs": {
+ "p50": 0.5,
+ "p95": 0.6
+ },
+ "timerDelayMs": {
+ "p50": 0.5,
+ "p95": 0.6
+ }
+ }
+ },
+ {
+ "side": "after",
+ "hover": {
+ "canvasResizes": 0,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.7999999523162842,
+ 0.8000000715255737,
+ 0.6999999284744263,
+ 0.7000000476837158,
+ 0.7000000476837158,
+ 0.7999999523162842,
+ 0.7000000476837158,
+ 0.5999999046325684,
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5999999046325684,
+ 0.6000000238418579,
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.5999999046325684,
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.6999999284744263,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5999999046325684,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.7000000476837158,
+ 0.5,
+ 0.6999999284744263
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.6,
+ "p95": 0.8
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 1.8000000715255737,
+ 3,
+ 1.7999999523162842,
+ 1.399999976158142,
+ 1.3000000715255737,
+ 1.5,
+ 1.2999999523162842,
+ 1.3000000715255737,
+ 1.5,
+ 1.399999976158142,
+ 1.2999999523162842,
+ 2.200000047683716,
+ 1.2999999523162842,
+ 1.3000000715255737,
+ 1.0999999046325684,
+ 1.3000000715255737,
+ 1.1999999284744263,
+ 1.2000000476837158,
+ 1.2000000476837158,
+ 1.2999999523162842,
+ 1.2000000476837158,
+ 1.2999999523162842,
+ 1.2999999523162842,
+ 1.4000000953674316,
+ 2.399999976158142,
+ 1.7999999523162842,
+ 1.5,
+ 1.5,
+ 1.5,
+ 1.600000023841858
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 1.35,
+ "p95": 2.4
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 3.3000000715255737,
+ 2.299999952316284,
+ 2.100000023841858,
+ 2,
+ 2.100000023841858,
+ 2.1999999284744263,
+ 3.3000000715255737,
+ 2.0999999046325684,
+ 2.100000023841858,
+ 2.100000023841858,
+ 2.200000047683716,
+ 2.299999952316284,
+ 3.100000023841858,
+ 3.6999999284744263,
+ 2.9000000953674316,
+ 2.899999976158142,
+ 3,
+ 3.1999999284744263,
+ 4,
+ 2.9000000953674316,
+ 3,
+ 2.899999976158142,
+ 2.799999952316284,
+ 2.899999976158142,
+ 3.200000047683716,
+ 2.799999952316284,
+ 3,
+ 2.8000000715255737,
+ 2.6999999284744263,
+ 3.600000023841858
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 2.9,
+ "p95": 3.7
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 10,
+ 8.700000047683716,
+ 9.699999928474426,
+ 9.200000047683716,
+ 9.399999976158142,
+ 9.100000023841858,
+ 9.299999952316284,
+ 9,
+ 8.700000047683716,
+ 9.5,
+ 9.299999952316284,
+ 9.300000071525574,
+ 8.899999976158142,
+ 9.600000023841858,
+ 9.099999904632568,
+ 9.100000023841858,
+ 9,
+ 9.200000047683716,
+ 9.100000023841858,
+ 9.099999904632568,
+ 8.600000023841858,
+ 9.399999976158142,
+ 9.400000095367432,
+ 9.099999904632568,
+ 9.300000071525574,
+ 9.199999928474426,
+ 9.5,
+ 10.100000023841858,
+ 8.899999976158142,
+ 9.600000023841858
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 9.2,
+ "p95": 10
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 83,
+ 89.89999997615814,
+ 86,
+ 115.79999995231628,
+ 117.39999997615814,
+ 116.20000004768372,
+ 115,
+ 85.5,
+ 118.19999992847443,
+ 117.70000004768372,
+ 112.60000002384186,
+ 113.10000002384186,
+ 113.30000007152557,
+ 112.89999997615814,
+ 114.5,
+ 115.30000007152557,
+ 112.10000002384186,
+ 112.70000004768372,
+ 112,
+ 112.5,
+ 111.5,
+ 112.70000004768372,
+ 110.80000007152557,
+ 116.29999995231628,
+ 154.39999997615814,
+ 128,
+ 116.39999997615814,
+ 119.19999992847443,
+ 113.29999995231628,
+ 116
+ ],
+ "mainThread": [
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.30000007152557373,
+ 0.2999999523162842,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.5,
+ 0.3999999761581421,
+ 0.6000000238418579,
+ 0.3999999761581421,
+ 0.6000000238418579,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5999999046325684,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421
+ ],
+ "timerDelay": [
+ 1.100000023841858,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.2999999523162842,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.5,
+ 0.3999999761581421,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5999999046325684,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421
+ ],
+ "finishMs": 12.200000047683716,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 113.3,
+ "p95": 128,
+ "mainThreadMs": {
+ "p50": 0.4,
+ "p95": 0.6
+ },
+ "timerDelayMs": {
+ "p50": 0.45,
+ "p95": 0.6
+ }
+ }
+ },
+ {
+ "side": "before",
+ "hover": {
+ "canvasResizes": 120,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.7000000476837158,
+ 0.7000000476837158,
+ 0.5999999046325684,
+ 0.6000000238418579,
+ 0.7000000476837158,
+ 0.6999999284744263,
+ 0.6000000238418579,
+ 0.8000000715255737,
+ 0.6999999284744263,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5999999046325684,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.5
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.6,
+ "p95": 0.7
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 5.899999976158142,
+ 5.200000047683716,
+ 5.899999976158142,
+ 5.399999976158142,
+ 5.100000023841858,
+ 5.200000047683716,
+ 5.5,
+ 5.100000023841858,
+ 5.699999928474426,
+ 5.700000047683716,
+ 5.100000023841858,
+ 5.099999904632568,
+ 5.700000047683716,
+ 5.699999928474426,
+ 5.900000095367432,
+ 5.699999928474426,
+ 5.100000023841858,
+ 5,
+ 5.799999952316284,
+ 5,
+ 4.900000095367432,
+ 5.5,
+ 4.799999952316284,
+ 5,
+ 5,
+ 5.200000047683716,
+ 5.199999928474426,
+ 5.5,
+ 5.600000023841858,
+ 5.399999976158142
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 5.3,
+ "p95": 5.9
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 9.600000023841858,
+ 9.5,
+ 9.200000047683716,
+ 9.299999952316284,
+ 9.200000047683716,
+ 9.299999952316284,
+ 9.899999976158142,
+ 9.399999976158142,
+ 9.400000095367432,
+ 9.199999928474426,
+ 9.300000071525574,
+ 9.199999928474426,
+ 9.300000071525574,
+ 9.099999904632568,
+ 9.200000047683716,
+ 9.399999976158142,
+ 9.200000047683716,
+ 9.5,
+ 9.100000023841858,
+ 9.199999928474426,
+ 9.100000023841858,
+ 9.200000047683716,
+ 9,
+ 9.300000071525574,
+ 9.899999976158142,
+ 9.200000047683716,
+ 9.599999904632568,
+ 9.300000071525574,
+ 9.299999952316284,
+ 9.200000047683716
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 9.3,
+ "p95": 9.9
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 32.10000002384186,
+ 32.10000002384186,
+ 31.799999952316284,
+ 32,
+ 32.10000002384186,
+ 32.300000071525574,
+ 32.09999990463257,
+ 32.300000071525574,
+ 32.299999952316284,
+ 32.39999997615814,
+ 32.10000002384186,
+ 32.200000047683716,
+ 32,
+ 32,
+ 32,
+ 31.899999976158142,
+ 33.200000047683716,
+ 34.09999990463257,
+ 33.60000002384186,
+ 33.5,
+ 33.5,
+ 33.39999997615814,
+ 33.300000071525574,
+ 33.39999997615814,
+ 35,
+ 35.60000002384186,
+ 33.699999928474426,
+ 34.200000047683716,
+ 39.299999952316284,
+ 36.5
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 32.35,
+ "p95": 36.5
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 126.39999997615814,
+ 122.29999995231628,
+ 117.20000004768372,
+ 118.30000007152557,
+ 117.60000002384186,
+ 113.10000002384186,
+ 112.80000007152557,
+ 112.39999997615814,
+ 113.90000009536743,
+ 114.30000007152557,
+ 114.70000004768372,
+ 112.5,
+ 113,
+ 114.19999992847443,
+ 114,
+ 113,
+ 112.60000002384186,
+ 113,
+ 111.39999997615814,
+ 113.5,
+ 112.89999997615814,
+ 117.5,
+ 113.60000002384186,
+ 112.89999997615814,
+ 113.5,
+ 114.5,
+ 111.09999990463257,
+ 112.20000004768372,
+ 112.80000007152557,
+ 112.5
+ ],
+ "mainThread": [
+ 126.39999997615814,
+ 122.29999995231628,
+ 117.20000004768372,
+ 118.30000007152557,
+ 117.60000002384186,
+ 113.10000002384186,
+ 112.80000007152557,
+ 112.39999997615814,
+ 113.90000009536743,
+ 114.30000007152557,
+ 114.70000004768372,
+ 112.5,
+ 113,
+ 114.19999992847443,
+ 114,
+ 113,
+ 112.60000002384186,
+ 113,
+ 111.39999997615814,
+ 113.5,
+ 112.89999997615814,
+ 117.5,
+ 113.60000002384186,
+ 112.89999997615814,
+ 113.5,
+ 114.5,
+ 111.09999990463257,
+ 112.20000004768372,
+ 112.80000007152557,
+ 112.5
+ ],
+ "timerDelay": [
+ 126.89999997615814,
+ 123,
+ 119,
+ 118.39999997615814,
+ 117.70000004768372,
+ 113.19999992847443,
+ 112.80000007152557,
+ 112.39999997615814,
+ 114,
+ 114.39999997615814,
+ 114.80000007152557,
+ 112.59999990463257,
+ 113.10000002384186,
+ 114.29999995231628,
+ 114,
+ 113.09999990463257,
+ 112.60000002384186,
+ 113.10000002384186,
+ 111.39999997615814,
+ 113.69999992847443,
+ 113,
+ 117.60000002384186,
+ 114.29999995231628,
+ 112.89999997615814,
+ 113.60000002384186,
+ 114.60000002384186,
+ 111.09999990463257,
+ 112.30000007152557,
+ 112.90000009536743,
+ 112.59999990463257
+ ],
+ "finishMs": 12.900000095367432,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 113.3,
+ "p95": 122.3,
+ "mainThreadMs": {
+ "p50": 113.3,
+ "p95": 122.3
+ },
+ "timerDelayMs": {
+ "p50": 113.4,
+ "p95": 123
+ }
+ }
+ }
+ ],
+ "regression": [
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ }
+ ],
+ "versions": {
+ "electron": "42.11.12",
+ "chrome": "148.0.7778.280"
+ },
+ "gifParity": {
+ "bytes": 4634,
+ "identical": true,
+ "repeat": "Infinity",
+ "decoded": [
+ {
+ "width": 64,
+ "height": 48,
+ "duration": 230000,
+ "timestamp": 0,
+ "rgbaBytes": 12288
+ },
+ {
+ "width": 64,
+ "height": 48,
+ "duration": 140000,
+ "timestamp": 230000,
+ "rgbaBytes": 12288
+ },
+ {
+ "width": 64,
+ "height": 48,
+ "duration": 110000,
+ "timestamp": 370000,
+ "rgbaBytes": 12288
+ },
+ {
+ "width": 64,
+ "height": 48,
+ "duration": 210000,
+ "timestamp": 480000,
+ "rgbaBytes": 12288
+ },
+ {
+ "width": 64,
+ "height": 48,
+ "duration": 120000,
+ "timestamp": 690000,
+ "rgbaBytes": 12288
+ }
+ ]
+ }
+}
diff --git a/docs/acceptance/region-gif-worker-performance-2026-10-29.md b/docs/acceptance/region-gif-worker-performance-2026-10-29.md
new file mode 100644
index 0000000000..c6b1dd521e
--- /dev/null
+++ b/docs/acceptance/region-gif-worker-performance-2026-10-29.md
@@ -0,0 +1,56 @@
+# GIF 编码响应性能与画质回归(2026-10-29)
+
+本轮接续[截图工具性能分析](region-screenshot-performance-macos-2026-10-29.md),处理复杂 GIF 画面编码阻塞 Renderer 的问题。保持原有 gifenc 1.0.3、256 色、rgb444 量化、逐帧调色板、索引映射、LZW 压缩、相同帧合并、帧延迟和循环设置,把整段 GIF 编码移到一个录制专属 Worker。没有降低分辨率、颜色数或采样精度,没有共享近似调色板或跳过变化帧。
+
+## 性能结果
+
+macOS 26.4 / arm64 / Apple M5,Electron 42.11.12 / Chromium 148.0.7778.280。基线 `8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0`;优化版为本工作区。输入为 960 × 540 高色彩变化合成纹理,每帧移动一个小白块。每个版本各两批 30 帧,按旧→新、新→旧交替,包含各次录制的首帧与 Worker 初始化,不另行预热 GIF。测量期间没有同时运行本任务其它检查。
+
+下表合并同一版本 60 个样本,单位 ms;[完整原始数据](region-gif-worker-performance-2026-10-29.json)。
+
+| 指标 | P50:前 → 后 | P95:前 → 后 |
+| --- | --- | --- |
+| Renderer 主线程单帧同步占用 | 112.85 → **0.50** | 119.30 → **0.60** |
+| 同线程零延时定时器的实际响应延迟 | 112.90 → **0.50** | 121.30 → **0.60** |
+| 等待整帧编码完成 | 112.85 → 113.35 | 119.30 → 119.20 |
+
+主线程同步占用下降约 **99.6%**。这改善编码期间暂停、停止、拖动等交互的可响应性;并不表示 CPU 编码计算变快,也不表示复杂画面已经达到 10fps。新增定时器是事件循环响应探针,不是鼠标到屏幕呈现的端到端延迟。测量包含 Canvas 像素读取、交接与等待 Worker,排除系统抓屏和 IPC。独立 Worker 有启动与运行开销,本轮没有量测峰值内存。
+
+## 顺序、取消与结果不变
+
+- `LiveCapturePanel` 等待当前帧编码完成再采下一帧,最多一个在途帧;`CaptureRecorder` 也拒绝第二个并发提交,避免异步化后堆积像素。
+- 像素缓冲区与最终 GIF 通过 transfer 移交,不进行大块结构化复制。Worker 保留上一帧用于原来的逐字节相同帧判定。
+- 暂停消息与帧消息按顺序处理;停止等待在途帧并完成最后一帧;取消立即终止 Worker、拒绝在途 Promise。Worker 异常、消息错误及 15s 超时均会结束等待并释放线程资源。
+- 时间戳仍由录制端提供,Worker 编码完成时间不替换帧时间;暂停恢复继续使用排除暂停时长的录制时钟。
+- WebM 仍使用 MediaRecorder;本轮没有改变其编码参数、容器或输出。
+
+真实 Electron Worker 与基线分别录制一段 64 × 48 动画:文字、静止重复帧、角落一个像素的变化、编码途中暂停/恢复、复杂色彩和半透明输入、完全换色、编码途中停止。两份输出的 **4,634 个字节全部一致**,不是只比较文件大小或 hash。
+
+另用 Chromium 自身的 ImageDecoder 独立解码两份 GIF,逐字节比较五帧的全部 RGBA 像素(每帧 12,288 字节),以及尺寸、时间戳、时长和无限循环属性。帧时长分别为 **230 / 140 / 110 / 210 / 120ms**,总时长 810ms,全部一致。960 × 540 连续压力帧另外核对完整输出长度与 hash 一致。
+
+最初直接在 HTTP 测试页使用 ImageDecoder 时不可用,验收因此失败,未跳过断言。最终在同一个隔离 Electron 测试实例中新建隐藏的本地文件窗口执行解码,随后销毁;未修改产品 CSP、关闭 webSecurity 或添加不安全源启动开关。
+
+## 验证
+
+- 截图相关 **10 文件、119 项单测通过**,1.86s。`captureRecorder.test.ts` 单文件 8 项,0.71s;新增覆盖在途帧暂停/停止、队列有界、取消、Worker error/messageerror 与超时,定时器用 fake timers。
+- `pnpm ui:check --page region-capture --case all --theme all --engine chromium`:**16/16**,55.7s。实际 Worker、GIF/WebM 编码、暂停、预览、导出与解码均经过真实实现;帧来源和保存接收端为 fixture,不是原生抓屏/保存框验收。已目检 Light / Dark 的 GIF 播放窗口,图片没有上传。
+- `pnpm ui:check --changed --theme all`:**12/16**。其余 4 项是前轮已用 HEAD 对照复现的离屏环境问题:WebM 预览超时,GIF 独立解码页 `Target.createTarget: Not supported`。本轮未将失败算作通过,录制 UI 由上述 Chromium 验证补齐,Worker 编码及逐帧结果由 Electron benchmark 验证。
+- UI 单页构建器新增对 Vite `?worker` 的真实构建支持,包含 Worker 依赖的变更扫描、版本对照和资源指纹,没有把 Worker 换成同步替身。专用 E2E 自检验证隔离线程、buffer transfer 与依赖变更;完整自检 **5/5 通过**,17.94s,新 Worker 用例 4.76s。dev-docs 检查通过。
+- Desktop typecheck 通过;Vite 的生产模式构建确认输出 `recorder.mjs` 与独立 `gifEncoding.worker-*.js`,未执行完整安装包构建。
+- 新增/修改编码文件 ESLint、test-hygiene 和 diff 空白检查通过。`LiveCapturePanel.tsx` 常规 ESLint 遇到 HEAD 已存在的 `react-hooks/exhaustive-deps` 规则未注册错误;确认原注释未改后,用 `--no-inline-config` 执行该文件实际配置的规则,通过,未改 lint 配置。
+
+测试价值依据为 `docs/dev-rules/engineering-conventions.md` §3.2。新增异步边界无法由旧同步编码测试覆盖;最小单测输入为一张 2 × 1 帧,覆盖实际 `CaptureRecorder` 入口的完成、取消和错误结果。真实 Worker、浏览器解码和性能采样保留在显式 E2E/benchmark,不增加默认单测的浏览器或进程成本。设计依据为 `docs/design-rules/DESIGN.md` §14.4,界面响应不能被长时间编码阻塞。
+
+## 复跑
+
+```sh
+node apps/desktop/scripts/benchmark-region-screenshot.mjs --baseline=8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0 --samples=30 --output=docs/acceptance/region-gif-worker-performance-2026-10-29.json
+pnpm --filter desktop exec vitest run src/main/region-screenshot src/renderer/features/region-screenshot src/shared/__tests__/regionScreenshot.test.ts
+pnpm --filter desktop run typecheck
+pnpm ui:check --page region-capture --case all --theme all --engine chromium
+pnpm ui:check:selftest
+```
+
+未实测 Windows、真实系统采集下的五分钟长录制或峰值内存;不能把隔离编码阶段数据当成整个录屏链路的性能保证。当前工作区开发实例沿用 Renderer 热更新,未替换安装版。
+
+同日后续继续优化精确量化复用、标注、采集帧和 PNG 保存,增量数据见[第二轮逐项优化](region-screenshot-next-performance-2026-10-29.md)。本报告的 Worker 对比保留为当时原始结果。
diff --git a/docs/acceptance/region-macos-demand-performance-2026-10-29.json b/docs/acceptance/region-macos-demand-performance-2026-10-29.json
new file mode 100644
index 0000000000..1c38b45c84
--- /dev/null
+++ b/docs/acceptance/region-macos-demand-performance-2026-10-29.json
@@ -0,0 +1,801 @@
+{
+ "generatedAt": "2026-10-29T07:59:56.721Z",
+ "platform": "darwin",
+ "arch": "arm64",
+ "cpu": "Apple M5",
+ "baseline": "8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0",
+ "scope": "Synthetic IOSurfaces, actual native codec and frame slot. 3 system updates per requested frame; not measured desktop FPS or app CPU.",
+ "rows": [
+ {
+ "checks": [
+ "cold-request",
+ "latest-frame",
+ "skip-unused",
+ "surface-reuse-protection",
+ "static-repeat",
+ "blank-invalidates",
+ "resume",
+ "dispose",
+ "encode-failure",
+ "failure-recovery"
+ ]
+ },
+ {
+ "noise": false,
+ "parity": [
+ {
+ "frame": 0,
+ "bytes": 205267,
+ "budget": 3000000,
+ "sha256": "01aa8d0cb6321c0c341d93d48afb273654a38d9d32836d20ac782f070f4e9fd8"
+ },
+ {
+ "frame": 1,
+ "bytes": 229600,
+ "budget": 3000000,
+ "sha256": "521d532bb613974e7954f0160a97abc0a9fdacaec185e526b413f2458b12aeff"
+ },
+ {
+ "frame": 2,
+ "bytes": 230313,
+ "budget": 3000000,
+ "sha256": "07fffa9fd58ae3905980695ae4024438e1dbffbd1557c7035d7d038a693158dd"
+ },
+ {
+ "frame": 0,
+ "bytes": 98569,
+ "budget": 100000,
+ "sha256": "0f4b0d852fe86102d9049801fa9181181ffb7133f385fe844d1512b96baa9f32"
+ },
+ {
+ "frame": 1,
+ "bytes": 82121,
+ "budget": 100000,
+ "sha256": "6b07001b97db79bfd6d21494274ff1219c67ce32d2f1a06b6d51e76bfc8fd76c"
+ },
+ {
+ "frame": 2,
+ "bytes": 80949,
+ "budget": 100000,
+ "sha256": "afc186c5493c394b10bff6a74189eac7d750bf42184c23803f2275a0886f2226"
+ }
+ ],
+ "width": 1920,
+ "height": 1080
+ },
+ {
+ "height": 1080,
+ "encodes": 60,
+ "roundMs": [
+ 11.038416647352278,
+ 8.78212507814169,
+ 13.220458407886326,
+ 10.877166641876101,
+ 17.294625053182244,
+ 9.037749958224595,
+ 12.938333326019347,
+ 11.540708248503506,
+ 9.045999962836504,
+ 14.12529160734266,
+ 12.7576666418463,
+ 8.360041654668748,
+ 12.18041661195457,
+ 12.900708359666169,
+ 8.535541594028473,
+ 13.602666673250496,
+ 12.881041737273335,
+ 12.199666700325906,
+ 9.124708245508373,
+ 15.485833398997784
+ ],
+ "samples": 20,
+ "pausedEncodes": 30,
+ "width": 1920,
+ "requestMs": [
+ 0.00012491364032030106,
+ 0.00020838342607021332,
+ 0.000125030055642128,
+ 0.0002916203811764717,
+ 0.0002916203811764717,
+ 0.0004166504368185997,
+ 0.00008323695510625839,
+ 0.00012491364032030106,
+ 0.000125030055642128,
+ 0.000125030055642128,
+ 0.000125030055642128,
+ 0.00008335337042808533,
+ 0.00012491364032030106,
+ 0.00016670674085617065,
+ 0.00008323695510625839,
+ 0.000125030055642128,
+ 0.00016670674085617065,
+ 0.000125030055642128,
+ 0.00012491364032030106,
+ 0.000125030055642128
+ ],
+ "cpuMs": 95.437,
+ "side": "before",
+ "noise": false
+ },
+ {
+ "height": 1080,
+ "encodes": 20,
+ "roundMs": [
+ 4.410749999806285,
+ 4.247291712090373,
+ 3.810624941252172,
+ 7.958041620440781,
+ 4.085916676558554,
+ 3.6148750223219395,
+ 3.6841665860265493,
+ 5.333208246156573,
+ 4.041416686959565,
+ 3.81358340382576,
+ 3.694958286359906,
+ 5.351208383217454,
+ 3.9415000937879086,
+ 3.6998334107920527,
+ 3.810708411037922,
+ 5.495416698977351,
+ 3.4665416460484266,
+ 3.2137082889676094,
+ 3.5670417128130794,
+ 5.096458364278078
+ ],
+ "samples": 20,
+ "pausedEncodes": 0,
+ "width": 1920,
+ "requestMs": [
+ 4.406583379022777,
+ 4.242708324454725,
+ 3.807833301834762,
+ 7.955124950967729,
+ 4.081333288922906,
+ 3.61241667997092,
+ 3.6819166271016,
+ 5.331041640602052,
+ 4.038083367049694,
+ 3.8105417042970657,
+ 3.6922500003129244,
+ 5.348333390429616,
+ 3.936625085771084,
+ 3.697041654959321,
+ 3.807708388194442,
+ 5.492791649885476,
+ 3.4612499875947833,
+ 3.211374976672232,
+ 3.5643333103507757,
+ 5.093750078231096
+ ],
+ "cpuMs": 36.75499999999997,
+ "side": "after",
+ "noise": false
+ },
+ {
+ "height": 1080,
+ "encodes": 20,
+ "roundMs": [
+ 3.831000067293644,
+ 3.4628333523869514,
+ 6.779916700907052,
+ 3.1462915940210223,
+ 3.111958270892501,
+ 3.106124931946397,
+ 3.000041702762246,
+ 6.5437916200608015,
+ 3.4397082636132836,
+ 3.200333332642913,
+ 3.1246249563992023,
+ 7.571458350867033,
+ 3.291583270765841,
+ 3.1304582953453064,
+ 3.0264999950304627,
+ 7.302750018425286,
+ 3.2925416016951203,
+ 3.1103333458304405,
+ 2.9443749226629734,
+ 6.899791653268039
+ ],
+ "samples": 20,
+ "pausedEncodes": 0,
+ "width": 1920,
+ "requestMs": [
+ 3.8284583715721965,
+ 3.4606249537318945,
+ 6.777791655622423,
+ 3.140291664749384,
+ 3.1100832857191563,
+ 3.1044166535139084,
+ 2.997833420522511,
+ 6.542083341628313,
+ 3.4365833271294832,
+ 3.1979583436623216,
+ 3.1225417042151093,
+ 7.56916671525687,
+ 3.288666601292789,
+ 3.1284999568015337,
+ 3.02454165648669,
+ 7.300458266399801,
+ 3.2899166690185666,
+ 3.108375007286668,
+ 2.9422916704788804,
+ 6.897874991409481
+ ],
+ "cpuMs": 32.504999999999995,
+ "side": "after",
+ "noise": false
+ },
+ {
+ "height": 1080,
+ "encodes": 60,
+ "roundMs": [
+ 15.9244165988639,
+ 15.358375036157668,
+ 11.70566666405648,
+ 15.325666638091207,
+ 17.37074996344745,
+ 17.95570831745863,
+ 21.74862497486174,
+ 15.405624988488853,
+ 11.240541702136397,
+ 11.80808327626437,
+ 14.355916646309197,
+ 12.380583328194916,
+ 10.70362504106015,
+ 12.385291629470885,
+ 13.445500051602721,
+ 13.7071666540578,
+ 9.768708376213908,
+ 12.541125062853098,
+ 14.099500025622547,
+ 13.849291601218283
+ ],
+ "samples": 20,
+ "pausedEncodes": 30,
+ "width": 1920,
+ "requestMs": [
+ 0.00037497375160455704,
+ 0.000250060111284256,
+ 0.00016659032553434372,
+ 0.000250060111284256,
+ 0.00024994369596242905,
+ 0.00037497375160455704,
+ 0.0002916203811764717,
+ 0.00020838342607021332,
+ 0.00029173679649829865,
+ 0.00008335337042808533,
+ 0.00012491364032030106,
+ 0.00008335337042808533,
+ 0.000041676685214042664,
+ 0.000250060111284256,
+ 0.00041676685214042664,
+ 0.0002916203811764717,
+ 0.00020838342607021332,
+ 0.00008335337042808533,
+ 0.00020826701074838638,
+ 0.00020826701074838638
+ ],
+ "cpuMs": 105.543,
+ "side": "before",
+ "noise": false
+ },
+ {
+ "noise": false,
+ "parity": [
+ {
+ "frame": 0,
+ "bytes": 798723,
+ "budget": 3000000,
+ "sha256": "1f49a6172759092f1fad779df3ce592254094c8ce410d21728dce983076b5d54"
+ },
+ {
+ "frame": 1,
+ "bytes": 902634,
+ "budget": 3000000,
+ "sha256": "4e595c4ab235c09b16815eed1ee50f70876c130cc38e894ec382d61b31284f91"
+ },
+ {
+ "frame": 2,
+ "bytes": 905762,
+ "budget": 3000000,
+ "sha256": "adefd6db17b3e4bc171eb9c6f5c63e051e1f46595fb16d97927f0db76b08e3cc"
+ },
+ {
+ "frame": 0,
+ "bytes": 94072,
+ "budget": 100000,
+ "sha256": "9414006739f0cfd09ae1d3d4daa4eef9e7a7588b88c3f07002923a211f8073af"
+ },
+ {
+ "frame": 1,
+ "bytes": 92562,
+ "budget": 100000,
+ "sha256": "6221b932c3d501a1fb23ac3416d5ddc53b89688e3797ddb974820b4aa2641ca7"
+ },
+ {
+ "frame": 2,
+ "bytes": 94646,
+ "budget": 100000,
+ "sha256": "692c5dddec165e79b142acbcca761c57533c91eb1eb4d97780a2622fd732d31e"
+ }
+ ],
+ "width": 3840,
+ "height": 2160
+ },
+ {
+ "height": 2160,
+ "encodes": 60,
+ "roundMs": [
+ 28.0422082869336,
+ 25.809291750192642,
+ 25.77391662634909,
+ 31.790291657671332,
+ 26.45270840730518,
+ 32.89675002451986,
+ 32.379916636273265,
+ 26.233125012367964,
+ 46.15320835728198,
+ 26.45033341832459,
+ 27.40929159335792,
+ 31.587500008754432,
+ 25.950333336368203,
+ 30.622833408415318,
+ 28.578041587024927,
+ 33.28487498220056,
+ 31.247125007212162,
+ 24.823375046253204,
+ 25.852374965324998,
+ 25.83299996331334
+ ],
+ "samples": 20,
+ "pausedEncodes": 30,
+ "width": 3840,
+ "requestMs": [
+ 0.0002916203811764717,
+ 0.00016670674085617065,
+ 0.00008323695510625839,
+ 0.000250060111284256,
+ 0.00016670674085617065,
+ 0.00016670674085617065,
+ 0.00016659032553434372,
+ 0.000125030055642128,
+ 0.00020826701074838638,
+ 0.000125030055642128,
+ 0.00012491364032030106,
+ 0.000125030055642128,
+ 0.000125030055642128,
+ 0.000125030055642128,
+ 0.00020826701074838638,
+ 0.0005416804924607277,
+ 0.000125030055642128,
+ 0.000125030055642128,
+ 0.00016670674085617065,
+ 0.00024994369596242905
+ ],
+ "cpuMs": 217.31500000000005,
+ "side": "before",
+ "noise": false
+ },
+ {
+ "height": 2160,
+ "encodes": 20,
+ "roundMs": [
+ 11.197333340533078,
+ 8.76124994829297,
+ 10.067375027574599,
+ 15.028583235107362,
+ 9.320124983787537,
+ 10.103583335876465,
+ 8.929250063374639,
+ 9.012333350256085,
+ 15.980624943040311,
+ 13.403874938376248,
+ 8.626541588455439,
+ 9.33237501885742,
+ 8.601833367720246,
+ 8.481625001877546,
+ 13.433916727080941,
+ 9.00862505659461,
+ 9.101333329454064,
+ 8.431958383880556,
+ 8.782416698522866,
+ 8.670208277180791
+ ],
+ "samples": 20,
+ "pausedEncodes": 0,
+ "width": 3840,
+ "requestMs": [
+ 11.18974993005395,
+ 8.757458301261067,
+ 10.064625064842403,
+ 15.025374945253134,
+ 9.316166630014777,
+ 10.099583305418491,
+ 8.925416739657521,
+ 9.008583379909396,
+ 15.978041687048972,
+ 13.400791678577662,
+ 8.622291614301503,
+ 9.329624939709902,
+ 8.596916683018208,
+ 8.475708309561014,
+ 13.43100005760789,
+ 9.004291729070246,
+ 9.098374983295798,
+ 8.427875000052154,
+ 8.779750089161098,
+ 8.66633327677846
+ ],
+ "cpuMs": 72.64800000000002,
+ "side": "after",
+ "noise": false
+ },
+ {
+ "height": 2160,
+ "encodes": 20,
+ "roundMs": [
+ 9.708916652016342,
+ 9.857625002041459,
+ 9.004833409562707,
+ 8.55812500230968,
+ 8.767916704528034,
+ 8.639708277769387,
+ 8.46579170320183,
+ 9.365166770294309,
+ 8.628624957054853,
+ 9.55820840317756,
+ 8.65462503861636,
+ 8.12833325471729,
+ 8.405791595578194,
+ 8.377583348192275,
+ 8.343291701748967,
+ 8.226500009186566,
+ 8.357416605576873,
+ 8.413958363234997,
+ 8.465124992653728,
+ 9.237166726961732
+ ],
+ "samples": 20,
+ "pausedEncodes": 0,
+ "width": 3840,
+ "requestMs": [
+ 9.704874944873154,
+ 9.854999952949584,
+ 9.001041646115482,
+ 8.555208332836628,
+ 8.764708298258483,
+ 8.637291612103581,
+ 8.462333353236318,
+ 9.362458367832005,
+ 8.624749956652522,
+ 9.554916759952903,
+ 8.651333395391703,
+ 8.124916581436992,
+ 8.403416606597602,
+ 8.37420835159719,
+ 8.341166656464338,
+ 8.223291719332337,
+ 8.355291676707566,
+ 8.409374975599349,
+ 8.46245838329196,
+ 9.234333410859108
+ ],
+ "cpuMs": 69.55500000000006,
+ "side": "after",
+ "noise": false
+ },
+ {
+ "height": 2160,
+ "encodes": 60,
+ "roundMs": [
+ 45.85537500679493,
+ 40.653958334587514,
+ 25.67987493239343,
+ 29.748208238743246,
+ 26.591208297759295,
+ 26.12499997485429,
+ 30.878166668117046,
+ 28.17945822607726,
+ 32.00912498869002,
+ 26.205833302810788,
+ 31.371458317153156,
+ 34.461208269931376,
+ 35.998249892145395,
+ 30.6984584312886,
+ 33.157499972730875,
+ 26.08887490350753,
+ 29.57320841960609,
+ 26.02662506978959,
+ 26.857124990783632,
+ 32.90533332619816
+ ],
+ "samples": 20,
+ "pausedEncodes": 30,
+ "width": 3840,
+ "requestMs": [
+ 0.00024994369596242905,
+ 0.0004166504368185997,
+ 0.00008335337042808533,
+ 0.00024994369596242905,
+ 0.00008335337042808533,
+ 0.00020826701074838638,
+ 0.0004166504368185997,
+ 0.0006665941327810287,
+ 0.000125030055642128,
+ 0.00020838342607021332,
+ 0.00016670674085617065,
+ 0.00020826701074838638,
+ 0.00008323695510625839,
+ 0.000500003807246685,
+ 0.00012491364032030106,
+ 0.00024994369596242905,
+ 0.00016670674085617065,
+ 0.000041676685214042664,
+ 0.00020826701074838638,
+ 0.00024994369596242905
+ ],
+ "cpuMs": 222.75299999999993,
+ "side": "before",
+ "noise": false
+ },
+ {
+ "noise": true,
+ "parity": [
+ {
+ "frame": 0,
+ "bytes": 2269384,
+ "budget": 3000000,
+ "sha256": "3fe4d16a646a32a412320858c31d6eb6714f2cd35c014a97e46a5db1ae2a1704"
+ },
+ {
+ "frame": 1,
+ "bytes": 2276435,
+ "budget": 3000000,
+ "sha256": "7c39e31702458dd9555126986728023ec832751ef55ba3dca1fd1e604d5fc9b3"
+ },
+ {
+ "frame": 2,
+ "bytes": 2284674,
+ "budget": 3000000,
+ "sha256": "c0e372dec60c199093de2cb54a0ffccdf8cb0c2e1a1eea4f00bc34bc651e2ac9"
+ },
+ {
+ "frame": 0,
+ "bytes": 79704,
+ "budget": 100000,
+ "sha256": "9992e4008bd1d7a1b8b9612095f40db75f2437aecc854af7fe20c9d5125fe204"
+ },
+ {
+ "frame": 1,
+ "bytes": 78632,
+ "budget": 100000,
+ "sha256": "bba484a0d194bce9114741def3613eb228ccfb3c2bdd64e0200ad0145d21ac8f"
+ },
+ {
+ "frame": 2,
+ "bytes": 78620,
+ "budget": 100000,
+ "sha256": "9ac70518de52c593e3417f1917983e8b037f2861b31d766db60d90f09125bdc4"
+ }
+ ],
+ "width": 3840,
+ "height": 2160
+ },
+ {
+ "height": 2160,
+ "encodes": 60,
+ "roundMs": [
+ 127.12895823642612,
+ 130.07387495599687,
+ 127.85254174377769,
+ 140.48783329781145,
+ 126.48945837281644,
+ 125.17374998424202,
+ 137.9014999838546,
+ 127.8324166778475,
+ 142.16425002086908,
+ 122.99699999857694,
+ 134.36466665007174,
+ 141.32962503936142,
+ 126.14745832979679,
+ 151.33520844392478,
+ 129.70479170326144,
+ 136.682124924846,
+ 139.1634999308735,
+ 125.59800001326948,
+ 132.87779176607728,
+ 126.03054160717875
+ ],
+ "samples": 20,
+ "pausedEncodes": 30,
+ "width": 3840,
+ "requestMs": [
+ 0.0006249174475669861,
+ 0.00045832712203264236,
+ 0.0008334172889590263,
+ 0.0007499475032091141,
+ 0.0003332970663905144,
+ 0.00045832712203264236,
+ 0.0003332970663905144,
+ 0.0003332970663905144,
+ 0.0004166504368185997,
+ 0.0006665941327810287,
+ 0.0004166504368185997,
+ 0.0003334134817123413,
+ 0.00045832712203264236,
+ 0.000875093974173069,
+ 0.00037509016692638397,
+ 0.0006249174475669861,
+ 0.000500003807246685,
+ 0.00045832712203264236,
+ 0.000750063918530941,
+ 0.0006665941327810287
+ ],
+ "cpuMs": 826.844,
+ "side": "before",
+ "noise": true
+ },
+ {
+ "height": 2160,
+ "encodes": 20,
+ "roundMs": [
+ 45.57558335363865,
+ 41.56362498179078,
+ 41.51612496934831,
+ 54.203166626393795,
+ 45.34779174719006,
+ 41.68091667816043,
+ 39.39812502358109,
+ 45.773083227686584,
+ 41.34391667321324,
+ 50.70220830384642,
+ 50.96258327830583,
+ 49.56408333964646,
+ 45.75724992901087,
+ 43.98833331651986,
+ 39.185458328574896,
+ 44.38433330506086,
+ 40.97870830446482,
+ 51.24562501441687,
+ 51.8430833471939,
+ 46.1306250654161
+ ],
+ "samples": 20,
+ "pausedEncodes": 0,
+ "width": 3840,
+ "requestMs": [
+ 45.56875000707805,
+ 41.55729163903743,
+ 41.510708280839026,
+ 54.1963332798332,
+ 45.34212499856949,
+ 41.67545831296593,
+ 39.3930000718683,
+ 45.76645826455206,
+ 41.33875004481524,
+ 50.69687508512288,
+ 50.95583328511566,
+ 49.557833350263536,
+ 45.751208323054016,
+ 43.98229159414768,
+ 39.181375061161816,
+ 44.378333375789225,
+ 40.973208379000425,
+ 51.23983335215598,
+ 51.837166654877365,
+ 46.12304165493697
+ ],
+ "cpuMs": 298.1170000000002,
+ "side": "after",
+ "noise": true
+ },
+ {
+ "height": 2160,
+ "encodes": 20,
+ "roundMs": [
+ 41.93100007250905,
+ 43.8843333395198,
+ 39.645083248615265,
+ 50.521791679784656,
+ 43.817291618324816,
+ 42.84391668625176,
+ 45.76474998611957,
+ 42.32424998190254,
+ 41.112291626632214,
+ 42.3997500911355,
+ 42.01570828445256,
+ 42.64766676351428,
+ 41.88204160891473,
+ 52.01900005340576,
+ 46.3861667085439,
+ 48.88966667931527,
+ 43.84712490718812,
+ 40.2007499942556,
+ 51.28116661217064,
+ 50.8487083716318
+ ],
+ "samples": 20,
+ "pausedEncodes": 0,
+ "width": 3840,
+ "requestMs": [
+ 41.925583383999765,
+ 43.877416756004095,
+ 39.64070824440569,
+ 50.516541698016226,
+ 43.81141671910882,
+ 42.83895844127983,
+ 45.75950000435114,
+ 42.31866670306772,
+ 41.10783326905221,
+ 42.395291733555496,
+ 42.01108333654702,
+ 42.64233342837542,
+ 41.878291638568044,
+ 52.01283341739327,
+ 46.38049995992333,
+ 48.88504161499441,
+ 43.84175001177937,
+ 40.19374994095415,
+ 51.27629160415381,
+ 50.84224999882281
+ ],
+ "cpuMs": 287.89699999999993,
+ "side": "after",
+ "noise": true
+ },
+ {
+ "height": 2160,
+ "encodes": 60,
+ "roundMs": [
+ 136.06283336412162,
+ 124.32262499351054,
+ 137.3127499828115,
+ 127.47599999420345,
+ 127.61233327910304,
+ 140.4290833743289,
+ 127.92649993207306,
+ 125.02695841249079,
+ 139.13445838261396,
+ 126.08212500344962,
+ 136.84391661081463,
+ 127.39208340644836,
+ 136.09795831143856,
+ 147.9020833503455,
+ 126.4359166380018,
+ 125.78658328857273,
+ 140.61895827762783,
+ 124.20620827469975,
+ 136.67187502142042,
+ 123.47874999977648
+ ],
+ "samples": 20,
+ "pausedEncodes": 30,
+ "width": 3840,
+ "requestMs": [
+ 0.00016670674085617065,
+ 0.000625033862888813,
+ 0.00045832712203264236,
+ 0.0004166504368185997,
+ 0.0007082708179950714,
+ 0.000625033862888813,
+ 0.0002916203811764717,
+ 0.0004166504368185997,
+ 0.00020838342607021332,
+ 0.000500003807246685,
+ 0.0002916203811764717,
+ 0.0003334134817123413,
+ 0.00045832712203264236,
+ 0.000750063918530941,
+ 0.0005416804924607277,
+ 0.00020826701074838638,
+ 0.00045832712203264236,
+ 0.00037497375160455704,
+ 0.00008335337042808533,
+ 0.00016670674085617065
+ ],
+ "cpuMs": 817.5150000000003,
+ "side": "before",
+ "noise": true
+ }
+ ]
+}
diff --git a/docs/acceptance/region-macos-demand-performance-2026-10-29.md b/docs/acceptance/region-macos-demand-performance-2026-10-29.md
new file mode 100644
index 0000000000..85a8ec274d
--- /dev/null
+++ b/docs/acceptance/region-macos-demand-performance-2026-10-29.md
@@ -0,0 +1,75 @@
+# Mac 截图录制按需编码性能验证(2026-10-29)
+
+环境:macOS 26.4、Apple M5 / arm64。保留前轮截图、GIF 与 PNG 优化,在此基础上只为本地 Mac GIF/视频录制启用按请求 JPEG 编码。没有直接裁选区后压缩,也没有更换编码器、降分辨率或调整录制采样周期。
+
+## 优化依据
+
+原生流最多 30 次/秒更新,每次更新都做整屏 JPEG;录制端按 100ms 周期且有背压消费,最多约 10 次/秒,未取用的 JPEG 仍消耗资源。因此只在本地录制端请求画面时编码,减少未被消费的计算。
+
+## 实现与取舍
+
+`RegionVideoCapture` 创建 `NativeDesktopCapture({ encodeOnRequest: true })`,仅 Mac 的本地录制使用新私有参数 `cursor-overlay-demand`。默认远程桌面、单窗口拍照、Windows 与 Linux 仍走原参数和路径;helper 与客户端同包更新,不涉及跨端线协议或 relay。
+
+原生串行队列只保留最新一张尚未编码的 IOSurface;收到 `f` 才用原算法编码,静止时复用已编码 JPEG。按照 [Apple 的缓冲生命周期合同](https://developer.apple.com/documentation/coregraphics/cgdisplaystreamframeavailablehandler?language=objc),同时 retain 和增加 use count,避免回调结束后系统重用像素;替换、编码完成、空白画面和销毁均释放。没有建立帧队列、复制整屏原始像素或媒体临时文件。
+
+代价是单次请求需要等待编码,且等待期间持有一张原始画面的系统缓冲。系统采集仍在工作,不能把“暂停时无 JPEG 编码”说成“暂停时没有任何 CPU/GPU 开销”。不保证总内存按像素大小下降。
+
+## 原生算法对照:相同输入、完整字节比较
+
+入口:`node apps/desktop/scripts/benchmark-macos-demand-capture.mjs`。
+
+使用真实 CVPixelBuffer / IOSurface、生产 `CaptureFrameStore` 和 CoreImage JPEG 编码器。旧编码体从 `8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0` 的生产源码原样提取(该原生文件在前轮未改),不是重新手写参考算法。3 次画面更新后请求一次,前后后前各 20 次,即每侧每场景 40 个样本;每批新建 CIContext,保留首样本,但进程此前已执行字节对照,不代表冷进程启动。性能采样时没有并行跑类型检查或测试。
+
+| 输入 | 每轮全部处理时间 P50 前→后 | P95 前→后 | 累计 CPU 时间前→后 |
+| --- | --- | --- | --- |
+| 1920×1080 渐变/色块 | 12.88→3.70ms | 17.37→7.30ms | 200.98→69.26ms |
+| 3840×2160 渐变/色块 | 29.57→8.78ms | 40.65→13.43ms | 440.07→142.20ms |
+| 3840×2160 高细节纹理 | 129.70→43.99ms | 142.16→51.84ms | 1,644.36→586.01ms |
+
+每侧每场景编码次数 **120→40**;模拟暂停后 30 次画面更新的编码次数 **30→0**。这是 3:1 更新/消费比例的算法对照,不是实测整机 CPU 百分比、功耗或真实录制 FPS。旧路径在请求前已编码,取缓存近乎零等待;新路径请求等待 P50 为 3.70/8.78/43.98ms。不能只报总工作量下降而省略这一代价。
+
+18 组对照(3 种画面 × 3 帧 × 2 个大小预算)经真实按需帧槽返回,与旧实现 **全部 JPEG 字节相等**;100KB 小预算覆盖原有降低质量和缩放降级。验证最新帧替换、静止重复、首帧前请求、空白失效、恢复、释放以及编码失败后恢复。首次夹具直接创建的 IOSurface 无法被 CoreImage 编码,前后均返回空;修正为 CVPixelBuffer 创建后执行以上检查,没有放宽非空或相等断言。
+
+原始数据:[region-macos-demand-performance-2026-10-29.json](region-macos-demand-performance-2026-10-29.json)。
+
+## 真实 Mac 采集进程
+
+入口:`node apps/desktop/scripts/benchmark-macos-live-capture.mjs`,显式实机测试,会短暂覆盖一个屏幕显示合成动态图案;不移动鼠标、不激活其他应用。测试结束关闭自己启动的图案与采集子进程。
+
+本机屏幕 1470×956 DIP、2×。真实编译运行旧/新 helper,顺序为前后后前;每次首次取帧后按 100ms 周期取 30 帧,再暂停 1 秒并恢复,最后验证同一静止画面可重复读取且 JPEG 一致。四次运行都正常通过 EOF 退出。`/usr/bin/time -l` 计量对应原生进程,包含启动、采样、暂停与静止读取。每侧合计 60 个稳定取帧样本、2 次独立进程;不是长时间功耗测试。
+
+| 指标 | 优化前 | 优化后 |
+| --- | --- | --- |
+| 累计 CPU 时间 | 1.49s | **0.59s(减少约 60.4%)** |
+| 取帧等待 P50 | 5.21ms | 15.73ms |
+| 取帧等待 P95 | 12.76ms | 22.61ms |
+| 实际请求/取帧速率 | 9.952 帧/s | 9.947 帧/s |
+| 两进程中较大的最大 RSS | 32.89MiB | 31.84MiB |
+
+CPU 包含 1 秒暂停,不能把 60.4% 直接套到持续录制或整个 Cindy。RSS 样本不足以证明稳定内存收益,实际依旧需保留一个系统缓冲。首次取帧耗时前两次约 615/583ms、后两次约 129/153ms,有系统冷启动影响,不宣称启动变快。
+
+真实连续桌面受系统调度影响,跨运行的画面序列和 JPEG 校验值不保证相同;第一轮静止摘要也与其余三轮不同,未据此声称不同运行的全部帧相等。精确画质保证来自上一节相同输入的字节对照。本节只验证真实采集、暂停恢复、静止复用和取帧速率,不包含 Electron 裁剪、GIF/WebM 编码与最终播放;没有据此声称真实 5 分钟录制完全相同或全流程验收完成。
+
+原始数据:[region-macos-live-performance-2026-10-29.json](region-macos-live-performance-2026-10-29.json)。
+
+## 回归与边界
+
+- 原生算法/IOSurface 生命周期检查通过,arm64 与 x86_64 helper 编译通过;arm64 真实采集通过,未在 Intel Mac 实机运行。
+- 定向单测 10 文件 98 项通过,1.32s,包含原 GIF 帧合并、时长、暂停和结束测试;本次新增 Mac 私有调用参数、迟到帧取消与本地区域裁剪回归。另单独运行修改的两个文件:`macNativeCapture.test.ts` 1.16s、`liveCapture.test.ts` 430ms,均满足 5 秒预算。
+- Desktop 类型检查、定向 ESLint、test-hygiene(359 文件基线)、dev-docs(10 项)、`git diff --check` 通过。本轮未改 Renderer、界面或录制帧间隔,沿用前轮 UI 结果,不声称重新进行了所有 UI 验收。
+- 同时修正前轮 PNG 优化中的动态 `import('sharp')`:遵守仓库 main 静态依赖规则,复用已有静态依赖;编码失败仍回原 PNG。画质/透明图/JPEG 回归通过。前轮保存基准保留为当时版本数据,首次懒加载耗时不代表当前版本;本次不追加 PNG 提速结论。
+- 未实施直接区域原生压缩;它会改变 JPEG 边缘/分块与预算行为,需要另作画质约束。Windows 实机和安装包未验证,长时间 GIF/视频录制未单列测量数据。
+- 已重启本 worktree 的 Global 隔离开发版,`DESKTOP_DEV_VERDICT=ready`,pid 1425,沙箱 `amazing-morse-0de7eb`。
+- 2026-10-29,用户在开发版更新后反馈“验收通过”,本轮 Mac 优化人工验收通过;反馈未另行细分用例与录制时长。
+- 提交前精简了实机基准夹具的标题文字;上述实机数据保留采样时结果,未因文案整理重跑或改写数值。
+
+复现:
+
+```bash
+capture_report=$(mktemp -t cindy-demand-report)
+live_report=$(mktemp -t cindy-live-report)
+node apps/desktop/scripts/benchmark-macos-demand-capture.mjs --samples=20 --output="$capture_report"
+node apps/desktop/scripts/benchmark-macos-live-capture.mjs --output="$live_report"
+```
+
+上述脚本内部均用 `mkdtemp` 创建并清理独立目录;`--output` 是调用者指定的报告位置,复跑时应选择自己的唯一文件名。
diff --git a/docs/acceptance/region-macos-live-performance-2026-10-29.json b/docs/acceptance/region-macos-live-performance-2026-10-29.json
new file mode 100644
index 0000000000..75f79513e5
--- /dev/null
+++ b/docs/acceptance/region-macos-live-performance-2026-10-29.json
@@ -0,0 +1,210 @@
+{
+ "generatedAt": "2026-10-29T08:02:40.044Z",
+ "rows": [
+ {
+ "side": "before",
+ "coldMs": 614.9864170000001,
+ "raw": [
+ 2.60345899999993,
+ 4.0214169999999285,
+ 5.205916000000343,
+ 5.472833000000264,
+ 4.891916999999921,
+ 5.375500000000102,
+ 6.503416000000016,
+ 4.513332999999875,
+ 9.441957999999431,
+ 10.500417000000198,
+ 10.1215830000001,
+ 9.442207999999482,
+ 9.378791000000092,
+ 11.759625000000597,
+ 4.206083999999464,
+ 3.3418750000000728,
+ 4.491457999999511,
+ 5.092709000000468,
+ 5.175584000000526,
+ 5.452749999999469,
+ 4.748749999999745,
+ 3.678624999999556,
+ 4.730249999999614,
+ 4.137834000000112,
+ 6.23424999999952,
+ 5.435124999999971,
+ 5.3009170000004815,
+ 5.3270000000002256,
+ 9.652957999999671,
+ 7.2016670000002705
+ ],
+ "requestMs": {
+ "p50": 5.3270000000002256,
+ "p95": 10.500417000000198
+ },
+ "sampleMs": 3013.3139580000006,
+ "frames": 30,
+ "actualRequestsPerSecond": 9.95581622696615,
+ "cpuSeconds": 0.72,
+ "realSeconds": 4.8,
+ "maxRssBytes": 34488320,
+ "meanJpegBytes": 293313.6666666667,
+ "staticSha256": "46307306da9db43461e4a41bf20e6ac694a4f1e98bc838241ff81a6735cd4ebd",
+ "staticRepeatIdentical": true
+ },
+ {
+ "side": "after",
+ "coldMs": 583.3864169999997,
+ "raw": [
+ 3.0006249999996726,
+ 13.0073339999999,
+ 15.073041999999987,
+ 17.567542000000685,
+ 14.75708300000042,
+ 14.201708999999028,
+ 14.693417000000409,
+ 16.26050000000032,
+ 15.095875000000888,
+ 14.410292000000481,
+ 13.848457999998573,
+ 15.700208000000202,
+ 15.94970900000044,
+ 17.03966599999876,
+ 14.781166999999186,
+ 15.729957999999897,
+ 15.167500000001382,
+ 14.64745800000128,
+ 15.658000000001266,
+ 20.439416000001074,
+ 13.959917000000132,
+ 16.061083000000508,
+ 20.04820800000016,
+ 21.11333300000115,
+ 25.679957999998805,
+ 20.93537500000093,
+ 17.790750000000116,
+ 19.657874999998967,
+ 21.561791999998604,
+ 15.962208000000828
+ ],
+ "requestMs": {
+ "p50": 15.729957999999897,
+ "p95": 21.561791999998604
+ },
+ "sampleMs": 3017.114042,
+ "frames": 30,
+ "actualRequestsPerSecond": 9.94327678118307,
+ "cpuSeconds": 0.32,
+ "realSeconds": 4.78,
+ "maxRssBytes": 33292288,
+ "meanJpegBytes": 293457.3333333333,
+ "staticSha256": "5730e2471e07e4b9a9285d2678e3741368f914ea33572eed167483144d5f4c30",
+ "staticRepeatIdentical": true
+ },
+ {
+ "side": "after",
+ "coldMs": 129.48654200000055,
+ "raw": [
+ 3.2078330000003916,
+ 14.481709000001501,
+ 11.825874999998632,
+ 10.310166000001118,
+ 12.032999999999447,
+ 12.459458000001177,
+ 11.861832999999024,
+ 12.295584000001327,
+ 14.673957999999402,
+ 15.081915999999183,
+ 17.67991599999914,
+ 15.557041000000027,
+ 17.679417000001195,
+ 10.497874999999112,
+ 11.913167000000612,
+ 22.688333000000057,
+ 22.880167000001165,
+ 18.34020899999996,
+ 16.69774999999936,
+ 18.39274999999907,
+ 22.609542000000147,
+ 17.795207999999548,
+ 13.159042000001136,
+ 17.076082999999926,
+ 18.50825000000077,
+ 15.416957999999795,
+ 16.68016699999862,
+ 19.185333999999784,
+ 20.491916999999376,
+ 17.387791999999536
+ ],
+ "requestMs": {
+ "p50": 16.68016699999862,
+ "p95": 22.688333000000057
+ },
+ "sampleMs": 3014.648292,
+ "frames": 30,
+ "actualRequestsPerSecond": 9.951409615380765,
+ "cpuSeconds": 0.27,
+ "realSeconds": 4.33,
+ "maxRssBytes": 33390592,
+ "meanJpegBytes": 295081.0333333333,
+ "staticSha256": "5730e2471e07e4b9a9285d2678e3741368f914ea33572eed167483144d5f4c30",
+ "staticRepeatIdentical": true
+ },
+ {
+ "side": "before",
+ "coldMs": 152.5944159999999,
+ "raw": [
+ 2.385083000001032,
+ 3.3345829999998386,
+ 4.21258399999715,
+ 3.8032080000011774,
+ 6.123040999998921,
+ 5.164415999999619,
+ 3.5814579999969283,
+ 11.874375000003056,
+ 12.761207999999897,
+ 9.340374999999767,
+ 10.433500000002823,
+ 11.348541999999725,
+ 14.021249999997963,
+ 17.109541999998328,
+ 16.99924999999712,
+ 4.550250000000233,
+ 4.504292000001442,
+ 3.157167000001209,
+ 4.454416000000492,
+ 5.127667000000656,
+ 5.19879199999923,
+ 4.857874999997875,
+ 4.756708000000799,
+ 4.952499999999418,
+ 4.100249999999505,
+ 6.680333000000246,
+ 5.063333000001876,
+ 5.72412500000064,
+ 5.535958000000392,
+ 7.7138340000019525
+ ],
+ "requestMs": {
+ "p50": 5.164415999999619,
+ "p95": 16.99924999999712
+ },
+ "sampleMs": 3015.602417000002,
+ "frames": 30,
+ "actualRequestsPerSecond": 9.948261027673789,
+ "cpuSeconds": 0.77,
+ "realSeconds": 4.34,
+ "maxRssBytes": 33046528,
+ "meanJpegBytes": 295246.86666666664,
+ "staticSha256": "5730e2471e07e4b9a9285d2678e3741368f914ea33572eed167483144d5f4c30",
+ "staticRepeatIdentical": true
+ }
+ ],
+ "display": {
+ "window": 105573,
+ "width": 1470,
+ "scale": 2,
+ "pid": 99562,
+ "display": 1,
+ "height": 956
+ },
+ "scope": "Actual system capture + native encoding + base64/pipe; generated moving desktop. Excludes Electron crop, GIF/video encoding. CPU includes cold start, 3 seconds sampled recording, 1 second pause and static repeat."
+}
diff --git a/docs/acceptance/region-next-annotations-2026-10-29.json b/docs/acceptance/region-next-annotations-2026-10-29.json
new file mode 100644
index 0000000000..df8316911e
--- /dev/null
+++ b/docs/acceptance/region-next-annotations-2026-10-29.json
@@ -0,0 +1,757 @@
+{
+ "generatedAt": "2026-10-29T07:14:13.965Z",
+ "baseline": {
+ "head": "8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0",
+ "description": "Working tree after GIF Worker optimization, before this round"
+ },
+ "samples": 30,
+ "platform": "darwin",
+ "arch": "arm64",
+ "cpu": "Apple M5",
+ "scope": "Real Electron offscreen renderer (1040x760 DIP, 2x density), synthetic opaque BGRA source at the stated dimensions. Excludes OS capture, native window startup, IPC serialization, clipboard and disk. 3 warmups per screenshot/scroll batch; GIF streams include their first frame. Alternating before/after batches. First-paint timing includes two animation frames and is sensitive to vsync/GC. Pipeline probes use production scroll matching and GIF encoding; hover probes count real pointer-driven canvas size assignments; they do not measure presentation latency or allocated memory.",
+ "results": [],
+ "pipeline": [],
+ "regression": [],
+ "versions": {
+ "electron": "42.11.12",
+ "chrome": "148.0.7778.280"
+ },
+ "annotations": [
+ {
+ "side": "before",
+ "readFrequently": true,
+ "raw": [
+ 14.399999976158142,
+ 18.200000047683716,
+ 16.09999990463257,
+ 16.5,
+ 17.100000023841858,
+ 16.5,
+ 17.600000023841858,
+ 15.700000047683716,
+ 17.09999990463257,
+ 15.200000047683716,
+ 19.700000047683716,
+ 15.099999904632568,
+ 13.200000047683716,
+ 20.299999952316284,
+ 17.200000047683716,
+ 13.799999952316284,
+ 13.300000071525574,
+ 22.59999990463257,
+ 17,
+ 18.600000023841858,
+ 16.600000023841858,
+ 15,
+ 15.899999976158142,
+ 18.800000071525574,
+ 16.09999990463257,
+ 17,
+ 18.90000009536743,
+ 16.09999990463257,
+ 14.400000095367432,
+ 14.099999904632568
+ ],
+ "synchronous": [
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 1.600000023841858,
+ 0.5,
+ 0.40000009536743164,
+ 0.3999999761581421,
+ 0.5,
+ 0.40000009536743164,
+ 0.5,
+ 0.40000009536743164,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.2999999523162842,
+ 0.40000009536743164,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421
+ ],
+ "regression": [
+ 2223495864,
+ 163224198,
+ 3282518440,
+ 842827425,
+ 3773932231,
+ 2710417616,
+ 1174370425,
+ 2425146862,
+ 4078705257
+ ],
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 16.5,
+ "p95": 20.3
+ },
+ "synchronousMs": {
+ "p50": 0.45,
+ "p95": 0.5
+ }
+ },
+ {
+ "side": "after",
+ "readFrequently": true,
+ "raw": [
+ 16.199999928474426,
+ 17.399999976158142,
+ 16.600000023841858,
+ 18.5,
+ 16.300000071525574,
+ 13.399999976158142,
+ 13.299999952316284,
+ 22.899999976158142,
+ 16.5,
+ 19.300000071525574,
+ 15.199999928474426,
+ 17.40000009536743,
+ 18.09999990463257,
+ 15.200000047683716,
+ 13.700000047683716,
+ 13.599999904632568,
+ 14.800000071525574,
+ 16.799999952316284,
+ 16.899999976158142,
+ 16.800000071525574,
+ 16.600000023841858,
+ 16.899999976158142,
+ 15.899999976158142,
+ 17.100000023841858,
+ 17.399999976158142,
+ 16,
+ 15.799999952316284,
+ 17.200000047683716,
+ 18.799999952316284,
+ 13.5
+ ],
+ "synchronous": [
+ 0.2999999523162842,
+ 0.30000007152557373,
+ 0.5,
+ 0.20000004768371582,
+ 0.20000004768371582,
+ 0.30000007152557373,
+ 0.2999999523162842,
+ 0.20000004768371582,
+ 0.30000007152557373,
+ 0.20000004768371582,
+ 0.19999992847442627,
+ 0.30000007152557373,
+ 0.10000002384185791,
+ 0.30000007152557373,
+ 0.20000004768371582,
+ 0.19999992847442627,
+ 0.30000007152557373,
+ 0.2999999523162842,
+ 0.20000004768371582,
+ 0.20000004768371582,
+ 0.19999992847442627,
+ 0.2999999523162842,
+ 0.19999992847442627,
+ 0.20000004768371582,
+ 0.19999992847442627,
+ 0.2999999523162842,
+ 0.2999999523162842,
+ 0.20000004768371582,
+ 0.20000004768371582,
+ 0.20000004768371582
+ ],
+ "regression": [
+ 2223495864,
+ 163224198,
+ 3282518440,
+ 842827425,
+ 3773932231,
+ 2710417616,
+ 1174370425,
+ 2425146862,
+ 4078705257
+ ],
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 16.6,
+ "p95": 19.3
+ },
+ "synchronousMs": {
+ "p50": 0.2,
+ "p95": 0.3
+ }
+ },
+ {
+ "side": "after",
+ "readFrequently": true,
+ "raw": [
+ 21,
+ 16.600000023841858,
+ 13.800000071525574,
+ 13.199999928474426,
+ 22.399999976158142,
+ 14,
+ 21,
+ 16.300000071525574,
+ 13.399999976158142,
+ 19.699999928474426,
+ 17,
+ 18.90000009536743,
+ 15.299999952316284,
+ 13.200000047683716,
+ 18.59999990463257,
+ 16.300000071525574,
+ 17.399999976158142,
+ 16,
+ 13.299999952316284,
+ 20.300000071525574,
+ 16.5,
+ 13.600000023841858,
+ 20.5,
+ 16.699999928474426,
+ 14.300000071525574,
+ 19,
+ 16.399999976158142,
+ 17.100000023841858,
+ 16,
+ 16.699999928474426
+ ],
+ "synchronous": [
+ 0.20000004768371582,
+ 0.20000004768371582,
+ 0.30000007152557373,
+ 0.10000002384185791,
+ 0.20000004768371582,
+ 0.20000004768371582,
+ 0.20000004768371582,
+ 0.30000007152557373,
+ 0.19999992847442627,
+ 0.19999992847442627,
+ 0.20000004768371582,
+ 0.30000007152557373,
+ 0.2999999523162842,
+ 0.20000004768371582,
+ 0.10000002384185791,
+ 0.30000007152557373,
+ 0.19999992847442627,
+ 0.20000004768371582,
+ 0.10000002384185791,
+ 0.30000007152557373,
+ 0.10000002384185791,
+ 0.2999999523162842,
+ 0.2999999523162842,
+ 0.19999992847442627,
+ 0.20000004768371582,
+ 0.19999992847442627,
+ 0.19999992847442627,
+ 0.19999992847442627,
+ 0.2999999523162842,
+ 0.2999999523162842
+ ],
+ "regression": [
+ 2223495864,
+ 163224198,
+ 3282518440,
+ 842827425,
+ 3773932231,
+ 2710417616,
+ 1174370425,
+ 2425146862,
+ 4078705257
+ ],
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 16.55,
+ "p95": 21
+ },
+ "synchronousMs": {
+ "p50": 0.2,
+ "p95": 0.3
+ }
+ },
+ {
+ "side": "before",
+ "readFrequently": true,
+ "raw": [
+ 21.100000023841858,
+ 16.700000047683716,
+ 16.59999990463257,
+ 17.100000023841858,
+ 16.5,
+ 13.399999976158142,
+ 19.5,
+ 16.800000071525574,
+ 17.799999952316284,
+ 13.800000071525574,
+ 13.799999952316284,
+ 23.299999952316284,
+ 16.300000071525574,
+ 14,
+ 20.299999952316284,
+ 17.5,
+ 17.200000047683716,
+ 14.699999928474426,
+ 15.300000071525574,
+ 16.799999952316284,
+ 16.5,
+ 16.899999976158142,
+ 16.300000071525574,
+ 13.600000023841858,
+ 13.299999952316284,
+ 23.600000023841858,
+ 16.100000023841858,
+ 13.399999976158142,
+ 20.299999952316284,
+ 13.300000071525574
+ ],
+ "synchronous": [
+ 0.5,
+ 0.2999999523162842,
+ 0.5,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.5,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.3999999761581421,
+ 0.30000007152557373,
+ 0.2999999523162842,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.2999999523162842,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421
+ ],
+ "regression": [
+ 2223495864,
+ 163224198,
+ 3282518440,
+ 842827425,
+ 3773932231,
+ 2710417616,
+ 1174370425,
+ 2425146862,
+ 4078705257
+ ],
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 16.55,
+ "p95": 23.3
+ },
+ "synchronousMs": {
+ "p50": 0.4,
+ "p95": 0.5
+ }
+ },
+ {
+ "side": "before",
+ "readFrequently": false,
+ "raw": [
+ 17.5,
+ 16.700000047683716,
+ 15.399999976158142,
+ 16.100000023841858,
+ 17.299999952316284,
+ 16.700000047683716,
+ 15.700000047683716,
+ 17.59999990463257,
+ 17.100000023841858,
+ 14.200000047683716,
+ 14.199999928474426,
+ 13.900000095367432,
+ 14.199999928474426,
+ 13.899999976158142,
+ 14.400000095367432,
+ 16.699999928474426,
+ 16.700000047683716,
+ 18.199999928474426,
+ 14.800000071525574,
+ 17.299999952316284,
+ 18.100000023841858,
+ 18.5,
+ 14.899999976158142,
+ 18.5,
+ 16.799999952316284,
+ 17.100000023841858,
+ 17.399999976158142,
+ 17.700000047683716,
+ 15.399999976158142,
+ 13.600000023841858
+ ],
+ "synchronous": [
+ 3.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.2999999523162842,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.30000007152557373,
+ 0.5,
+ 0.40000009536743164,
+ 0.5,
+ 0.30000007152557373,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.2999999523162842,
+ 0.30000007152557373,
+ 0.3999999761581421,
+ 0.2999999523162842,
+ 0.3999999761581421,
+ 0.6000000238418579,
+ 0.3999999761581421,
+ 0.5,
+ 0.30000007152557373,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421
+ ],
+ "regression": [
+ 2223495864,
+ 163224198,
+ 3282518440,
+ 842827425,
+ 3773932231,
+ 2710417616,
+ 1174370425,
+ 2425146862,
+ 4078705257
+ ],
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 16.7,
+ "p95": 18.5
+ },
+ "synchronousMs": {
+ "p50": 0.4,
+ "p95": 0.6
+ }
+ },
+ {
+ "side": "after",
+ "readFrequently": false,
+ "raw": [
+ 13.600000023841858,
+ 15.799999952316284,
+ 16.300000071525574,
+ 16.199999928474426,
+ 16.300000071525574,
+ 16.399999976158142,
+ 16.5,
+ 16.100000023841858,
+ 16.5,
+ 15.799999952316284,
+ 16,
+ 16.100000023841858,
+ 17.100000023841858,
+ 16.899999976158142,
+ 16.100000023841858,
+ 16.899999976158142,
+ 17.100000023841858,
+ 16.09999990463257,
+ 16.600000023841858,
+ 16.600000023841858,
+ 17,
+ 16.200000047683716,
+ 13.5,
+ 17.799999952316284,
+ 17.799999952316284,
+ 18,
+ 13.300000071525574,
+ 17.399999976158142,
+ 17.600000023841858,
+ 17.600000023841858
+ ],
+ "synchronous": [
+ 0.30000007152557373,
+ 0.19999992847442627,
+ 0.20000004768371582,
+ 0.19999992847442627,
+ 0.20000004768371582,
+ 0.2999999523162842,
+ 0.19999992847442627,
+ 0.10000002384185791,
+ 0.19999992847442627,
+ 0.19999992847442627,
+ 0.20000004768371582,
+ 0.2999999523162842,
+ 0.19999992847442627,
+ 0.09999990463256836,
+ 0.19999992847442627,
+ 0.2999999523162842,
+ 0.2999999523162842,
+ 0.19999992847442627,
+ 0.10000002384185791,
+ 0.30000007152557373,
+ 0.20000004768371582,
+ 0.10000002384185791,
+ 0.2999999523162842,
+ 0.19999992847442627,
+ 0.20000004768371582,
+ 0.10000002384185791,
+ 0.30000007152557373,
+ 0.19999992847442627,
+ 0.10000002384185791,
+ 0.19999992847442627
+ ],
+ "regression": [
+ 2223495864,
+ 163224198,
+ 3282518440,
+ 842827425,
+ 3773932231,
+ 2710417616,
+ 1174370425,
+ 2425146862,
+ 4078705257
+ ],
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 16.45,
+ "p95": 17.8
+ },
+ "synchronousMs": {
+ "p50": 0.2,
+ "p95": 0.3
+ }
+ },
+ {
+ "side": "after",
+ "readFrequently": false,
+ "raw": [
+ 16.799999952316284,
+ 16.700000047683716,
+ 15.700000047683716,
+ 16.59999990463257,
+ 16,
+ 16.90000009536743,
+ 17.299999952316284,
+ 17.299999952316284,
+ 17.200000047683716,
+ 19,
+ 15.699999928474426,
+ 16.700000047683716,
+ 15.600000023841858,
+ 16.899999976158142,
+ 18,
+ 18.5,
+ 17.700000047683716,
+ 18.199999928474426,
+ 17.200000047683716,
+ 16.699999928474426,
+ 15.600000023841858,
+ 16.600000023841858,
+ 19.5,
+ 15.399999976158142,
+ 15.200000047683716,
+ 16.699999928474426,
+ 16.299999952316284,
+ 17,
+ 15.800000071525574,
+ 20.299999952316284
+ ],
+ "synchronous": [
+ 0.20000004768371582,
+ 0.20000004768371582,
+ 0.19999992847442627,
+ 0.19999992847442627,
+ 0.20000004768371582,
+ 0.30000007152557373,
+ 0.3999999761581421,
+ 0.20000004768371582,
+ 0.20000004768371582,
+ 0.19999992847442627,
+ 0.2999999523162842,
+ 0.30000007152557373,
+ 0.2999999523162842,
+ 0.2999999523162842,
+ 0.20000004768371582,
+ 0.2999999523162842,
+ 0.2999999523162842,
+ 0.2999999523162842,
+ 0.20000004768371582,
+ 0.19999992847442627,
+ 0.30000007152557373,
+ 0.3999999761581421,
+ 0.2999999523162842,
+ 0.2999999523162842,
+ 0.20000004768371582,
+ 0.2999999523162842,
+ 0.20000004768371582,
+ 0.20000004768371582,
+ 0.20000004768371582,
+ 0.2999999523162842
+ ],
+ "regression": [
+ 2223495864,
+ 163224198,
+ 3282518440,
+ 842827425,
+ 3773932231,
+ 2710417616,
+ 1174370425,
+ 2425146862,
+ 4078705257
+ ],
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 16.75,
+ "p95": 19.5
+ },
+ "synchronousMs": {
+ "p50": 0.25,
+ "p95": 0.4
+ }
+ },
+ {
+ "side": "before",
+ "readFrequently": false,
+ "raw": [
+ 15,
+ 14.800000071525574,
+ 15.799999952316284,
+ 16.600000023841858,
+ 16.700000047683716,
+ 17.09999990463257,
+ 17,
+ 16.700000047683716,
+ 17.799999952316284,
+ 16.200000047683716,
+ 17.899999976158142,
+ 16.200000047683716,
+ 17.399999976158142,
+ 17.799999952316284,
+ 14.700000047683716,
+ 13.700000047683716,
+ 20.59999990463257,
+ 17.600000023841858,
+ 16.200000047683716,
+ 13.699999928474426,
+ 20.40000009536743,
+ 16.59999990463257,
+ 17.899999976158142,
+ 17.90000009536743,
+ 26.199999928474426,
+ 20.600000023841858,
+ 17,
+ 15.899999976158142,
+ 16.800000071525574,
+ 17.299999952316284
+ ],
+ "synchronous": [
+ 0.40000009536743164,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.2999999523162842,
+ 0.5,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.3999999761581421,
+ 0.5,
+ 0.40000009536743164,
+ 0.3999999761581421,
+ 0.6000000238418579,
+ 0.30000007152557373,
+ 0.2999999523162842,
+ 0.5,
+ 0.30000007152557373,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.30000007152557373
+ ],
+ "regression": [
+ 2223495864,
+ 163224198,
+ 3282518440,
+ 842827425,
+ 3773932231,
+ 2710417616,
+ 1174370425,
+ 2425146862,
+ 4078705257
+ ],
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 16.9,
+ "p95": 20.6
+ },
+ "synchronousMs": {
+ "p50": 0.4,
+ "p95": 0.5
+ }
+ }
+ ]
+}
diff --git a/docs/acceptance/region-next-baseline-2026-10-29.patch b/docs/acceptance/region-next-baseline-2026-10-29.patch
new file mode 100644
index 0000000000..d751c99bbb
--- /dev/null
+++ b/docs/acceptance/region-next-baseline-2026-10-29.patch
@@ -0,0 +1,458 @@
+--- a/apps/desktop/native/region-screenshot/macos-snapshot.swift
++++ b/apps/desktop/native/region-screenshot/macos-snapshot.swift
+@@ -257,6 +257,10 @@
+ }
+ }
+
++// AppKit's window hit-testing needs an application connection even in this
++// stdin-driven helper; without it windowNumber(at:) returns 0 for real windows.
++// Stay a background-only process: no Dock entry, activation or app event loop.
++NSApplication.shared.setActivationPolicy(.prohibited)
+ setvbuf(stdout, nil, _IOLBF, 0)
+ while let line = readLine() {
+ guard let data = line.data(using: .utf8),
+--- a/apps/desktop/src/renderer/features/region-screenshot/LiveCapturePanel.tsx
++++ b/apps/desktop/src/renderer/features/region-screenshot/LiveCapturePanel.tsx
+@@ -92,7 +92,8 @@
+ state.startedAt = performance.now(); state.elapsed = 0;
+ state.recorder = new CaptureRecorder(state.canvas!, begin.mode === 'gif' ? 'gif' : 'webm', () => { setStatus('limit'); void finish(); });
+ }
+- state.recorder.add(currentTime());
++ await state.recorder.add(currentTime());
++ if (!state.active || state.phase !== 'capturing') return;
+ setElapsed(Math.floor(currentTime() / 1000) * 1000);
+ if (currentTime() >= MAX_RECORDING_MS) { setStatus('limit'); queueMicrotask(() => void finish()); }
+ }
+--- a/apps/desktop/src/renderer/features/region-screenshot/Magnifier.tsx
++++ b/apps/desktop/src/renderer/features/region-screenshot/Magnifier.tsx
+@@ -55,8 +55,11 @@
+ const canvas = canvasRef.current;
+ if (!canvas || !frame) return;
+ const dpr = window.devicePixelRatio || 1;
+- canvas.width = Math.round(VIEW * dpr);
+- canvas.height = Math.round(VIEW * dpr);
++ const pixels = Math.round(VIEW * dpr);
++ // Assigning even an unchanged size resets the backing store and context.
++ // Pointer movement only needs a repaint; resize when the density changes.
++ if (canvas.width !== pixels) canvas.width = pixels;
++ if (canvas.height !== pixels) canvas.height = pixels;
+ const ctx = canvas.getContext('2d');
+ if (!ctx) return;
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
+--- a/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.test.ts
++++ b/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.test.ts
+@@ -1,6 +1,7 @@
+ import { afterEach, expect, it, vi } from 'vitest';
+ import { CaptureRecorder } from './captureRecorder';
+ import { finalizeWebmDuration } from './webmDuration';
++import { GifEncoding, type GifRequest } from './gifEncoding';
+
+ // Real playback reported Infinity and could not show a timeline. Existing tests
+ // only decoded pixels. Minimal streaming WebM Info without Duration; tier: unit.
+@@ -17,7 +18,7 @@
+ // Unit regression: the UI matrix produced an empty short WebM that was reported
+ // as saved. Exercise the encoder's real finish boundary with an empty browser
+ // stop event; geometry and browser playback tests do not cover this outcome.
+-afterEach(() => vi.unstubAllGlobals());
++afterEach(() => { vi.unstubAllGlobals(); vi.useRealTimers(); });
+
+ it('rejects a recording when the browser stops without encoded frames', async () => {
+ class EmptyRecorder {
+@@ -31,7 +32,7 @@
+ const track = { stop: vi.fn(), requestFrame: vi.fn() };
+ const canvas = { captureStream: () => ({ getTracks: () => [track], getVideoTracks: () => [track] }) } as unknown as HTMLCanvasElement;
+ const recorder = new CaptureRecorder(canvas, 'webm', () => {});
+- recorder.add(0);
++ await recorder.add(0);
+ await expect(recorder.finish(1)).rejects.toThrow('No video frames were encoded');
+ expect(track.stop).toHaveBeenCalled();
+ });
+@@ -67,17 +68,84 @@
+ const canvas = { width: 2, height: 1, getContext: () => ({
+ getImageData: () => ({ data: pixels.slice() }),
+ }) } as unknown as HTMLCanvasElement;
+- const recorder = new CaptureRecorder(canvas, 'gif', () => {});
+- recorder.add(0);
+- recorder.add(100);
+- recorder.add(200);
++ const recorder = new CaptureRecorder(canvas, 'gif', () => {}, () => new TestGifWorker() as unknown as Worker);
++ await recorder.add(0);
++ await recorder.add(100);
++ await recorder.add(200);
+ pixels.set([0, 0, 255, 255], 4);
+- recorder.add(300);
++ await recorder.add(300);
+ recorder.pause(400);
+ recorder.resume();
+- recorder.add(400);
+- recorder.add(500);
++ await recorder.add(400);
++ await recorder.add(500);
+ const bytes = await recorder.finish(600);
+ expect(frameDelays(bytes)).toEqual([300, 100, 200]);
+ recorder.dispose();
+ });
++
++// The unit transport delivers the actual encoder's results; the Electron benchmark
++// exercises the real Worker separately. Structured clone models buffer ownership.
++class TestGifWorker {
++ onmessage: Worker['onmessage'] = null;
++ onerror: Worker['onerror'] = null;
++ onmessageerror: Worker['onmessageerror'] = null;
++ terminated = false;
++ messages: GifRequest[] = [];
++ private encoder: GifEncoding | null = null;
++ constructor(private readonly automatic = true) {}
++ postMessage(message: GifRequest, transfer: Transferable[] = []) {
++ this.messages.push(structuredClone(message, { transfer }));
++ if (this.automatic) queueMicrotask(() => this.deliver());
++ }
++ deliver() {
++ if (this.terminated) return;
++ for (const data of this.messages.splice(0)) {
++ if (data.kind === 'init') this.encoder = new GifEncoding(data.width, data.height);
++ else if (data.kind === 'pause') this.encoder!.pause(data.at);
++ else {
++ const response = data.kind === 'add'
++ ? { kind: 'added', id: data.id, limit: this.encoder!.add(data.pixels, data.at) }
++ : { kind: 'finished', id: data.id, bytes: this.encoder!.finish(data.at) };
++ this.onmessage?.call(this as unknown as Worker, { data: response } as MessageEvent);
++ }
++ }
++ }
++ terminate() { this.terminated = true; }
++}
++
++const gifCanvas = () => ({ width: 2, height: 1, getContext: () => ({
++ getImageData: () => ({ data: new Uint8ClampedArray([255, 0, 0, 255, 0, 0, 255, 255]) }),
++}) }) as unknown as HTMLCanvasElement;
++
++// Worker migration creates new timing boundaries. Existing synchronous GIF tests
++// cannot cover pause/finish during encoding, cancellation or worker failure. Unit:
++// one accepted 2x1 frame must settle before finish, without buffering a second frame.
++it('orders pause and finish behind an in-flight GIF frame and bounds the queue', async () => {
++ const worker = new TestGifWorker(false);
++ const recorder = new CaptureRecorder(gifCanvas(), 'gif', () => {}, () => worker as unknown as Worker);
++ const adding = recorder.add(0);
++ await expect(recorder.add(100)).rejects.toThrow('still in flight');
++ recorder.pause(200);
++ const finishing = recorder.finish(300);
++ worker.deliver();
++ await adding;
++ worker.deliver();
++ expect(frameDelays(await finishing)).toEqual([200]);
++ expect(worker.terminated).toBe(true);
++ await expect(recorder.finish(400)).rejects.toThrow('already stopped');
++});
++
++it.each(['cancel', 'error', 'messageerror', 'timeout'] as const)('settles a pending GIF frame on %s and releases its worker', async (cause) => {
++ vi.useFakeTimers();
++ const worker = new TestGifWorker(false);
++ const recorder = new CaptureRecorder(gifCanvas(), 'gif', () => {}, () => worker as unknown as Worker);
++ const rejected = expect(recorder.add(0)).rejects.toThrow(/disposed|failed|timed out/);
++ if (cause === 'cancel') recorder.dispose();
++ else if (cause === 'error') worker.onerror?.call(worker as unknown as Worker, {} as ErrorEvent);
++ else if (cause === 'messageerror') worker.onmessageerror?.call(worker as unknown as Worker, {} as MessageEvent);
++ else await vi.advanceTimersByTimeAsync(15_000);
++ await rejected;
++ expect(worker.terminated).toBe(true);
++ expect(vi.getTimerCount()).toBe(0);
++ recorder.dispose();
++});
+--- a/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.ts
++++ b/apps/desktop/src/renderer/features/region-screenshot/captureRecorder.ts
+@@ -1,20 +1,20 @@
+-import { GIFEncoder, applyPalette, quantize } from 'gifenc';
++import { GifWorker } from './gifWorker';
+ import { MAX_RECORDING_BYTES } from '../../../shared/regionCapture';
+ import { finalizeWebmDuration } from './webmDuration';
+
+ /** Bounded, local-only encoding. Source pixels are supplied by the host's selected region. */
+ export class CaptureRecorder {
+- private readonly gif;
++ private readonly gif: GifWorker | null;
++ private inFlight: Promise<void> | null = null;
+ private readonly recorder: MediaRecorder | null;
+ private readonly stream: MediaStream | null;
+ private readonly chunks: Blob[] = [];
+ private bytes = 0;
+- private previous: { pixels: Uint8ClampedArray; index: Uint8Array; palette: number[][]; at: number } | null = null;
+ private stopped = false;
+ private failure: Error | null = null;
+
+- constructor(private readonly canvas: HTMLCanvasElement, readonly format: 'webm' | 'gif', private readonly onLimit: () => void) {
+- this.gif = format === 'gif' ? GIFEncoder() : null;
++ constructor(private readonly canvas: HTMLCanvasElement, readonly format: 'webm' | 'gif', private readonly onLimit: () => void, createGifWorker?: () => Worker) {
++ this.gif = format === 'gif' ? new GifWorker(canvas.width, canvas.height, createGifWorker) : null;
+ this.stream = format === 'webm' ? canvas.captureStream(0) : null;
+ if (this.stream) {
+ const mimeType = ['video/webm;codecs=vp9', 'video/webm;codecs=vp8', 'video/webm'].find((type) => MediaRecorder.isTypeSupported(type));
+@@ -36,33 +36,23 @@
+ } else this.recorder = null;
+ }
+
+- add(at: number): void {
+- if (this.stopped) return;
++ add(at: number): Promise<void> {
++ if (this.stopped) return Promise.resolve();
++ if (this.inFlight) return Promise.reject(new Error('Recording frame still in flight'));
+ if (this.recorder) {
+ (this.stream!.getVideoTracks()[0] as CanvasCaptureMediaStreamTrack).requestFrame();
+- } else if (this.gif) {
+- const pixels = this.canvas.getContext('2d', { willReadFrequently: true })!.getImageData(0, 0, this.canvas.width, this.canvas.height);
+- // Hold identical frames until the next change, pause or finish. Exact RGBA
+- // comparison preserves small cursor/text changes and the full hold duration.
+- if (this.previous && samePixels(this.previous.pixels, pixels.data)) return;
+- this.flushGif(at);
+- const palette = quantize(pixels.data, 256, { format: 'rgb444' });
+- this.previous = { pixels: pixels.data, palette, index: applyPalette(pixels.data, palette, 'rgb444'), at };
+- if (this.gif.bytesView().length > MAX_RECORDING_BYTES - 4 * 1024 * 1024) this.onLimit();
++ return Promise.resolve();
+ }
+- }
+-
+- private flushGif(at: number): void {
+- if (!this.previous || !this.gif) return;
+- this.gif.writeFrame(this.previous.index, this.canvas.width, this.canvas.height, {
+- palette: this.previous.palette, delay: Math.max(20, at - this.previous.at), repeat: 0,
+- });
+- this.previous = null;
++ const pixels = this.canvas.getContext('2d', { willReadFrequently: true })!.getImageData(0, 0, this.canvas.width, this.canvas.height);
++ this.inFlight = this.gif!.add(pixels.data, at).then((limit) => {
++ if (limit && !this.stopped) this.onLimit();
++ }).finally(() => { this.inFlight = null; });
++ return this.inFlight;
+ }
+
+ pause(at: number): void {
+ if (this.recorder?.state === 'recording') this.recorder.pause();
+- this.flushGif(at);
++ this.gif?.pause(at);
+ }
+ resume(): void { if (this.recorder?.state === 'paused') this.recorder.resume(); }
+
+@@ -82,11 +72,8 @@
+ if (bytes.length > MAX_RECORDING_BYTES) throw new Error('Recording size limit');
+ return bytes;
+ }
+- this.flushGif(at);
+- this.gif!.finish();
+- const bytes = this.gif!.bytes();
+- if (bytes.length > MAX_RECORDING_BYTES) throw new Error('Recording size limit');
+- return bytes;
++ await this.inFlight;
++ return this.gif!.finish(at);
+ }
+
+ dispose(): void {
+@@ -94,14 +81,6 @@
+ if (this.recorder && this.recorder.state !== 'inactive') this.recorder.stop();
+ this.stream?.getTracks().forEach((track) => track.stop());
+ this.chunks.length = 0;
+- this.previous = null;
++ this.gif?.dispose();
+ }
+ }
+-
+-function samePixels(a: Uint8ClampedArray, b: Uint8ClampedArray): boolean {
+- if (a.length !== b.length) return false;
+- const left = new Uint32Array(a.buffer, a.byteOffset, a.length / 4);
+- const right = new Uint32Array(b.buffer, b.byteOffset, b.length / 4);
+- for (let i = 0; i < left.length; i++) if (left[i] !== right[i]) return false;
+- return true;
+-}
+--- /dev/null
++++ b/apps/desktop/src/renderer/features/region-screenshot/gifEncoding.ts
+@@ -0,0 +1,53 @@
++import { GIFEncoder, applyPalette, quantize } from 'gifenc';
++import { MAX_RECORDING_BYTES } from '../../../shared/regionCapture';
++
++/** The original GIF algorithm, isolated from Canvas and scheduling. One instance
++ * owns one recording; no shared palettes, frame dropping or quality changes. */
++export class GifEncoding {
++ private readonly gif = GIFEncoder();
++ private previous: { pixels: Uint8ClampedArray; index: Uint8Array; palette: number[][]; at: number } | null = null;
++
++ constructor(private readonly width: number, private readonly height: number) {}
++
++ add(pixels: Uint8ClampedArray, at: number): boolean {
++ if (this.previous && samePixels(this.previous.pixels, pixels)) return false;
++ this.pause(at);
++ const palette = quantize(pixels, 256, { format: 'rgb444' });
++ this.previous = { pixels, palette, index: applyPalette(pixels, palette, 'rgb444'), at };
++ return this.gif.bytesView().length > MAX_RECORDING_BYTES - 4 * 1024 * 1024;
++ }
++
++ pause(at: number): void {
++ if (!this.previous) return;
++ this.gif.writeFrame(this.previous.index, this.width, this.height, {
++ palette: this.previous.palette, delay: Math.max(20, at - this.previous.at), repeat: 0,
++ });
++ this.previous = null;
++ }
++
++ finish(at: number): Uint8Array<ArrayBuffer> {
++ this.pause(at);
++ this.gif.finish();
++ const bytes = this.gif.bytes();
++ if (bytes.length > MAX_RECORDING_BYTES) throw new Error('Recording size limit');
++ return bytes;
++ }
++}
++
++function samePixels(a: Uint8ClampedArray, b: Uint8ClampedArray): boolean {
++ if (a.length !== b.length) return false;
++ const left = new Uint32Array(a.buffer, a.byteOffset, a.length / 4);
++ const right = new Uint32Array(b.buffer, b.byteOffset, b.length / 4);
++ for (let i = 0; i < left.length; i++) if (left[i] !== right[i]) return false;
++ return true;
++}
++
++export type GifRequest =
++ | { kind: 'init'; width: number; height: number }
++ | { kind: 'add'; id: number; pixels: Uint8ClampedArray<ArrayBuffer>; at: number }
++ | { kind: 'pause'; at: number }
++ | { kind: 'finish'; id: number; at: number };
++export type GifResponse =
++ | { kind: 'added'; id: number; limit: boolean }
++ | { kind: 'finished'; id: number; bytes: Uint8Array<ArrayBuffer> }
++ | { kind: 'error'; message: string };
+--- /dev/null
++++ b/apps/desktop/src/renderer/features/region-screenshot/gifEncoding.worker.ts
+@@ -0,0 +1,23 @@
++import { GifEncoding, type GifRequest, type GifResponse } from './gifEncoding';
++
++let encoder: GifEncoding | null = null;
++const send = (response: GifResponse, transfer: Transferable[] = []) => (self as unknown as Worker).postMessage(response, transfer);
++
++// A worker processes these messages in order. Pause cannot overtake an accepted
++// frame, and finish cannot overtake pause, even while encoding blocks this thread.
++self.onmessage = ({ data }: MessageEvent<GifRequest>) => {
++ try {
++ if (data.kind === 'init') encoder = new GifEncoding(data.width, data.height);
++ else if (!encoder) throw new Error('GIF encoder unavailable');
++ else if (data.kind === 'add') send({ kind: 'added', id: data.id, limit: encoder.add(data.pixels, data.at) });
++ else if (data.kind === 'pause') encoder.pause(data.at);
++ else {
++ const bytes = encoder.finish(data.at);
++ send({ kind: 'finished', id: data.id, bytes }, [bytes.buffer]);
++ encoder = null;
++ }
++ } catch (error) {
++ encoder = null;
++ send({ kind: 'error', message: error instanceof Error ? error.message : 'GIF encoding failed' });
++ }
++};
+--- /dev/null
++++ b/apps/desktop/src/renderer/features/region-screenshot/gifWorker.ts
+@@ -0,0 +1,71 @@
++import EncodingWorker from './gifEncoding.worker?worker';
++import type { GifRequest, GifResponse } from './gifEncoding';
++
++/** At most one frame is in flight. Pixels and final bytes are transferred, not
++ * cloned. Cancelling terminates work immediately and settles the awaiting sample. */
++export class GifWorker {
++ private readonly worker: Worker;
++ private sequence = 0;
++ private failure: Error | null = null;
++ private pending: { id: number; resolve: (response: GifResponse) => void; reject: (error: Error) => void; timer: ReturnType<typeof setTimeout> } | null = null;
++
++ constructor(width: number, height: number, createWorker = () => new EncodingWorker()) {
++ this.worker = createWorker();
++ this.worker.onmessage = ({ data }: MessageEvent<GifResponse>) => {
++ if (data.kind === 'error') { this.fail(new Error(data.message)); return; }
++ if (this.pending?.id !== data.id) return;
++ const pending = this.pending;
++ this.pending = null;
++ clearTimeout(pending.timer);
++ pending.resolve(data);
++ };
++ this.worker.onerror = () => this.fail(new Error('GIF worker failed'));
++ this.worker.onmessageerror = () => this.fail(new Error('GIF worker response failed'));
++ try { this.worker.postMessage({ kind: 'init', width, height } satisfies GifRequest); }
++ catch (error) { this.worker.terminate(); throw error; }
++ }
++
++ private request(message: GifRequest & { id: number }, transfer: Transferable[] = []): Promise<GifResponse> {
++ if (this.failure) return Promise.reject(this.failure);
++ if (this.pending) return Promise.reject(new Error('GIF frame still in flight'));
++ return new Promise((resolve, reject) => {
++ const timer = setTimeout(() => this.fail(new Error('GIF encoding timed out')), 15_000);
++ this.pending = { id: message.id, resolve, reject, timer };
++ try { this.worker.postMessage(message, transfer); }
++ catch (error) { this.fail(error instanceof Error ? error : new Error('GIF worker unavailable')); }
++ });
++ }
++
++ async add(pixels: Uint8ClampedArray<ArrayBuffer>, at: number): Promise<boolean> {
++ const result = await this.request({ kind: 'add', id: ++this.sequence, pixels, at }, [pixels.buffer]);
++ if (result.kind !== 'added') throw new Error('Invalid GIF frame response');
++ return result.limit;
++ }
++
++ pause(at: number): void {
++ if (this.failure) return;
++ try { this.worker.postMessage({ kind: 'pause', at } satisfies GifRequest); }
++ catch (error) { this.fail(error instanceof Error ? error : new Error('GIF worker unavailable')); }
++ }
++
++ async finish(at: number): Promise<Uint8Array<ArrayBuffer>> {
++ try {
++ const result = await this.request({ kind: 'finish', id: ++this.sequence, at });
++ if (result.kind !== 'finished') throw new Error('Invalid GIF finish response');
++ return result.bytes;
++ } finally { this.dispose(); }
++ }
++
++ private fail(error: Error): void {
++ this.failure ??= error;
++ this.worker.terminate();
++ if (this.pending) {
++ const pending = this.pending;
++ this.pending = null;
++ clearTimeout(pending.timer);
++ pending.reject(this.failure);
++ }
++ }
++
++ dispose(): void { this.fail(new Error('GIF recording disposed')); }
++}
+--- a/apps/desktop/src/shared/scrollCapture.ts
++++ b/apps/desktop/src/shared/scrollCapture.ts
+@@ -82,6 +82,7 @@
+ }
+ const rowErrors = Array.from({ length: height }, (_, y) => errorAt(previous, next, y, y, columns));
+ if (rowErrors.every((error) => error < 2)) return { kind: 'same' };
++ const mostlyStationary = rowErrors.filter((error) => error < 2).length / height >= 0.9;
+ let header = 0;
+ let footer = 0;
+ const fixedLimit = Math.floor(height / 3);
+@@ -102,10 +103,15 @@
+ for (let sample = 0; sample < rows; sample++) {
+ const y = start + Math.floor((sample / rows) * overlap);
+ sum += errorAt(previous, next, y + offset, y, columns);
+- // Errors are nonnegative. Once a reliable candidate exists, an offset
+- // already outside its ambiguity margin can neither win nor invalidate it.
+- // Keep searching all offsets, but stop reading rows for this loser.
+- if (bestScore <= 3 && sum / rows > bestScore + Math.max(0.15, bestScore * 0.5)) break;
++ // Errors are nonnegative: this partial mean is a lower bound. An accepted
++ // score is <= 3 and its largest ambiguity margin is 1.5, so a candidate
++ // already above 4.5 cannot win or invalidate any accepted match. Prune it
++ // even before finding a winner (especially valuable for unrelated frames).
++ // Keep full scores for mostly-stationary frames: their zero-motion winner
++ // may intentionally be accepted above 3, so its ordering still matters.
++ const cutoff = bestScore <= 3 ? bestScore + Math.max(0.15, bestScore * 0.5)
++ : mostlyStationary ? Infinity : 4.5;
++ if (sum / rows > cutoff) break;
+ }
+ const score = sum / rows;
+ candidates.push({ offset, score });
+@@ -117,7 +123,7 @@
+ const reverse = matchSampledFrames(next, previous, false);
+ return reverse.kind === 'append' ? { ...reverse, kind: 'prepend', offset: -reverse.offset } : { kind: 'unmatched' };
+ }
+- if (best?.offset === 0 && (best.score <= 3 || rowErrors.filter((error) => error < 2).length / height >= 0.9)) return { kind: 'same' };
++ if (best?.offset === 0 && (best.score <= 3 || mostlyStationary)) return { kind: 'same' };
+ if (!best || best.offset <= 0 || best.score > 3) return { kind: 'unmatched' };
+ const rival = candidates.find((candidate) => Math.abs(candidate.offset - best.offset) > 2);
+ // White space dilutes the mean error on text pages. Compare relative confidence:
diff --git a/docs/acceptance/region-next-memory-after-2026-10-29.json b/docs/acceptance/region-next-memory-after-2026-10-29.json
new file mode 100644
index 0000000000..c47f2c43fa
--- /dev/null
+++ b/docs/acceptance/region-next-memory-after-2026-10-29.json
@@ -0,0 +1,143 @@
+{
+ "generatedAt": "2026-10-29T07:17:22.282Z",
+ "platform": "darwin",
+ "arch": "arm64",
+ "electron": "42.11.12",
+ "capture": [],
+ "save": [
+ {
+ "side": "after",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 163.476292,
+ 135.460375,
+ 137.379167,
+ 146.219375,
+ 135.284541,
+ 135.19445900000005,
+ 136.44466699999998,
+ 134.88016700000003,
+ 134.85812499999997,
+ 136.10716700000012
+ ],
+ "synchronous": [
+ 17.69470800000002,
+ 13.320499999999981,
+ 13.272167000000024,
+ 22.801249999999982,
+ 12.535250000000019,
+ 12.44845900000007,
+ 12.677083999999923,
+ 12.885999999999967,
+ 12.356874999999945,
+ 12.393000000000029
+ ],
+ "timerDelay": [
+ 43.036417,
+ 13.484541999999976,
+ 13.428667000000019,
+ 22.99729100000002,
+ 12.683457999999973,
+ 12.592667000000006,
+ 12.845708999999943,
+ 13.026749999999993,
+ 12.496624999999995,
+ 12.571916999999985
+ ],
+ "p50": 136.10716700000012,
+ "p95": 163.476292,
+ "mainThread": {
+ "p50": 12.885999999999967,
+ "p95": 22.801249999999982
+ },
+ "timer": {
+ "p50": 13.026749999999993,
+ "p95": 43.036417
+ },
+ "bytes": 289381
+ },
+ {
+ "side": "after",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 135.51708399999984,
+ 134.383875,
+ 135.35533299999997,
+ 134.63470800000005,
+ 134.9364999999998,
+ 134.23949999999968,
+ 134.99670800000013,
+ 134.57729199999994,
+ 134.6205,
+ 135.33200000000033
+ ],
+ "synchronous": [
+ 13.201749999999947,
+ 12.31512500000008,
+ 12.50370799999996,
+ 12.394250000000284,
+ 12.341750000000047,
+ 12.412165999999615,
+ 12.71145800000022,
+ 12.33416699999998,
+ 12.306999999999789,
+ 12.52612500000032
+ ],
+ "timerDelay": [
+ 13.465208999999959,
+ 12.426083000000062,
+ 12.618582999999944,
+ 12.527082999999948,
+ 12.447749999999814,
+ 12.537082999999711,
+ 12.8268750000002,
+ 12.441124999999829,
+ 12.426458999999795,
+ 12.6372080000001
+ ],
+ "p50": 134.9364999999998,
+ "p95": 135.51708399999984,
+ "mainThread": {
+ "p50": 12.412165999999615,
+ "p95": 13.201749999999947
+ },
+ "timer": {
+ "p50": 12.537082999999711,
+ "p95": 13.465208999999959
+ },
+ "bytes": 289381
+ }
+ ],
+ "regression": [
+ {
+ "scale": 2,
+ "alpha": 0,
+ "width": 401,
+ "height": 301,
+ "identical": true
+ },
+ {
+ "scale": 2,
+ "alpha": 127,
+ "width": 401,
+ "height": 301,
+ "identical": true
+ },
+ {
+ "scale": 1.5,
+ "alpha": 255,
+ "width": 300,
+ "height": 226,
+ "identical": true
+ }
+ ],
+ "memory": {
+ "side": "after",
+ "maximumResidentSetBytes": 756219904,
+ "scope": "macOS time -l maximum RSS of isolated Electron main process, including synthetic fixture allocations and native codec caches; not the interactive Cindy app peak."
+ }
+}
diff --git a/docs/acceptance/region-next-memory-before-2026-10-29.json b/docs/acceptance/region-next-memory-before-2026-10-29.json
new file mode 100644
index 0000000000..dc47a42569
--- /dev/null
+++ b/docs/acceptance/region-next-memory-before-2026-10-29.json
@@ -0,0 +1,143 @@
+{
+ "generatedAt": "2026-10-29T07:16:14.550Z",
+ "platform": "darwin",
+ "arch": "arm64",
+ "electron": "42.11.12",
+ "capture": [],
+ "save": [
+ {
+ "side": "before",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 99.57475,
+ 99.12449999999995,
+ 99.33020900000002,
+ 99.32824999999997,
+ 99.008959,
+ 99.357167,
+ 98.90520800000002,
+ 99.71662499999991,
+ 99.58062500000005,
+ 99.22754200000008
+ ],
+ "synchronous": [
+ 99.56900000000002,
+ 99.11899999999997,
+ 99.32654200000002,
+ 99.32324999999997,
+ 99.00433399999997,
+ 99.352125,
+ 98.90033299999993,
+ 99.71070899999995,
+ 99.57483400000001,
+ 99.22287499999993
+ ],
+ "timerDelay": [
+ 105.72587499999997,
+ 99.68399999999997,
+ 99.93995899999999,
+ 100.09837499999998,
+ 100.09775000000002,
+ 100.45037500000001,
+ 99.80920800000001,
+ 100.52258399999994,
+ 100.06295900000009,
+ 99.59916700000008
+ ],
+ "p50": 99.33020900000002,
+ "p95": 99.71662499999991,
+ "mainThread": {
+ "p50": 99.32654200000002,
+ "p95": 99.71070899999995
+ },
+ "timer": {
+ "p50": 100.09775000000002,
+ "p95": 105.72587499999997
+ },
+ "bytes": 279889
+ },
+ {
+ "side": "before",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 99.2562919999998,
+ 99.61066700000015,
+ 99.24866599999996,
+ 99.42833300000007,
+ 99.52512500000012,
+ 99.92720799999984,
+ 99.3722499999999,
+ 99.26470899999981,
+ 100.55016599999999,
+ 99.52666700000009
+ ],
+ "synchronous": [
+ 99.25191699999982,
+ 99.6065000000001,
+ 99.24433299999987,
+ 99.42395799999986,
+ 99.51729100000011,
+ 99.92283299999986,
+ 99.368291,
+ 99.26058399999988,
+ 100.54558300000008,
+ 99.52320800000007
+ ],
+ "timerDelay": [
+ 99.80887499999994,
+ 100.40704200000005,
+ 99.29887499999995,
+ 99.47291599999994,
+ 99.94295800000009,
+ 101.94799999999987,
+ 99.416291,
+ 99.30704200000014,
+ 100.59670800000004,
+ 99.57083299999977
+ ],
+ "p50": 99.52512500000012,
+ "p95": 100.55016599999999,
+ "mainThread": {
+ "p50": 99.51729100000011,
+ "p95": 100.54558300000008
+ },
+ "timer": {
+ "p50": 99.80887499999994,
+ "p95": 101.94799999999987
+ },
+ "bytes": 279889
+ }
+ ],
+ "regression": [
+ {
+ "scale": 2,
+ "alpha": 0,
+ "width": 401,
+ "height": 301,
+ "identical": true
+ },
+ {
+ "scale": 2,
+ "alpha": 127,
+ "width": 401,
+ "height": 301,
+ "identical": true
+ },
+ {
+ "scale": 1.5,
+ "alpha": 255,
+ "width": 300,
+ "height": 226,
+ "identical": true
+ }
+ ],
+ "memory": {
+ "side": "before",
+ "maximumResidentSetBytes": 776798208,
+ "scope": "macOS time -l maximum RSS of isolated Electron main process, including synthetic fixture allocations and native codec caches; not the interactive Cindy app peak."
+ }
+}
diff --git a/docs/acceptance/region-next-native-2026-10-29.json b/docs/acceptance/region-next-native-2026-10-29.json
new file mode 100644
index 0000000000..17d3bda4a8
--- /dev/null
+++ b/docs/acceptance/region-next-native-2026-10-29.json
@@ -0,0 +1,2019 @@
+{
+ "generatedAt": "2026-10-29T06:56:43.604Z",
+ "platform": "darwin",
+ "arch": "arm64",
+ "electron": "42.11.12",
+ "capture": [
+ {
+ "side": "before",
+ "mode": "gif",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 400,
+ "height": 250
+ },
+ "raw": [
+ 24.550666999999976,
+ 25.165458,
+ 24.94591700000001,
+ 23.231167000000028,
+ 22.96729099999999,
+ 23.801124999999956,
+ 23.06729100000001,
+ 23.11537500000003,
+ 23.118583,
+ 23.010166000000027,
+ 23.004500000000007,
+ 22.669707999999957,
+ 22.547249999999963,
+ 23.14783299999999,
+ 22.917124999999942,
+ 22.31045800000004,
+ 22.626582999999982,
+ 22.533750000000055,
+ 22.51754100000005,
+ 22.791000000000054,
+ 22.848208,
+ 23.04666700000007,
+ 23.066582999999923,
+ 22.901875000000018,
+ 22.656375000000025,
+ 22.60958299999993,
+ 23.29787500000009,
+ 22.371708000000012,
+ 22.65391599999998,
+ 22.449041999999963
+ ],
+ "p50": 22.96729099999999,
+ "p95": 24.94591700000001,
+ "bytes": 1600000,
+ "hash": "0666aff140e5040cab87a81eba42eb2314b0aae8b045f8964ed8270bcd44a820"
+ },
+ {
+ "side": "after",
+ "mode": "gif",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 400,
+ "height": 250
+ },
+ "raw": [
+ 23.17191700000012,
+ 22.698000000000093,
+ 22.567000000000007,
+ 22.92212500000005,
+ 22.814208000000008,
+ 22.81687500000021,
+ 22.479291999999987,
+ 22.625375000000076,
+ 22.652624999999944,
+ 22.531124999999975,
+ 22.742166000000225,
+ 22.548084000000017,
+ 22.333082999999988,
+ 22.443416999999954,
+ 22.393374999999878,
+ 22.55533300000002,
+ 22.321750000000065,
+ 22.475415999999996,
+ 22.961874999999964,
+ 22.38783400000011,
+ 22.243375000000015,
+ 22.269500000000107,
+ 22.591666000000032,
+ 22.390540999999985,
+ 22.326542000000018,
+ 22.87237499999992,
+ 22.659625000000005,
+ 22.447208000000046,
+ 22.964416999999912,
+ 22.288375000000087
+ ],
+ "p50": 22.55533300000002,
+ "p95": 22.964416999999912,
+ "bytes": 1600000,
+ "hash": "0666aff140e5040cab87a81eba42eb2314b0aae8b045f8964ed8270bcd44a820"
+ },
+ {
+ "side": "after",
+ "mode": "gif",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 400,
+ "height": 250
+ },
+ "raw": [
+ 23.069083999999975,
+ 23.173457999999982,
+ 22.744707999999946,
+ 22.719790999999987,
+ 23.08070900000007,
+ 22.986167000000023,
+ 23.24091599999997,
+ 22.78966700000001,
+ 22.832792000000154,
+ 22.513500000000022,
+ 22.444792000000007,
+ 22.614332999999988,
+ 22.627707999999984,
+ 22.587582999999995,
+ 22.655040999999983,
+ 22.70466600000009,
+ 22.31195800000023,
+ 22.370042000000012,
+ 22.348875000000135,
+ 22.27300000000014,
+ 22.414374999999836,
+ 22.43291700000009,
+ 22.614000000000033,
+ 22.334249999999884,
+ 22.22612500000014,
+ 22.457374999999956,
+ 22.404249999999593,
+ 22.249333000000206,
+ 23.103333999999904,
+ 22.55574999999999
+ ],
+ "p50": 22.614000000000033,
+ "p95": 23.173457999999982,
+ "bytes": 1600000,
+ "hash": "0666aff140e5040cab87a81eba42eb2314b0aae8b045f8964ed8270bcd44a820"
+ },
+ {
+ "side": "before",
+ "mode": "gif",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 400,
+ "height": 250
+ },
+ "raw": [
+ 22.500166999999692,
+ 22.38220799999999,
+ 22.369583000000148,
+ 22.49912499999982,
+ 22.41037499999993,
+ 22.339292000000114,
+ 24.102542000000085,
+ 22.418916999999965,
+ 22.400375000000167,
+ 22.533792000000176,
+ 22.487833000000137,
+ 22.366167000000132,
+ 22.548291999999947,
+ 22.33445900000015,
+ 22.389666999999918,
+ 22.419166000000132,
+ 22.410041000000092,
+ 22.22420800000009,
+ 22.632665999999972,
+ 22.357958000000053,
+ 22.74558300000035,
+ 22.640750000000025,
+ 22.33854199999996,
+ 22.365208999999595,
+ 22.37004100000013,
+ 22.56929100000025,
+ 22.56270799999993,
+ 22.62995899999987,
+ 22.33874999999989,
+ 22.462083000000348
+ ],
+ "p50": 22.418916999999965,
+ "p95": 22.74558300000035,
+ "bytes": 1600000,
+ "hash": "0666aff140e5040cab87a81eba42eb2314b0aae8b045f8964ed8270bcd44a820"
+ },
+ {
+ "side": "before",
+ "mode": "video",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 960,
+ "height": 540
+ },
+ "raw": [
+ 23.2778330000001,
+ 24.477542000000085,
+ 23.468166999999994,
+ 23.50654200000008,
+ 23.809666000000107,
+ 23.423749999999927,
+ 23.55895899999996,
+ 23.722249999999804,
+ 23.400249999999687,
+ 23.388084000000163,
+ 23.80666700000029,
+ 23.25504200000023,
+ 23.416625000000295,
+ 23.967083999999886,
+ 23.510999999999967,
+ 23.660459000000174,
+ 23.461209000000053,
+ 23.380499999999756,
+ 24.236582999999882,
+ 23.414999999999964,
+ 23.274417000000085,
+ 23.377709000000323,
+ 23.525458999999955,
+ 23.167582999999922,
+ 23.245916999999736,
+ 23.299167000000125,
+ 24.01449999999977,
+ 23.562417000000096,
+ 23.65008399999988,
+ 23.42995800000017
+ ],
+ "p50": 23.468166999999994,
+ "p95": 24.236582999999882,
+ "bytes": 8294400,
+ "hash": "b4f3d654edf9e054b3088ccebe077c1d91e446852d4442c0c1e509fda86b6c39"
+ },
+ {
+ "side": "after",
+ "mode": "video",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 960,
+ "height": 540
+ },
+ "raw": [
+ 24.60833300000013,
+ 24.175040999999965,
+ 24.37079199999971,
+ 24.64258300000074,
+ 24.06366699999944,
+ 24.360625000000255,
+ 24.309374999999818,
+ 23.938458999999966,
+ 24.63208399999985,
+ 24.068207999999686,
+ 24.425750000000335,
+ 24.074291999999332,
+ 24.245750000000044,
+ 24.184916000000158,
+ 24.431000000000495,
+ 24.293791000000056,
+ 24.06800000000021,
+ 24.085250000000087,
+ 24.30591699999968,
+ 24.352499999999964,
+ 23.98149999999987,
+ 24.299917000000278,
+ 24.374542000000474,
+ 24.41620800000055,
+ 24.435958000000028,
+ 24.336209000000053,
+ 24.198457999999846,
+ 23.88299999999981,
+ 24.306500000000597,
+ 24.40416600000026
+ ],
+ "p50": 24.306500000000597,
+ "p95": 24.63208399999985,
+ "bytes": 8294400,
+ "hash": "b4f3d654edf9e054b3088ccebe077c1d91e446852d4442c0c1e509fda86b6c39"
+ },
+ {
+ "side": "after",
+ "mode": "video",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 960,
+ "height": 540
+ },
+ "raw": [
+ 23.983124999999745,
+ 24.115375000000313,
+ 24.310625000000073,
+ 24.454792000000452,
+ 24.098792000000685,
+ 24.794458999999733,
+ 24.09149999999954,
+ 24.217625000000226,
+ 24.246000000000095,
+ 24.230916000000434,
+ 24.27229200000056,
+ 23.975334000000657,
+ 24.286707999999635,
+ 24.04658399999971,
+ 24.49304099999972,
+ 24.131499999999505,
+ 24.858916999999565,
+ 23.835167000000183,
+ 24.53650000000016,
+ 24.13683300000048,
+ 24.190999999999804,
+ 24.198583000000326,
+ 23.93841599999996,
+ 24.22099999999955,
+ 24.552999999999884,
+ 24.203875000000153,
+ 24.14100000000053,
+ 24.402374999999665,
+ 23.94483400000081,
+ 24.065207999999984
+ ],
+ "p50": 24.203875000000153,
+ "p95": 24.794458999999733,
+ "bytes": 8294400,
+ "hash": "b4f3d654edf9e054b3088ccebe077c1d91e446852d4442c0c1e509fda86b6c39"
+ },
+ {
+ "side": "before",
+ "mode": "video",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 960,
+ "height": 540
+ },
+ "raw": [
+ 25.954082999999628,
+ 25.88195799999994,
+ 25.903542000000016,
+ 26.528041999999914,
+ 25.88745800000015,
+ 26.08729200000016,
+ 26.195999999999913,
+ 26.14354099999946,
+ 26.002665999999408,
+ 26.40270799999962,
+ 26.531708000000435,
+ 25.952500000000327,
+ 25.890832999999475,
+ 26.001334000000497,
+ 25.944916999999805,
+ 25.91645900000003,
+ 25.9990829999997,
+ 26.392165999999634,
+ 26.185209000000214,
+ 26.14862499999981,
+ 25.831207999999606,
+ 25.779250000000502,
+ 25.877291000000696,
+ 25.79699999999957,
+ 25.73199999999997,
+ 25.857708999999886,
+ 26.191375000000335,
+ 25.865999999999985,
+ 26.49054200000046,
+ 26.160791999999674
+ ],
+ "p50": 25.9990829999997,
+ "p95": 26.528041999999914,
+ "bytes": 8294400,
+ "hash": "b4f3d654edf9e054b3088ccebe077c1d91e446852d4442c0c1e509fda86b6c39"
+ },
+ {
+ "side": "before",
+ "mode": "scroll",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 1600,
+ "height": 1000
+ },
+ "raw": [
+ 4.5402500000000146,
+ 4.226458000000093,
+ 4.253292000000329,
+ 4.339874999999665,
+ 4.552541999999448,
+ 4.220666000000165,
+ 4.634791999999834,
+ 4.496667000000343,
+ 4.355207999999948,
+ 4.203000000000429,
+ 4.246708000000581,
+ 4.545082999999977,
+ 4.313124999999673,
+ 4.244124999999258,
+ 4.335708000000523,
+ 4.591374999999971,
+ 4.240874999999505,
+ 4.1632079999999405,
+ 4.308207999999468,
+ 4.424542000000656,
+ 4.3377080000000205,
+ 4.187915999999859,
+ 4.53570899999977,
+ 4.347000000000662,
+ 4.362958000000617,
+ 4.227082999999766,
+ 4.400958000000173,
+ 4.702792000000045,
+ 4.359790999999859,
+ 4.207000000000335
+ ],
+ "p50": 4.339874999999665,
+ "p95": 4.634791999999834,
+ "bytes": 25600000,
+ "hash": "dc6dac90d9e198ac6486f5a7fa66d17995852216cb6b10c3eb221f9fd238f757"
+ },
+ {
+ "side": "after",
+ "mode": "scroll",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 1600,
+ "height": 1000
+ },
+ "raw": [
+ 1.5737499999995634,
+ 2.0820409999996627,
+ 2.1084579999997004,
+ 2.0004589999998643,
+ 1.83849999999984,
+ 1.9327920000005179,
+ 2.035041000000092,
+ 1.9862910000001648,
+ 2.012374999999338,
+ 1.9547080000002097,
+ 2.0330000000003565,
+ 1.967583999999988,
+ 1.8944579999997586,
+ 1.886583999999857,
+ 1.8959580000000642,
+ 1.8430829999997513,
+ 1.9066659999998592,
+ 1.9525000000003274,
+ 2.023041999999805,
+ 2.0180830000008427,
+ 1.9199579999994967,
+ 1.9778329999999187,
+ 2.038249999999607,
+ 1.9135829999995622,
+ 2.0287909999997282,
+ 1.951042000000598,
+ 1.9408750000002328,
+ 2.1710000000002765,
+ 1.9724169999999503,
+ 1.953958000000057
+ ],
+ "p50": 1.967583999999988,
+ "p95": 2.1084579999997004,
+ "bytes": 25600000,
+ "hash": "dc6dac90d9e198ac6486f5a7fa66d17995852216cb6b10c3eb221f9fd238f757"
+ },
+ {
+ "side": "after",
+ "mode": "scroll",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 1600,
+ "height": 1000
+ },
+ "raw": [
+ 2.5073339999999007,
+ 1.6700420000006488,
+ 2.5704580000001442,
+ 1.6991250000000946,
+ 2.7036669999997684,
+ 1.8166250000003856,
+ 2.473750000000109,
+ 1.6033339999994496,
+ 2.6014160000004267,
+ 1.6792910000003758,
+ 2.5764579999995476,
+ 1.702209000000039,
+ 2.893333999999413,
+ 1.739292000000205,
+ 2.4587090000004537,
+ 1.604707999999846,
+ 2.520375000000058,
+ 1.74474999999984,
+ 2.519583000000239,
+ 1.6737080000002607,
+ 2.820582999999715,
+ 1.641540999999961,
+ 2.5447080000003552,
+ 1.6325419999993755,
+ 2.4649590000008175,
+ 1.715832999999293,
+ 2.66399999999976,
+ 1.7006250000004002,
+ 2.7640000000001237,
+ 1.7294999999994616
+ ],
+ "p50": 2.4587090000004537,
+ "p95": 2.820582999999715,
+ "bytes": 25600000,
+ "hash": "dc6dac90d9e198ac6486f5a7fa66d17995852216cb6b10c3eb221f9fd238f757"
+ },
+ {
+ "side": "before",
+ "mode": "scroll",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 1600,
+ "height": 1000
+ },
+ "raw": [
+ 4.459457999999358,
+ 4.271082999999635,
+ 4.178874999999607,
+ 4.311083999999937,
+ 4.442500000000109,
+ 4.239790999999968,
+ 4.08020900000065,
+ 4.249416999999994,
+ 4.355499999999665,
+ 4.318083000000115,
+ 4.17108399999961,
+ 4.351208999999471,
+ 4.397291999999652,
+ 4.24054200000046,
+ 4.158916999999747,
+ 4.40679099999943,
+ 4.462709000000359,
+ 4.226125000000138,
+ 4.149000000000342,
+ 4.4016249999995125,
+ 4.444582999999511,
+ 4.269333000000188,
+ 4.166916000000128,
+ 4.197124999999687,
+ 4.563791999999921,
+ 4.389415999999983,
+ 3.871791999999914,
+ 4.10004200000003,
+ 4.26549999999952,
+ 4.005833999999595
+ ],
+ "p50": 4.269333000000188,
+ "p95": 4.462709000000359,
+ "bytes": 25600000,
+ "hash": "dc6dac90d9e198ac6486f5a7fa66d17995852216cb6b10c3eb221f9fd238f757"
+ },
+ {
+ "side": "before",
+ "mode": "gif",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 1200,
+ "height": 800
+ },
+ "raw": [
+ 28.698459000000184,
+ 28.84270800000013,
+ 28.82220799999959,
+ 29.113542000000052,
+ 28.914750000000822,
+ 29.316415999999663,
+ 28.884541000000354,
+ 28.932416999999987,
+ 28.642667000000074,
+ 28.77112500000021,
+ 28.78429099999994,
+ 28.99737499999992,
+ 28.833458000000064,
+ 28.506665999999313,
+ 28.856582999999773,
+ 28.783416999999645,
+ 28.784375000000182,
+ 28.851541999999426,
+ 28.66258299999936,
+ 29.41991700000017,
+ 30.30095799999981,
+ 29.25404200000048,
+ 28.85375000000022,
+ 28.991958000000523,
+ 28.727374999999483,
+ 28.919541999999637,
+ 29.293666999999914,
+ 28.787457999999788,
+ 28.74670900000001,
+ 28.733791999999994
+ ],
+ "p50": 28.851541999999426,
+ "p95": 29.41991700000017,
+ "bytes": 2457600,
+ "hash": "707f4291210f75999e1565582c6144a6fce5dd4c3e6631b4587c8280e2714c15"
+ },
+ {
+ "side": "after",
+ "mode": "gif",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 1200,
+ "height": 800
+ },
+ "raw": [
+ 29.06420800000069,
+ 28.514165999999932,
+ 28.495375000000422,
+ 28.799791999999798,
+ 29.98424999999952,
+ 31.924708000000464,
+ 31.129915999999866,
+ 28.78112500000043,
+ 28.60200000000077,
+ 28.73841700000048,
+ 29.39075000000048,
+ 28.667333999999755,
+ 28.816791999999623,
+ 29.705917000001136,
+ 29.437416999999186,
+ 30.2534169999999,
+ 28.856125000000247,
+ 28.654333000000406,
+ 28.914875000000393,
+ 28.60320800000045,
+ 28.54662499999904,
+ 28.97700000000077,
+ 28.696415999998862,
+ 28.993583999999828,
+ 29.185625000000073,
+ 29.664582999999766,
+ 30.16554200000064,
+ 30.335917000000336,
+ 30.118083000001207,
+ 30.047166999998808
+ ],
+ "p50": 28.993583999999828,
+ "p95": 31.129915999999866,
+ "bytes": 2457600,
+ "hash": "707f4291210f75999e1565582c6144a6fce5dd4c3e6631b4587c8280e2714c15"
+ },
+ {
+ "side": "after",
+ "mode": "gif",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 1200,
+ "height": 800
+ },
+ "raw": [
+ 29.585375000000568,
+ 29.085666999999376,
+ 29.284958999998707,
+ 29.319250000000466,
+ 29.67895800000042,
+ 29.019249999999374,
+ 29.493915999999444,
+ 30.18487499999901,
+ 29.67383400000108,
+ 30.052041999999346,
+ 29.978957999999693,
+ 29.836083000000144,
+ 29.66741700000057,
+ 29.714875000001484,
+ 29.6650410000002,
+ 29.726582999999664,
+ 29.581958000000668,
+ 29.535125000000335,
+ 29.99983400000019,
+ 28.812041999999565,
+ 29.02074999999968,
+ 31.640708000000814,
+ 29.322833000000173,
+ 30.436875000001237,
+ 30.092749999999796,
+ 30.429583999999522,
+ 29.804583000001003,
+ 29.79004200000054,
+ 30.6179170000014,
+ 30.074249999999665
+ ],
+ "p50": 29.714875000001484,
+ "p95": 30.6179170000014,
+ "bytes": 2457600,
+ "hash": "707f4291210f75999e1565582c6144a6fce5dd4c3e6631b4587c8280e2714c15"
+ },
+ {
+ "side": "before",
+ "mode": "gif",
+ "selection": {
+ "x": 13,
+ "y": 17,
+ "width": 1200,
+ "height": 800
+ },
+ "raw": [
+ 29.597125000000233,
+ 30.033957999999984,
+ 30.279459000001225,
+ 30.111166999999114,
+ 30.213792000000467,
+ 30.440209000000323,
+ 31.780416999999943,
+ 30.33970799999952,
+ 30.278042000001733,
+ 30.141791000000012,
+ 31.34074999999939,
+ 31.292375000000902,
+ 29.924584000000323,
+ 31.569916000000376,
+ 31.60900000000038,
+ 362.45124999999825,
+ 173.67441599999984,
+ 32.14704200000051,
+ 32.563083000000915,
+ 556.1347499999993,
+ 42.32808300000033,
+ 31.85479200000009,
+ 30.482750000001033,
+ 30.821415999998862,
+ 30.04425000000083,
+ 30.542459000000235,
+ 30.191749999999956,
+ 30.841333000000304,
+ 30.413665999998557,
+ 30.453165999999328
+ ],
+ "p50": 30.542459000000235,
+ "p95": 362.45124999999825,
+ "bytes": 2457600,
+ "hash": "707f4291210f75999e1565582c6144a6fce5dd4c3e6631b4587c8280e2714c15"
+ }
+ ],
+ "save": [
+ {
+ "side": "before",
+ "width": 1920,
+ "height": 1080,
+ "format": "png",
+ "raw": [
+ 16.04362499999843,
+ 13.150374999999258,
+ 12.812708999999813,
+ 12.846457999999984,
+ 12.803207999999358,
+ 12.77874999999949,
+ 12.758416999999099,
+ 12.70616599999994,
+ 12.992874999999913,
+ 12.924082999999882
+ ],
+ "synchronous": [
+ 16.03179199999977,
+ 13.146999999999025,
+ 12.809375000000728,
+ 12.844499999999243,
+ 12.801332999999431,
+ 12.777166999998371,
+ 12.756917000000612,
+ 12.705082999998922,
+ 12.988333999999668,
+ 12.921082999999271
+ ],
+ "timerDelay": [
+ 50.198458999999275,
+ 321.00116700000035,
+ 13.866167000000132,
+ 12.916708000000654,
+ 13.155582999999751,
+ 12.82774999999856,
+ 12.785874999999578,
+ 12.734415999999328,
+ 13.040416999998342,
+ 12.95995799999946
+ ],
+ "p50": 12.846457999999984,
+ "p95": 16.04362499999843,
+ "mainThread": {
+ "p50": 12.844499999999243,
+ "p95": 16.03179199999977
+ },
+ "timer": {
+ "p50": 13.040416999998342,
+ "p95": 321.00116700000035
+ },
+ "bytes": 35922
+ },
+ {
+ "side": "after",
+ "width": 1920,
+ "height": 1080,
+ "format": "png",
+ "raw": [
+ 92.6807090000002,
+ 43.84712500000023,
+ 43.37866699999904,
+ 43.9926660000001,
+ 44.14045799999985,
+ 43.74879200000032,
+ 45.7354579999992,
+ 45.63520900000003,
+ 39.97504100000151,
+ 39.72820799999863
+ ],
+ "synchronous": [
+ 17.48149999999987,
+ 11.589208999999755,
+ 11.186292000000321,
+ 11.431500000000597,
+ 11.280124999999316,
+ 11.302834000000075,
+ 13.4234579999993,
+ 13.295334000000366,
+ 7.717625000001135,
+ 7.7650419999990845
+ ],
+ "timerDelay": [
+ 61.27545900000041,
+ 11.712625000000116,
+ 11.347208999999566,
+ 11.548416000001453,
+ 11.405375000000276,
+ 11.45508399999926,
+ 13.60045799999898,
+ 13.468834000001152,
+ 7.846416000000318,
+ 7.884207999999489
+ ],
+ "p50": 43.9926660000001,
+ "p95": 92.6807090000002,
+ "mainThread": {
+ "p50": 11.431500000000597,
+ "p95": 17.48149999999987
+ },
+ "timer": {
+ "p50": 11.548416000001453,
+ "p95": 61.27545900000041
+ },
+ "bytes": 2590883
+ },
+ {
+ "side": "after",
+ "width": 1920,
+ "height": 1080,
+ "format": "png",
+ "raw": [
+ 40.67120799999975,
+ 39.992707999999766,
+ 40.049957999999606,
+ 40.53666599999997,
+ 39.92775000000074,
+ 41.42533299999923,
+ 41.22687500000029,
+ 40.09179199999926,
+ 41.45087499999863,
+ 50.104333000001134
+ ],
+ "synchronous": [
+ 8.18329199999971,
+ 7.80724999999984,
+ 7.759374999999636,
+ 7.7957079999996495,
+ 7.834917000000132,
+ 9.19512500000019,
+ 7.735791999999492,
+ 7.809708999999202,
+ 7.948499999998603,
+ 8.691875000000437
+ ],
+ "timerDelay": [
+ 8.336375000000771,
+ 7.931416999999783,
+ 7.916457999999693,
+ 8.040375000000495,
+ 7.981584000001021,
+ 9.688292000000729,
+ 7.864458000000013,
+ 8.341458999999304,
+ 8.117541999999958,
+ 9.710708000000523
+ ],
+ "p50": 40.67120799999975,
+ "p95": 50.104333000001134,
+ "mainThread": {
+ "p50": 7.834917000000132,
+ "p95": 9.19512500000019
+ },
+ "timer": {
+ "p50": 8.117541999999958,
+ "p95": 9.710708000000523
+ },
+ "bytes": 2590883
+ },
+ {
+ "side": "before",
+ "width": 1920,
+ "height": 1080,
+ "format": "png",
+ "raw": [
+ 13.000833000000057,
+ 12.904458000000886,
+ 13.12079200000153,
+ 13.035334000000148,
+ 12.944041999999172,
+ 12.929374999999709,
+ 12.985749999999825,
+ 12.969124999999622,
+ 12.93683400000009,
+ 12.957500000000437
+ ],
+ "synchronous": [
+ 12.99633299999914,
+ 12.899999999999636,
+ 13.117417000001296,
+ 13.029500000000553,
+ 12.93816699999843,
+ 12.926041000000623,
+ 12.98162500000035,
+ 12.965415999999095,
+ 12.932584000000134,
+ 12.953208999999333
+ ],
+ "timerDelay": [
+ 13.03558300000077,
+ 12.954750000000786,
+ 13.3874590000014,
+ 13.09491700000035,
+ 13.371749999998428,
+ 12.969375000000582,
+ 13.642208999999639,
+ 13.003082999999606,
+ 12.972499999999854,
+ 12.99212500000067
+ ],
+ "p50": 12.969124999999622,
+ "p95": 13.12079200000153,
+ "mainThread": {
+ "p50": 12.965415999999095,
+ "p95": 13.117417000001296
+ },
+ "timer": {
+ "p50": 13.03558300000077,
+ "p95": 13.642208999999639
+ },
+ "bytes": 35922
+ },
+ {
+ "side": "before",
+ "width": 1920,
+ "height": 1080,
+ "format": "jpeg",
+ "raw": [
+ 4.382958000000144,
+ 4.484624999999141,
+ 4.554249999999229,
+ 4.443208999999115,
+ 4.477084000000104,
+ 4.283833000001323,
+ 4.2378329999992275,
+ 4.349417000001267,
+ 5.227499999999054,
+ 5.138667000001078
+ ],
+ "synchronous": [
+ 4.38012499999968,
+ 4.479208999999173,
+ 4.549124999999549,
+ 4.440333999998984,
+ 4.473583999999391,
+ 4.282333000001017,
+ 4.236208000000261,
+ 4.348042000001442,
+ 5.22454099999959,
+ 5.135874999999942
+ ],
+ "timerDelay": [
+ 4.438207999999577,
+ 4.534583999999086,
+ 4.592208000000028,
+ 4.473291999998764,
+ 4.870374999998603,
+ 5.470541000000594,
+ 4.261457999999038,
+ 4.387125000001106,
+ 5.287707999999839,
+ 5.175167000001238
+ ],
+ "p50": 4.477084000000104,
+ "p95": 5.227499999999054,
+ "mainThread": {
+ "p50": 4.473583999999391,
+ "p95": 5.22454099999959
+ },
+ "timer": {
+ "p50": 4.592208000000028,
+ "p95": 5.470541000000594
+ },
+ "bytes": 359127
+ },
+ {
+ "side": "after",
+ "width": 1920,
+ "height": 1080,
+ "format": "jpeg",
+ "raw": [
+ 4.653207999999722,
+ 4.581624999998894,
+ 4.579417000000831,
+ 4.550750000000335,
+ 4.509874999999738,
+ 4.4872919999997976,
+ 4.48858300000029,
+ 4.6189159999994445,
+ 4.574083999999857,
+ 4.5761250000014115
+ ],
+ "synchronous": [
+ 4.650666000001365,
+ 4.579874999999447,
+ 4.578333999999813,
+ 4.5494999999991705,
+ 4.508250000000771,
+ 4.486625000001368,
+ 4.487957999999708,
+ 4.617000000000189,
+ 4.573083999999653,
+ 4.5749590000013995
+ ],
+ "timerDelay": [
+ 4.699708000000101,
+ 4.605541999999332,
+ 4.59229200000118,
+ 4.5711670000000595,
+ 4.535916999999245,
+ 4.503292000001238,
+ 4.504750000000058,
+ 4.661665999999968,
+ 4.615917000000991,
+ 4.624250000000757
+ ],
+ "p50": 4.5761250000014115,
+ "p95": 4.653207999999722,
+ "mainThread": {
+ "p50": 4.5749590000013995,
+ "p95": 4.650666000001365
+ },
+ "timer": {
+ "p50": 4.605541999999332,
+ "p95": 4.699708000000101
+ },
+ "bytes": 359127
+ },
+ {
+ "side": "after",
+ "width": 1920,
+ "height": 1080,
+ "format": "jpeg",
+ "raw": [
+ 4.622875000000931,
+ 4.698624999999083,
+ 4.658374999999069,
+ 4.995124999999462,
+ 4.554000000000087,
+ 4.652833000000101,
+ 4.702124999999796,
+ 4.640041000000565,
+ 4.450917000000118,
+ 4.70337500000096
+ ],
+ "synchronous": [
+ 4.6200000000008,
+ 4.697041999999783,
+ 4.657333999999537,
+ 4.992874999999913,
+ 4.55254099999911,
+ 4.649916000000303,
+ 4.700708000000304,
+ 4.63879100000122,
+ 4.449249999999665,
+ 4.701833000000988
+ ],
+ "timerDelay": [
+ 5.081125000000611,
+ 6.126374999999825,
+ 4.7089169999999285,
+ 5.051583000000392,
+ 4.604416000000128,
+ 4.703541000000769,
+ 4.751125000000684,
+ 4.687832999999955,
+ 4.499667000000045,
+ 4.760000000000218
+ ],
+ "p50": 4.658374999999069,
+ "p95": 4.995124999999462,
+ "mainThread": {
+ "p50": 4.657333999999537,
+ "p95": 4.992874999999913
+ },
+ "timer": {
+ "p50": 4.751125000000684,
+ "p95": 6.126374999999825
+ },
+ "bytes": 359127
+ },
+ {
+ "side": "before",
+ "width": 1920,
+ "height": 1080,
+ "format": "jpeg",
+ "raw": [
+ 4.68395799999962,
+ 4.690582999999606,
+ 4.522500000000946,
+ 4.632458000000042,
+ 4.731959000000643,
+ 4.634208999999828,
+ 4.599374999999782,
+ 4.564249999999447,
+ 4.54729099999895,
+ 4.516667000001689
+ ],
+ "synchronous": [
+ 4.680499999998574,
+ 4.68804099999943,
+ 4.520458999999391,
+ 4.629917000000205,
+ 4.729792000000089,
+ 4.632625000000189,
+ 4.598124999998618,
+ 4.561792000000423,
+ 4.545665999999983,
+ 4.514209000000847
+ ],
+ "timerDelay": [
+ 4.756249999998545,
+ 4.748915999998644,
+ 4.569333999999799,
+ 4.672207999999955,
+ 4.78058400000009,
+ 4.674584000000323,
+ 4.6475829999999405,
+ 4.613292000000001,
+ 4.594499999999243,
+ 4.556792000001224
+ ],
+ "p50": 4.632458000000042,
+ "p95": 4.731959000000643,
+ "mainThread": {
+ "p50": 4.629917000000205,
+ "p95": 4.729792000000089
+ },
+ "timer": {
+ "p50": 4.672207999999955,
+ "p95": 4.78058400000009
+ },
+ "bytes": 359127
+ },
+ {
+ "side": "before",
+ "width": 3840,
+ "height": 2160,
+ "format": "png",
+ "raw": [
+ 55.352333000000726,
+ 54.18274999999994,
+ 53.88474999999926,
+ 53.957042,
+ 53.287374999999884,
+ 50.93433399999958,
+ 50.4106670000001,
+ 50.34045799999876,
+ 50.54437499999949,
+ 50.449000000000524
+ ],
+ "synchronous": [
+ 55.337625000000116,
+ 54.17670800000087,
+ 53.87958299999991,
+ 53.9520420000008,
+ 53.28258300000016,
+ 50.930459000001065,
+ 50.406042000000525,
+ 50.33604099999866,
+ 50.539457999999286,
+ 50.44445799999994
+ ],
+ "timerDelay": [
+ 55.81116699999984,
+ 55.915250000000015,
+ 54.342749999999796,
+ 54.724874999999884,
+ 53.91216700000041,
+ 51.423500000000786,
+ 50.76579200000015,
+ 50.73829099999966,
+ 51.53266699999949,
+ 51.5513749999991
+ ],
+ "p50": 53.287374999999884,
+ "p95": 55.352333000000726,
+ "mainThread": {
+ "p50": 53.28258300000016,
+ "p95": 55.337625000000116
+ },
+ "timer": {
+ "p50": 53.91216700000041,
+ "p95": 55.915250000000015
+ },
+ "bytes": 141572
+ },
+ {
+ "side": "after",
+ "width": 3840,
+ "height": 2160,
+ "format": "png",
+ "raw": [
+ 172.17895800000042,
+ 178.4083750000009,
+ 158.4595420000005,
+ 158.33083400000032,
+ 160.59120900000016,
+ 156.39987500000097,
+ 158.51637499999924,
+ 156.28983300000073,
+ 157.59775000000081,
+ 156.08816599999955
+ ],
+ "synchronous": [
+ 45.73420800000167,
+ 51.79704099999981,
+ 31.92516699999942,
+ 30.834875000000466,
+ 34.693749999998545,
+ 31.036792000000787,
+ 33.09649999999965,
+ 30.657375000000684,
+ 31.656958000001396,
+ 30.551916000000347
+ ],
+ "timerDelay": [
+ 46.797875000000204,
+ 51.96116600000096,
+ 32.05566700000054,
+ 30.993209000000206,
+ 34.8310419999998,
+ 31.15716700000121,
+ 33.21704200000022,
+ 30.776208000001134,
+ 31.777541000001293,
+ 30.695874999999432
+ ],
+ "p50": 158.4595420000005,
+ "p95": 178.4083750000009,
+ "mainThread": {
+ "p50": 31.92516699999942,
+ "p95": 51.79704099999981
+ },
+ "timer": {
+ "p50": 32.05566700000054,
+ "p95": 51.96116600000096
+ },
+ "bytes": 10398933
+ },
+ {
+ "side": "after",
+ "width": 3840,
+ "height": 2160,
+ "format": "png",
+ "raw": [
+ 159.24683300000106,
+ 158.43995899999936,
+ 159.3042919999989,
+ 157.84120900000198,
+ 159.4910830000008,
+ 156.71291700000074,
+ 160.65474999999788,
+ 158.03662500000064,
+ 158.71945899999992,
+ 156.5712910000002
+ ],
+ "synchronous": [
+ 32.88904100000036,
+ 30.739666999999827,
+ 33.06487500000003,
+ 31.221208999999362,
+ 33.01512500000172,
+ 31.62470899999971,
+ 33.43566599999758,
+ 31.441209000000526,
+ 33.39537500000006,
+ 31.211166000000958
+ ],
+ "timerDelay": [
+ 33.02879100000064,
+ 30.856250000000728,
+ 33.18041699999958,
+ 31.33520900000076,
+ 33.144625000000815,
+ 31.75037499999962,
+ 33.56370799999786,
+ 31.55858399999852,
+ 33.51966700000048,
+ 31.329665999997815
+ ],
+ "p50": 158.71945899999992,
+ "p95": 160.65474999999788,
+ "mainThread": {
+ "p50": 32.88904100000036,
+ "p95": 33.43566599999758
+ },
+ "timer": {
+ "p50": 33.02879100000064,
+ "p95": 33.56370799999786
+ },
+ "bytes": 10398933
+ },
+ {
+ "side": "before",
+ "width": 3840,
+ "height": 2160,
+ "format": "png",
+ "raw": [
+ 50.94220899999709,
+ 50.79570900000181,
+ 51.047999999998865,
+ 50.62162499999977,
+ 50.794042000001355,
+ 50.541292000001704,
+ 51.467625000001135,
+ 50.81175000000076,
+ 51.1296250000014,
+ 50.776582999998936
+ ],
+ "synchronous": [
+ 50.93762499999866,
+ 50.78950000000259,
+ 51.044042000001355,
+ 50.61779200000092,
+ 50.790750000000116,
+ 50.53850000000239,
+ 51.46362500000032,
+ 50.80895800000144,
+ 51.12554200000159,
+ 50.77379099999962
+ ],
+ "timerDelay": [
+ 50.990624999998545,
+ 51.19733400000041,
+ 52.27629199999865,
+ 50.65625,
+ 50.82287499999802,
+ 50.573583000001236,
+ 51.504541000002064,
+ 50.84808300000077,
+ 51.1651669999992,
+ 50.80774999999994
+ ],
+ "p50": 50.81175000000076,
+ "p95": 51.467625000001135,
+ "mainThread": {
+ "p50": 50.80895800000144,
+ "p95": 51.46362500000032
+ },
+ "timer": {
+ "p50": 50.990624999998545,
+ "p95": 52.27629199999865
+ },
+ "bytes": 141572
+ },
+ {
+ "side": "before",
+ "width": 3840,
+ "height": 2160,
+ "format": "jpeg",
+ "raw": [
+ 18.88970899999913,
+ 18.509540999999444,
+ 17.460707999998704,
+ 17.440417000001617,
+ 17.337791999998444,
+ 18.149666999997862,
+ 18.12487500000134,
+ 17.91491600000154,
+ 18.03704099999959,
+ 18.258750000000873
+ ],
+ "synchronous": [
+ 18.88483400000041,
+ 18.506750000000466,
+ 17.457875000000058,
+ 17.43733400000201,
+ 17.331874999999854,
+ 18.145916999998008,
+ 18.122583000000304,
+ 17.91204099999959,
+ 18.03458299999693,
+ 18.256584000002476
+ ],
+ "timerDelay": [
+ 18.9520420000008,
+ 18.93345799999952,
+ 20.568083000001934,
+ 17.47595899999942,
+ 17.378874999998516,
+ 18.185624999998254,
+ 18.148708000000624,
+ 17.947958000000654,
+ 18.063207999999577,
+ 18.28516700000182
+ ],
+ "p50": 18.12487500000134,
+ "p95": 18.88970899999913,
+ "mainThread": {
+ "p50": 18.122583000000304,
+ "p95": 18.88483400000041
+ },
+ "timer": {
+ "p50": 18.185624999998254,
+ "p95": 20.568083000001934
+ },
+ "bytes": 1643861
+ },
+ {
+ "side": "after",
+ "width": 3840,
+ "height": 2160,
+ "format": "jpeg",
+ "raw": [
+ 18.064916999999696,
+ 18.167499999999563,
+ 18.247583000000304,
+ 18.119957999999315,
+ 18.09887499999968,
+ 17.95483299999978,
+ 18.132125000000087,
+ 18.04937500000233,
+ 17.561916999999085,
+ 17.738750000000437
+ ],
+ "synchronous": [
+ 18.062958999998955,
+ 18.16545799999949,
+ 18.24554200000057,
+ 18.1182919999992,
+ 18.09654099999898,
+ 17.953332999997656,
+ 18.12970800000039,
+ 18.047708000001876,
+ 17.559292000001733,
+ 17.737832999999227
+ ],
+ "timerDelay": [
+ 18.10529200000019,
+ 18.19550000000163,
+ 18.27599999999802,
+ 18.14441699999952,
+ 18.13079099999959,
+ 17.988290999997844,
+ 18.507166999999754,
+ 22.210750000002008,
+ 17.59545900000012,
+ 17.776165999999648
+ ],
+ "p50": 18.09887499999968,
+ "p95": 18.247583000000304,
+ "mainThread": {
+ "p50": 18.09654099999898,
+ "p95": 18.24554200000057
+ },
+ "timer": {
+ "p50": 18.14441699999952,
+ "p95": 22.210750000002008
+ },
+ "bytes": 1643861
+ },
+ {
+ "side": "after",
+ "width": 3840,
+ "height": 2160,
+ "format": "jpeg",
+ "raw": [
+ 18.09375,
+ 18.05437499999971,
+ 19.512332999998762,
+ 18.422500000000582,
+ 18.36695800000234,
+ 18.06879100000151,
+ 18.15362499999901,
+ 18.08220799999981,
+ 18.967290999997203,
+ 18.285542000001442
+ ],
+ "synchronous": [
+ 18.09233399999721,
+ 18.052625000000262,
+ 19.509957999998733,
+ 18.420500000000175,
+ 18.36516699999993,
+ 18.067290999999386,
+ 18.152000000001863,
+ 18.08062499999869,
+ 18.96483299999818,
+ 18.284292000000278
+ ],
+ "timerDelay": [
+ 18.146583999998256,
+ 18.082624999999098,
+ 19.546582999999373,
+ 18.455792000000656,
+ 18.39812499999971,
+ 18.100500000000466,
+ 18.180583000001207,
+ 18.117541999999958,
+ 19.000625000000582,
+ 18.313834000000497
+ ],
+ "p50": 18.285542000001442,
+ "p95": 19.512332999998762,
+ "mainThread": {
+ "p50": 18.284292000000278,
+ "p95": 19.509957999998733
+ },
+ "timer": {
+ "p50": 18.313834000000497,
+ "p95": 19.546582999999373
+ },
+ "bytes": 1643861
+ },
+ {
+ "side": "before",
+ "width": 3840,
+ "height": 2160,
+ "format": "jpeg",
+ "raw": [
+ 18.071125000002212,
+ 18.13537500000166,
+ 17.82708300000013,
+ 17.982584000001225,
+ 18.023708000000624,
+ 17.883624999998574,
+ 19.24841699999888,
+ 18.453874999999243,
+ 18.140042000002722,
+ 18.442583000000013
+ ],
+ "synchronous": [
+ 18.068583000000217,
+ 18.132958000001963,
+ 17.823833000002196,
+ 17.98054200000115,
+ 18.020667000000685,
+ 17.880832999999257,
+ 19.24529199999961,
+ 18.448457999998936,
+ 18.137375000002066,
+ 18.439166000000114
+ ],
+ "timerDelay": [
+ 18.110625000001164,
+ 18.163875000002008,
+ 17.876125000002503,
+ 18.017917000001034,
+ 18.054167000002053,
+ 17.909583000000566,
+ 19.497292000000016,
+ 18.508458000000246,
+ 18.213958000000275,
+ 18.82537500000035
+ ],
+ "p50": 18.13537500000166,
+ "p95": 19.24841699999888,
+ "mainThread": {
+ "p50": 18.132958000001963,
+ "p95": 19.24529199999961
+ },
+ "timer": {
+ "p50": 18.163875000002008,
+ "p95": 19.497292000000016
+ },
+ "bytes": 1643861
+ },
+ {
+ "side": "before",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 100.05741699999999,
+ 101.02799999999843,
+ 99.24916699999812,
+ 100.3314999999966,
+ 100.66545899999983,
+ 99.24804199999926,
+ 100.20016699999906,
+ 100.31300000000192,
+ 100.6284169999999,
+ 100.91112499999872
+ ],
+ "synchronous": [
+ 100.04012499999953,
+ 101.02387499999895,
+ 99.24470799999835,
+ 100.32670799999687,
+ 100.65983399999823,
+ 99.24337500000183,
+ 100.19495900000038,
+ 100.30770800000028,
+ 100.62366699999984,
+ 100.90608399999837
+ ],
+ "timerDelay": [
+ 100.31170900000143,
+ 106.74133299999812,
+ 99.61029199999757,
+ 102.51087499999994,
+ 101.55629199999748,
+ 100.39137499999924,
+ 101.29429199999868,
+ 101.28200000000288,
+ 101.50058300000092,
+ 101.52779200000077
+ ],
+ "p50": 100.3314999999966,
+ "p95": 101.02799999999843,
+ "mainThread": {
+ "p50": 100.32670799999687,
+ "p95": 101.02387499999895
+ },
+ "timer": {
+ "p50": 101.50058300000092,
+ "p95": 106.74133299999812
+ },
+ "bytes": 279889
+ },
+ {
+ "side": "after",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 309.3196250000001,
+ 305.9687909999993,
+ 309.0530829999989,
+ 308.81645800000115,
+ 341.757708000001,
+ 312.01629200000025,
+ 307.1807919999992,
+ 312.16212500000256,
+ 310.9534999999996,
+ 308.57262499999706
+ ],
+ "synchronous": [
+ 63.92504200000258,
+ 60.01270800000202,
+ 63.533582999996725,
+ 61.93554099999892,
+ 64.75587500000256,
+ 64.36054200000217,
+ 60.01929199999722,
+ 63.046875,
+ 64.66241599999921,
+ 60.87924999999814
+ ],
+ "timerDelay": [
+ 65.6551670000008,
+ 60.16491600000154,
+ 63.68512499999997,
+ 62.09820799999943,
+ 64.89708299999984,
+ 64.51124999999956,
+ 60.1640419999967,
+ 63.18170800000007,
+ 64.80383299999812,
+ 61.01304099999834
+ ],
+ "p50": 309.3196250000001,
+ "p95": 341.757708000001,
+ "mainThread": {
+ "p50": 63.533582999996725,
+ "p95": 64.75587500000256
+ },
+ "timer": {
+ "p50": 63.68512499999997,
+ "p95": 65.6551670000008
+ },
+ "bytes": 19980717
+ },
+ {
+ "side": "after",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 309.9531659999993,
+ 306.4628329999978,
+ 322.1193749999984,
+ 313.48549999999886,
+ 310.679709,
+ 308.87070799999856,
+ 312.2624169999981,
+ 312.98020800000086,
+ 310.8165000000008,
+ 313.02654200000325
+ ],
+ "synchronous": [
+ 63.59983300000022,
+ 62.15912499999831,
+ 64.71208299999853,
+ 63.364832999999635,
+ 64.16379199999938,
+ 61.6607499999991,
+ 63.68950000000041,
+ 66.61995800000295,
+ 62.17804199999955,
+ 65.04058400000213
+ ],
+ "timerDelay": [
+ 63.77795799999876,
+ 62.2867499999993,
+ 64.87283299999763,
+ 63.5020829999994,
+ 64.32299999999668,
+ 61.81987499999741,
+ 63.82941700000083,
+ 66.7880830000031,
+ 62.32929199999853,
+ 65.18966700000237
+ ],
+ "p50": 312.2624169999981,
+ "p95": 322.1193749999984,
+ "mainThread": {
+ "p50": 63.68950000000041,
+ "p95": 66.61995800000295
+ },
+ "timer": {
+ "p50": 63.82941700000083,
+ "p95": 66.7880830000031
+ },
+ "bytes": 19980717
+ },
+ {
+ "side": "before",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 99.66387499999837,
+ 100.60670799999934,
+ 101.0269589999989,
+ 99.34116600000198,
+ 100.52483399999983,
+ 100.45933299999888,
+ 102.57049999999799,
+ 100.31112500000017,
+ 101.06137500000114,
+ 100.72383300000001
+ ],
+ "synchronous": [
+ 99.65808299999844,
+ 100.60087499999645,
+ 101.02174999999988,
+ 99.33637499999895,
+ 100.52045900000303,
+ 100.45454199999949,
+ 102.56487500000003,
+ 100.3067910000027,
+ 101.05779099999927,
+ 100.71520800000144
+ ],
+ "timerDelay": [
+ 99.71270799999911,
+ 101.075582999998,
+ 102.86604199999783,
+ 99.37587500000154,
+ 100.56345900000088,
+ 100.4934170000015,
+ 102.61370899999747,
+ 100.73845799999981,
+ 101.11433300000135,
+ 101.1728750000002
+ ],
+ "p50": 100.60670799999934,
+ "p95": 102.57049999999799,
+ "mainThread": {
+ "p50": 100.60087499999645,
+ "p95": 102.56487500000003
+ },
+ "timer": {
+ "p50": 101.075582999998,
+ "p95": 102.86604199999783
+ },
+ "bytes": 279889
+ },
+ {
+ "side": "before",
+ "width": 1600,
+ "height": 10000,
+ "format": "jpeg",
+ "raw": [
+ 34.004124999999476,
+ 33.154875000000175,
+ 34.15137500000128,
+ 33.87254199999734,
+ 33.649084000000585,
+ 34.22029200000179,
+ 34.38349999999991,
+ 33.832125000000815,
+ 34.5212500000016,
+ 34.29595899999913
+ ],
+ "synchronous": [
+ 33.998749999998836,
+ 33.14995899999849,
+ 34.14679199999955,
+ 33.867209,
+ 33.644374999999854,
+ 34.21625000000131,
+ 34.379124999999476,
+ 33.8270420000008,
+ 34.51704100000279,
+ 34.292084000000614
+ ],
+ "timerDelay": [
+ 38.11808299999757,
+ 33.554416999999376,
+ 35.35962500000096,
+ 35.42754199999763,
+ 34.54187499999898,
+ 35.241000000001804,
+ 35.28141600000163,
+ 34.812834000000294,
+ 35.3985410000023,
+ 35.18195900000137
+ ],
+ "p50": 34.15137500000128,
+ "p95": 34.5212500000016,
+ "mainThread": {
+ "p50": 34.14679199999955,
+ "p95": 34.51704100000279
+ },
+ "timer": {
+ "p50": 35.28141600000163,
+ "p95": 38.11808299999757
+ },
+ "bytes": 2573440
+ },
+ {
+ "side": "after",
+ "width": 1600,
+ "height": 10000,
+ "format": "jpeg",
+ "raw": [
+ 33.64008399999875,
+ 34.23979200000031,
+ 33.94933300000048,
+ 33.32762500000172,
+ 34.31974999999875,
+ 33.99616700000115,
+ 33.49749999999767,
+ 34.79095900000175,
+ 34.65858300000036,
+ 34.99670799999876
+ ],
+ "synchronous": [
+ 33.63699999999881,
+ 34.23541699999987,
+ 33.94583299999795,
+ 33.32466700000077,
+ 34.31529099999898,
+ 33.99312500000087,
+ 33.49395799999911,
+ 34.78837500000009,
+ 34.65516600000046,
+ 34.99316700000054
+ ],
+ "timerDelay": [
+ 34.568749999998545,
+ 35.33870899999965,
+ 34.87491600000067,
+ 34.248875000001135,
+ 35.27479099999982,
+ 34.90200000000186,
+ 34.414207999998325,
+ 35.73445899999933,
+ 35.59045799999876,
+ 35.611667000001034
+ ],
+ "p50": 34.23979200000031,
+ "p95": 34.99670799999876,
+ "mainThread": {
+ "p50": 34.23541699999987,
+ "p95": 34.99316700000054
+ },
+ "timer": {
+ "p50": 35.27479099999982,
+ "p95": 35.73445899999933
+ },
+ "bytes": 2573440
+ },
+ {
+ "side": "after",
+ "width": 1600,
+ "height": 10000,
+ "format": "jpeg",
+ "raw": [
+ 34.064540999999736,
+ 34.24995800000033,
+ 34.23612499999945,
+ 34.18804200000159,
+ 34.61583299999984,
+ 35.69891700000153,
+ 34.21220800000083,
+ 33.91270799999984,
+ 34.54029199999786,
+ 34.16333400000076
+ ],
+ "synchronous": [
+ 34.06070799999725,
+ 34.24662499999977,
+ 34.23345799999879,
+ 34.18429200000173,
+ 34.61320799999885,
+ 35.69470799999908,
+ 34.20879200000127,
+ 33.90941699999894,
+ 34.537749999999505,
+ 34.159959000000526
+ ],
+ "timerDelay": [
+ 34.45537499999773,
+ 35.20100000000093,
+ 35.736291999997775,
+ 35.12470899999971,
+ 35.5802079999994,
+ 36.903417000001355,
+ 35.15450000000055,
+ 34.88712499999747,
+ 35.467916999998124,
+ 34.792459000000235
+ ],
+ "p50": 34.23612499999945,
+ "p95": 35.69891700000153,
+ "mainThread": {
+ "p50": 34.23345799999879,
+ "p95": 35.69470799999908
+ },
+ "timer": {
+ "p50": 35.20100000000093,
+ "p95": 36.903417000001355
+ },
+ "bytes": 2573440
+ },
+ {
+ "side": "before",
+ "width": 1600,
+ "height": 10000,
+ "format": "jpeg",
+ "raw": [
+ 33.94416600000113,
+ 34.17420899999706,
+ 33.934166999999434,
+ 33.77845800000068,
+ 34.45566699999836,
+ 35.256625000001804,
+ 33.491791000000376,
+ 35.66895899999872,
+ 34.320542000001296,
+ 33.20262500000172
+ ],
+ "synchronous": [
+ 33.93924999999945,
+ 34.16962499999863,
+ 33.93037499999991,
+ 33.773582999998325,
+ 34.451082999999926,
+ 35.252707999999984,
+ 33.48704100000032,
+ 35.665084000000206,
+ 34.31629199999952,
+ 33.1987500000032
+ ],
+ "timerDelay": [
+ 34.34020800000144,
+ 35.145958999997674,
+ 35.14979200000016,
+ 34.25916599999982,
+ 35.317291999999725,
+ 36.5068330000031,
+ 33.82012499999837,
+ 36.63087499999892,
+ 35.75195800000074,
+ 33.94845900000291
+ ],
+ "p50": 34.17420899999706,
+ "p95": 35.66895899999872,
+ "mainThread": {
+ "p50": 34.16962499999863,
+ "p95": 35.665084000000206
+ },
+ "timer": {
+ "p50": 35.14979200000016,
+ "p95": 36.63087499999892
+ },
+ "bytes": 2573440
+ }
+ ],
+ "saveCandidate": "Initial async PNG defaults rejected; final save measurements are in region-next-save-2026-10-29.json"
+}
diff --git a/docs/acceptance/region-next-native-parity-2026-10-29.json b/docs/acceptance/region-next-native-parity-2026-10-29.json
new file mode 100644
index 0000000000..787bfe1ca9
--- /dev/null
+++ b/docs/acceptance/region-next-native-parity-2026-10-29.json
@@ -0,0 +1,31 @@
+{
+ "generatedAt": "2026-10-29T07:04:30.678Z",
+ "platform": "darwin",
+ "arch": "arm64",
+ "electron": "42.11.12",
+ "capture": [],
+ "save": [],
+ "regression": [
+ {
+ "scale": 2,
+ "alpha": 0,
+ "width": 401,
+ "height": 301,
+ "identical": true
+ },
+ {
+ "scale": 2,
+ "alpha": 127,
+ "width": 401,
+ "height": 301,
+ "identical": true
+ },
+ {
+ "scale": 1.5,
+ "alpha": 255,
+ "width": 300,
+ "height": 226,
+ "identical": true
+ }
+ ]
+}
\ No newline at end of file
diff --git a/docs/acceptance/region-next-renderer-2026-10-29.json b/docs/acceptance/region-next-renderer-2026-10-29.json
new file mode 100644
index 0000000000..5d4a865500
--- /dev/null
+++ b/docs/acceptance/region-next-renderer-2026-10-29.json
@@ -0,0 +1,3061 @@
+{
+ "generatedAt": "2026-10-29T06:49:19.156Z",
+ "baseline": {
+ "head": "8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0",
+ "description": "Working tree after GIF Worker optimization, before this round"
+ },
+ "samples": 30,
+ "platform": "darwin",
+ "arch": "arm64",
+ "cpu": "Apple M5",
+ "scope": "Real Electron offscreen renderer (1040x760 DIP, 2x density), synthetic opaque BGRA source at the stated dimensions. Excludes OS capture, native window startup, IPC serialization, clipboard and disk. 3 warmups per screenshot/scroll batch; GIF streams include their first frame. Alternating before/after batches. First-paint timing includes two animation frames and is sensitive to vsync/GC. Pipeline probes use production scroll matching and GIF encoding; hover probes count real pointer-driven canvas size assignments; they do not measure presentation latency or allocated memory.",
+ "results": [
+ {
+ "width": 1920,
+ "height": 1080,
+ "scale": 1,
+ "before": {
+ "beginSyncMs": {
+ "p50": 2.85,
+ "p95": 4.1
+ },
+ "paintedMs": {
+ "p50": 33.4,
+ "p95": 33.7
+ },
+ "exportMs": {
+ "p50": 2.8,
+ "p95": 4.1
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 2.4000000953674316,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 3.6999999284744263
+ },
+ {
+ "syncMs": 4.100000023841858,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 4.899999976158142
+ },
+ {
+ "syncMs": 4.5,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.5
+ },
+ {
+ "syncMs": 2.5,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.299999952316284
+ },
+ {
+ "syncMs": 2.299999952316284,
+ "paintedMs": 34.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.399999976158142
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.399999976158142
+ },
+ {
+ "syncMs": 2.399999976158142,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.6999999284744263
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.700000047683716
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.799999952316284,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 3.6999999284744263
+ },
+ {
+ "syncMs": 3.3000000715255737,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.700000047683716
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.60000002384186,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 3.3000000715255737,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.6999999284744263
+ },
+ {
+ "syncMs": 2.700000047683716,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 3.799999952316284
+ },
+ {
+ "syncMs": 4,
+ "paintedMs": 33,
+ "frameWrites": 1,
+ "exportMs": 4
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 3.8000000715255737
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 4.100000023841858
+ },
+ {
+ "syncMs": 2.5,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.6999999284744263
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 3.100000023841858
+ },
+ {
+ "syncMs": 3.5,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.6999999284744263
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 2.700000047683716
+ },
+ {
+ "syncMs": 2.799999952316284,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 3.200000047683716
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 3.399999976158142
+ }
+ ]
+ },
+ "after": {
+ "beginSyncMs": {
+ "p50": 2.95,
+ "p95": 4.6
+ },
+ "paintedMs": {
+ "p50": 33.4,
+ "p95": 34.3
+ },
+ "exportMs": {
+ "p50": 2.9,
+ "p95": 4.5
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 3.0999999046325684,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 3.600000023841858
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 3.5
+ },
+ {
+ "syncMs": 4.600000023841858,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 4.200000047683716
+ },
+ {
+ "syncMs": 4.900000095367432,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 4.700000047683716
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.399999976158142
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 3.5999999046325684,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.600000023841858
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.600000023841858
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.799999952316284,
+ "paintedMs": 34.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 3.0999999046325684
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.6999999284744263
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 3.0999999046325684
+ },
+ {
+ "syncMs": 3.3000000715255737,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.6999999284744263
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 4.399999976158142,
+ "paintedMs": 31,
+ "frameWrites": 1,
+ "exportMs": 4.100000023841858
+ },
+ {
+ "syncMs": 3.4000000953674316,
+ "paintedMs": 34.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 3.1999999284744263,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 4.100000023841858
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 4.5
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.600000023841858
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 2.700000047683716,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 3.3000000715255737,
+ "paintedMs": 33.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 3.1999999284744263
+ },
+ {
+ "syncMs": 2.700000047683716,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 2.700000047683716,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 34.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.600000023841858
+ }
+ ]
+ }
+ },
+ {
+ "width": 3840,
+ "height": 2160,
+ "scale": 2,
+ "before": {
+ "beginSyncMs": {
+ "p50": 7.55,
+ "p95": 8.8
+ },
+ "paintedMs": {
+ "p50": 22.2,
+ "p95": 26.1
+ },
+ "exportMs": {
+ "p50": 8.45,
+ "p95": 13.7
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 8.800000071525574,
+ "paintedMs": 26.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 13.700000047683716
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 15.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 13.799999952316284
+ },
+ {
+ "syncMs": 7.199999928474426,
+ "paintedMs": 16.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 9.299999952316284
+ },
+ {
+ "syncMs": 7.200000047683716,
+ "paintedMs": 10.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 8.200000047683716,
+ "paintedMs": 21.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 7.899999976158142
+ },
+ {
+ "syncMs": 6.900000095367432,
+ "paintedMs": 23.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 9.299999952316284
+ },
+ {
+ "syncMs": 8.300000071525574,
+ "paintedMs": 21.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 7.5
+ },
+ {
+ "syncMs": 7.299999952316284,
+ "paintedMs": 23.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.400000095367432
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 9
+ },
+ {
+ "syncMs": 8,
+ "paintedMs": 21.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.200000047683716
+ },
+ {
+ "syncMs": 8.300000071525574,
+ "paintedMs": 22.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 8.299999952316284
+ },
+ {
+ "syncMs": 7.400000095367432,
+ "paintedMs": 23.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 8.899999976158142
+ },
+ {
+ "syncMs": 8.299999952316284,
+ "paintedMs": 21.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 22.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 22.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 9
+ },
+ {
+ "syncMs": 8.800000071525574,
+ "paintedMs": 26.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 13.5
+ },
+ {
+ "syncMs": 7.900000095367432,
+ "paintedMs": 16.5,
+ "frameWrites": 1,
+ "exportMs": 13.299999952316284
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 23.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 21,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 7.799999952316284,
+ "paintedMs": 22.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 21.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.200000047683716
+ },
+ {
+ "syncMs": 7.699999928474426,
+ "paintedMs": 21.5,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.299999952316284,
+ "paintedMs": 22.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 21.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 21.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 22.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.200000047683716
+ },
+ {
+ "syncMs": 7.400000095367432,
+ "paintedMs": 22.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 8.300000071525574
+ },
+ {
+ "syncMs": 8.200000047683716,
+ "paintedMs": 20.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 8.300000071525574
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 22.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 8
+ }
+ ]
+ },
+ "after": {
+ "beginSyncMs": {
+ "p50": 7.7,
+ "p95": 8.9
+ },
+ "paintedMs": {
+ "p50": 21.9,
+ "p95": 24.1
+ },
+ "exportMs": {
+ "p50": 8.6,
+ "p95": 13.5
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 8.800000071525574,
+ "paintedMs": 11.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 13.299999952316284
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 16,
+ "frameWrites": 1,
+ "exportMs": 13.5
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 15.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 10,
+ "frameWrites": 1,
+ "exportMs": 9
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 19.5,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 8.399999976158142,
+ "paintedMs": 22.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.299999952316284,
+ "paintedMs": 19.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.299999952316284,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 8.100000023841858
+ },
+ {
+ "syncMs": 8.199999928474426,
+ "paintedMs": 20.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 7.799999952316284
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 23.5,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.299999952316284,
+ "paintedMs": 21.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 8.200000047683716
+ },
+ {
+ "syncMs": 7.100000023841858,
+ "paintedMs": 20.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 7.600000023841858
+ },
+ {
+ "syncMs": 7.200000047683716,
+ "paintedMs": 24.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 23,
+ "frameWrites": 1,
+ "exportMs": 8.900000095367432
+ },
+ {
+ "syncMs": 9.700000047683716,
+ "paintedMs": 25,
+ "frameWrites": 1,
+ "exportMs": 12.600000023841858
+ },
+ {
+ "syncMs": 8.5,
+ "paintedMs": 16.5,
+ "frameWrites": 1,
+ "exportMs": 13.5
+ },
+ {
+ "syncMs": 8,
+ "paintedMs": 22.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.199999928474426,
+ "paintedMs": 19.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.699999928474426
+ },
+ {
+ "syncMs": 7.800000071525574,
+ "paintedMs": 22.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.199999928474426,
+ "paintedMs": 23,
+ "frameWrites": 1,
+ "exportMs": 8.199999928474426
+ },
+ {
+ "syncMs": 8.899999976158142,
+ "paintedMs": 21.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 7.800000071525574
+ },
+ {
+ "syncMs": 7.799999952316284,
+ "paintedMs": 23,
+ "frameWrites": 1,
+ "exportMs": 9
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 21.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.200000047683716
+ },
+ {
+ "syncMs": 8.799999952316284,
+ "paintedMs": 20.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 7.800000071525574
+ },
+ {
+ "syncMs": 8.5,
+ "paintedMs": 23.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 8.799999952316284
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 8.399999976158142
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 19.5,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 8.200000047683716,
+ "paintedMs": 22.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 8.100000023841858,
+ "paintedMs": 22,
+ "frameWrites": 1,
+ "exportMs": 8.899999976158142
+ }
+ ]
+ }
+ },
+ {
+ "width": 1600,
+ "height": 10000,
+ "scale": 2,
+ "before": {
+ "beginSyncMs": {
+ "p50": 14.15,
+ "p95": 15.8
+ },
+ "paintedMs": {
+ "p50": 27.95,
+ "p95": 32.3
+ },
+ "exportMs": {
+ "p50": 15.85,
+ "p95": 26.4
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 14.5,
+ "paintedMs": 23.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 26.100000023841858
+ },
+ {
+ "syncMs": 13.5,
+ "paintedMs": 19.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 25.699999928474426
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 17.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 18.699999928474426
+ },
+ {
+ "syncMs": 16,
+ "paintedMs": 28.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 15.699999928474426
+ },
+ {
+ "syncMs": 15.799999952316284,
+ "paintedMs": 29.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 16.600000023841858
+ },
+ {
+ "syncMs": 15.099999904632568,
+ "paintedMs": 29.59999990463257,
+ "frameWrites": 1,
+ "exportMs": 15.099999904632568
+ },
+ {
+ "syncMs": 15.199999928474426,
+ "paintedMs": 32.5,
+ "frameWrites": 1,
+ "exportMs": 14.899999976158142
+ },
+ {
+ "syncMs": 13.800000071525574,
+ "paintedMs": 16,
+ "frameWrites": 1,
+ "exportMs": 16.300000071525574
+ },
+ {
+ "syncMs": 15.600000023841858,
+ "paintedMs": 28.5,
+ "frameWrites": 1,
+ "exportMs": 16.299999952316284
+ },
+ {
+ "syncMs": 14.399999976158142,
+ "paintedMs": 30.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 15
+ },
+ {
+ "syncMs": 13.600000023841858,
+ "paintedMs": 16.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 17.5
+ },
+ {
+ "syncMs": 13.700000047683716,
+ "paintedMs": 29,
+ "frameWrites": 1,
+ "exportMs": 15.200000047683716
+ },
+ {
+ "syncMs": 13.599999904632568,
+ "paintedMs": 16.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 18.300000071525574
+ },
+ {
+ "syncMs": 13.200000047683716,
+ "paintedMs": 29.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 15.700000047683716
+ },
+ {
+ "syncMs": 13.299999952316284,
+ "paintedMs": 16.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 17.799999952316284
+ },
+ {
+ "syncMs": 15.100000023841858,
+ "paintedMs": 27.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 26.799999952316284
+ },
+ {
+ "syncMs": 13.700000047683716,
+ "paintedMs": 19.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 26.40000009536743
+ },
+ {
+ "syncMs": 14.100000023841858,
+ "paintedMs": 17.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 18.299999952316284
+ },
+ {
+ "syncMs": 15.100000023841858,
+ "paintedMs": 27,
+ "frameWrites": 1,
+ "exportMs": 15.399999976158142
+ },
+ {
+ "syncMs": 13.399999976158142,
+ "paintedMs": 17.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 17.5
+ },
+ {
+ "syncMs": 13.5,
+ "paintedMs": 29.59999990463257,
+ "frameWrites": 1,
+ "exportMs": 15.200000047683716
+ },
+ {
+ "syncMs": 14.700000047683716,
+ "paintedMs": 32.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 14.799999952316284
+ },
+ {
+ "syncMs": 13.300000071525574,
+ "paintedMs": 16.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 15.700000047683716
+ },
+ {
+ "syncMs": 14.199999928474426,
+ "paintedMs": 30.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 16.899999976158142
+ },
+ {
+ "syncMs": 14.200000047683716,
+ "paintedMs": 31.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.5
+ },
+ {
+ "syncMs": 15.200000047683716,
+ "paintedMs": 30.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 15
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 16.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 16
+ },
+ {
+ "syncMs": 13.800000071525574,
+ "paintedMs": 31.5,
+ "frameWrites": 1,
+ "exportMs": 15.300000071525574
+ },
+ {
+ "syncMs": 14.600000023841858,
+ "paintedMs": 32,
+ "frameWrites": 1,
+ "exportMs": 15.399999976158142
+ },
+ {
+ "syncMs": 14.300000071525574,
+ "paintedMs": 16.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.700000047683716
+ }
+ ]
+ },
+ "after": {
+ "beginSyncMs": {
+ "p50": 14.15,
+ "p95": 16.5
+ },
+ "paintedMs": {
+ "p50": 28.95,
+ "p95": 31.9
+ },
+ "exportMs": {
+ "p50": 16.5,
+ "p95": 26.3
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 14.299999952316284,
+ "paintedMs": 26,
+ "frameWrites": 1,
+ "exportMs": 26.299999952316284
+ },
+ {
+ "syncMs": 13.200000047683716,
+ "paintedMs": 20.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 25.800000071525574
+ },
+ {
+ "syncMs": 14.5,
+ "paintedMs": 18.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 16.899999976158142
+ },
+ {
+ "syncMs": 14.799999952316284,
+ "paintedMs": 29.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 14.899999976158142
+ },
+ {
+ "syncMs": 13.400000095367432,
+ "paintedMs": 32.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 16.600000023841858
+ },
+ {
+ "syncMs": 13.300000071525574,
+ "paintedMs": 30.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 14.899999976158142
+ },
+ {
+ "syncMs": 13.799999952316284,
+ "paintedMs": 15.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 15.800000071525574
+ },
+ {
+ "syncMs": 16.799999952316284,
+ "paintedMs": 31,
+ "frameWrites": 1,
+ "exportMs": 15.600000023841858
+ },
+ {
+ "syncMs": 14.799999952316284,
+ "paintedMs": 29.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 16.399999976158142
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 30.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 17.600000023841858
+ },
+ {
+ "syncMs": 14.299999952316284,
+ "paintedMs": 29.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.200000047683716
+ },
+ {
+ "syncMs": 15,
+ "paintedMs": 30.59999990463257,
+ "frameWrites": 1,
+ "exportMs": 14.900000095367432
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 31.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 15.600000023841858
+ },
+ {
+ "syncMs": 13.399999976158142,
+ "paintedMs": 16.5,
+ "frameWrites": 1,
+ "exportMs": 17.399999976158142
+ },
+ {
+ "syncMs": 13.399999976158142,
+ "paintedMs": 28.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 16.699999928474426
+ },
+ {
+ "syncMs": 16,
+ "paintedMs": 25,
+ "frameWrites": 1,
+ "exportMs": 25.299999952316284
+ },
+ {
+ "syncMs": 13.700000047683716,
+ "paintedMs": 19.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 27.899999976158142
+ },
+ {
+ "syncMs": 13.799999952316284,
+ "paintedMs": 31.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 19
+ },
+ {
+ "syncMs": 15.699999928474426,
+ "paintedMs": 26.09999990463257,
+ "frameWrites": 1,
+ "exportMs": 15.5
+ },
+ {
+ "syncMs": 14.100000023841858,
+ "paintedMs": 30.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 17.399999976158142
+ },
+ {
+ "syncMs": 14.899999976158142,
+ "paintedMs": 26.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.699999928474426
+ },
+ {
+ "syncMs": 16,
+ "paintedMs": 28.5,
+ "frameWrites": 1,
+ "exportMs": 15.799999952316284
+ },
+ {
+ "syncMs": 13.600000023841858,
+ "paintedMs": 14.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.5
+ },
+ {
+ "syncMs": 14,
+ "paintedMs": 30.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 16.899999976158142
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 31.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 18.100000023841858
+ },
+ {
+ "syncMs": 15.199999928474426,
+ "paintedMs": 27.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 17.399999976158142
+ },
+ {
+ "syncMs": 15.299999952316284,
+ "paintedMs": 29,
+ "frameWrites": 1,
+ "exportMs": 15.600000023841858
+ },
+ {
+ "syncMs": 16.5,
+ "paintedMs": 23.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 15.600000023841858
+ },
+ {
+ "syncMs": 14.200000047683716,
+ "paintedMs": 30.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.600000023841858
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 17,
+ "frameWrites": 1,
+ "exportMs": 18.199999928474426
+ }
+ ]
+ }
+ }
+ ],
+ "pipeline": [
+ {
+ "side": "before",
+ "hover": {
+ "canvasResizes": 0,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.5999999046325684,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.7000000476837158,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.2999999523162842,
+ 0.5,
+ 0.5,
+ 0.5
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.5,
+ "p95": 0.6
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 1.6999999284744263,
+ 1.5,
+ 1.3000000715255737,
+ 1.399999976158142,
+ 1.600000023841858,
+ 1.6999999284744263,
+ 1.3000000715255737,
+ 1.600000023841858,
+ 1.6999999284744263,
+ 1.5,
+ 1.7000000476837158,
+ 1.5,
+ 1.399999976158142,
+ 1.2999999523162842,
+ 1.3000000715255737,
+ 1.899999976158142,
+ 1.2999999523162842,
+ 1.2000000476837158,
+ 1.2999999523162842,
+ 1.5,
+ 1.600000023841858,
+ 1.2999999523162842,
+ 1.4000000953674316,
+ 1.399999976158142,
+ 1.6999999284744263,
+ 2.100000023841858,
+ 2,
+ 1.899999976158142,
+ 1.8000000715255737,
+ 2
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 1.5,
+ "p95": 2
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 2.5,
+ 2.299999952316284,
+ 2.399999976158142,
+ 2.700000047683716,
+ 2.299999952316284,
+ 2.8000000715255737,
+ 2.5,
+ 2.600000023841858,
+ 2.299999952316284,
+ 2.399999976158142,
+ 2.399999976158142,
+ 2.4000000953674316,
+ 3.1999999284744263,
+ 3.100000023841858,
+ 3,
+ 2.899999976158142,
+ 3.5,
+ 3.200000047683716,
+ 3.1999999284744263,
+ 3.100000023841858,
+ 2.899999976158142,
+ 3.3000000715255737,
+ 3.1999999284744263,
+ 3,
+ 3,
+ 3,
+ 3.399999976158142,
+ 3.3000000715255737,
+ 3,
+ 3
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 3,
+ "p95": 3.4
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 9.699999928474426,
+ 9.800000071525574,
+ 9.5,
+ 9.799999952316284,
+ 9.799999952316284,
+ 10.200000047683716,
+ 9.700000047683716,
+ 9.699999928474426,
+ 9.800000071525574,
+ 9.5,
+ 9.799999952316284,
+ 10.899999976158142,
+ 10,
+ 9.300000071525574,
+ 10.199999928474426,
+ 10.100000023841858,
+ 9.5,
+ 9.799999952316284,
+ 9.900000095367432,
+ 9.5,
+ 10.099999904632568,
+ 10.300000071525574,
+ 10,
+ 9.899999976158142,
+ 10.200000047683716,
+ 9.399999976158142,
+ 9.299999952316284,
+ 9.399999976158142,
+ 9.900000095367432,
+ 9.399999976158142
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 9.8,
+ "p95": 10.3
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 89.29999995231628,
+ 93.20000004768372,
+ 118.5,
+ 123.20000004768372,
+ 124.60000002384186,
+ 123.09999990463257,
+ 98.10000002384186,
+ 88.89999997615814,
+ 116.60000002384186,
+ 116.70000004768372,
+ 123.69999992847443,
+ 122.29999995231628,
+ 116.39999997615814,
+ 115.80000007152557,
+ 114.80000007152557,
+ 116,
+ 114.30000007152557,
+ 115.69999992847443,
+ 113.70000004768372,
+ 122,
+ 116.5,
+ 116,
+ 117.40000009536743,
+ 118.39999997615814,
+ 119.39999997615814,
+ 120,
+ 125.10000002384186,
+ 122.39999997615814,
+ 118.69999992847443,
+ 116.10000002384186
+ ],
+ "mainThread": [
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.2999999523162842,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.7000000476837158,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421
+ ],
+ "timerDelay": [
+ 1.100000023841858,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.7000000476837158,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421
+ ],
+ "finishMs": 14.200000047683716,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 116.65,
+ "p95": 124.6,
+ "mainThreadMs": {
+ "p50": 0.5,
+ "p95": 0.6
+ },
+ "timerDelayMs": {
+ "p50": 0.5,
+ "p95": 0.7
+ }
+ }
+ },
+ {
+ "side": "after",
+ "hover": {
+ "canvasResizes": 0,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.6000000238418579,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.7000000476837158,
+ 0.6999999284744263,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.7000000476837158,
+ 0.5999999046325684,
+ 0.6000000238418579,
+ 0.8000000715255737,
+ 0.5999999046325684,
+ 0.7000000476837158,
+ 0.7999999523162842,
+ 0.7000000476837158,
+ 0.7000000476837158,
+ 0.7999999523162842,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.5999999046325684,
+ 0.5
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.6,
+ "p95": 0.8
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 1.7000000476837158,
+ 1.399999976158142,
+ 1.600000023841858,
+ 1.399999976158142,
+ 1.600000023841858,
+ 1.7999999523162842,
+ 1.8000000715255737,
+ 1.899999976158142,
+ 1.899999976158142,
+ 2,
+ 1.899999976158142,
+ 1.7000000476837158,
+ 1.899999976158142,
+ 1.600000023841858,
+ 1.899999976158142,
+ 1.899999976158142,
+ 1.8000000715255737,
+ 1.600000023841858,
+ 1.5999999046325684,
+ 1.7000000476837158,
+ 1.600000023841858,
+ 1.7999999523162842,
+ 1.7000000476837158,
+ 1.899999976158142,
+ 2,
+ 1.7000000476837158,
+ 1.7999999523162842,
+ 2,
+ 2.100000023841858,
+ 1.7999999523162842
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 1.8,
+ "p95": 2
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 2.399999976158142,
+ 2.5,
+ 2.5,
+ 2.4000000953674316,
+ 2.399999976158142,
+ 2.299999952316284,
+ 2.399999976158142,
+ 2.4000000953674316,
+ 2.299999952316284,
+ 2.600000023841858,
+ 2.6999999284744263,
+ 2.600000023841858,
+ 3.399999976158142,
+ 3.700000047683716,
+ 3.200000047683716,
+ 3.399999976158142,
+ 3.100000023841858,
+ 3.399999976158142,
+ 3.100000023841858,
+ 3,
+ 3.399999976158142,
+ 3.100000023841858,
+ 3.5999999046325684,
+ 3.200000047683716,
+ 3.100000023841858,
+ 3.299999952316284,
+ 3,
+ 3.200000047683716,
+ 3.100000023841858,
+ 3.299999952316284
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 3.1,
+ "p95": 3.6
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 10.800000071525574,
+ 10.100000023841858,
+ 10.199999928474426,
+ 10.700000047683716,
+ 9.699999928474426,
+ 9.5,
+ 9.5,
+ 10.200000047683716,
+ 10.100000023841858,
+ 10.199999928474426,
+ 10.300000071525574,
+ 9.699999928474426,
+ 10.100000023841858,
+ 10.899999976158142,
+ 11.300000071525574,
+ 10.5,
+ 11.100000023841858,
+ 10.700000047683716,
+ 10.200000047683716,
+ 10.5,
+ 9.599999904632568,
+ 9.700000047683716,
+ 10.5,
+ 9.5,
+ 9.700000047683716,
+ 9.799999952316284,
+ 10.299999952316284,
+ 9.600000023841858,
+ 10.200000047683716,
+ 10.899999976158142
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 10.2,
+ "p95": 11.1
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 98.09999990463257,
+ 100.70000004768372,
+ 97.30000007152557,
+ 124.89999997615814,
+ 124.69999992847443,
+ 118,
+ 126.30000007152557,
+ 98.90000009536743,
+ 129.69999992847443,
+ 132.60000002384186,
+ 134.5,
+ 128.89999997615814,
+ 129.10000002384186,
+ 128.79999995231628,
+ 126.39999997615814,
+ 126.29999995231628,
+ 124.90000009536743,
+ 133,
+ 121.10000002384186,
+ 125.60000002384186,
+ 118.19999992847443,
+ 115.60000002384186,
+ 113.79999995231628,
+ 114.60000002384186,
+ 112.89999997615814,
+ 113.39999997615814,
+ 121.80000007152557,
+ 115.10000002384186,
+ 113.89999997615814,
+ 118.89999997615814
+ ],
+ "mainThread": [
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.2999999523162842,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.3999999761581421,
+ 0.3999999761581421
+ ],
+ "timerDelay": [
+ 1.0999999046325684,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5999999046325684,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.5,
+ 0.3999999761581421
+ ],
+ "finishMs": 12.100000023841858,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 121.45,
+ "p95": 133,
+ "mainThreadMs": {
+ "p50": 0.5,
+ "p95": 0.6
+ },
+ "timerDelayMs": {
+ "p50": 0.5,
+ "p95": 0.6
+ }
+ }
+ },
+ {
+ "side": "after",
+ "hover": {
+ "canvasResizes": 0,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.7999999523162842,
+ 0.5,
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.5,
+ 0.5999999046325684,
+ 0.6000000238418579,
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.6999999284744263,
+ 0.7000000476837158,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5999999046325684,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.6,
+ "p95": 0.7
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 1.7999999523162842,
+ 2.200000047683716,
+ 1.6999999284744263,
+ 1.399999976158142,
+ 1.3000000715255737,
+ 1.2999999523162842,
+ 1.399999976158142,
+ 1.3000000715255737,
+ 1.399999976158142,
+ 1.7000000476837158,
+ 1.2999999523162842,
+ 1.2999999523162842,
+ 1.3000000715255737,
+ 1.1999999284744263,
+ 1.2000000476837158,
+ 1.2999999523162842,
+ 1.3000000715255737,
+ 1.1999999284744263,
+ 1.4000000953674316,
+ 1.1999999284744263,
+ 1.2000000476837158,
+ 1.2999999523162842,
+ 1.5,
+ 1.5,
+ 1.399999976158142,
+ 1.5,
+ 1.5,
+ 1.5,
+ 1.5,
+ 1.600000023841858
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 1.4,
+ "p95": 1.8
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 3,
+ 2.5999999046325684,
+ 2.200000047683716,
+ 2.399999976158142,
+ 2.100000023841858,
+ 2.700000047683716,
+ 2.0999999046325684,
+ 2.100000023841858,
+ 2.200000047683716,
+ 2.1999999284744263,
+ 2.3000000715255737,
+ 2.299999952316284,
+ 2.8000000715255737,
+ 3,
+ 2.6999999284744263,
+ 3,
+ 2.899999976158142,
+ 3.200000047683716,
+ 3.299999952316284,
+ 2.8000000715255737,
+ 3,
+ 2.899999976158142,
+ 2.899999976158142,
+ 2.8000000715255737,
+ 3.299999952316284,
+ 2.799999952316284,
+ 3.100000023841858,
+ 2.899999976158142,
+ 2.8000000715255737,
+ 3
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 2.8,
+ "p95": 3.3
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 10.399999976158142,
+ 9.700000047683716,
+ 8.699999928474426,
+ 9.600000023841858,
+ 9.5,
+ 9.299999952316284,
+ 9.200000047683716,
+ 9.100000023841858,
+ 9.399999976158142,
+ 9.399999976158142,
+ 9.100000023841858,
+ 8.600000023841858,
+ 8.799999952316284,
+ 9.200000047683716,
+ 9,
+ 8.799999952316284,
+ 9,
+ 9.100000023841858,
+ 9.100000023841858,
+ 9.199999928474426,
+ 8.700000047683716,
+ 8.799999952316284,
+ 9.300000071525574,
+ 9.299999952316284,
+ 9.300000071525574,
+ 9,
+ 9.099999904632568,
+ 9.100000023841858,
+ 8.899999976158142,
+ 8.900000095367432
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 9.1,
+ "p95": 9.7
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 82.5,
+ 89.29999995231628,
+ 86.29999995231628,
+ 117.10000002384186,
+ 116.10000002384186,
+ 114.29999995231628,
+ 117.60000002384186,
+ 86.5,
+ 112.5,
+ 115.10000002384186,
+ 113.89999997615814,
+ 112.80000007152557,
+ 113.40000009536743,
+ 113.39999997615814,
+ 114.39999997615814,
+ 113.40000009536743,
+ 115.09999990463257,
+ 112.70000004768372,
+ 129.10000002384186,
+ 127.10000002384186,
+ 115.89999997615814,
+ 114.39999997615814,
+ 112.70000004768372,
+ 113,
+ 115.20000004768372,
+ 114.5,
+ 115.69999992847443,
+ 114.5,
+ 113.20000004768372,
+ 113.79999995231628
+ ],
+ "mainThread": [
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.40000009536743164,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.2999999523162842,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421
+ ],
+ "timerDelay": [
+ 1.100000023841858,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.40000009536743164,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5
+ ],
+ "finishMs": 12.100000023841858,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 114.1,
+ "p95": 127.1,
+ "mainThreadMs": {
+ "p50": 0.5,
+ "p95": 0.5
+ },
+ "timerDelayMs": {
+ "p50": 0.5,
+ "p95": 0.6
+ }
+ }
+ },
+ {
+ "side": "before",
+ "hover": {
+ "canvasResizes": 0,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.5999999046325684,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5,
+ 0.5999999046325684,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.5,
+ "p95": 0.6
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 3.399999976158142,
+ 2.700000047683716,
+ 1.399999976158142,
+ 2,
+ 2.100000023841858,
+ 3.200000047683716,
+ 2.799999952316284,
+ 3.100000023841858,
+ 2.799999952316284,
+ 1.899999976158142,
+ 1.2000000476837158,
+ 1.2999999523162842,
+ 1.4000000953674316,
+ 1.1999999284744263,
+ 1.2000000476837158,
+ 1.2999999523162842,
+ 1.600000023841858,
+ 1.7000000476837158,
+ 1.6999999284744263,
+ 2,
+ 1.399999976158142,
+ 1.3000000715255737,
+ 1.2999999523162842,
+ 1.7000000476837158,
+ 1.600000023841858,
+ 1.5999999046325684,
+ 1.9000000953674316,
+ 1.7999999523162842,
+ 2.399999976158142,
+ 1.8000000715255737
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 1.7,
+ "p95": 3.2
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 2.600000023841858,
+ 2.299999952316284,
+ 2.5,
+ 2.100000023841858,
+ 2.100000023841858,
+ 2.100000023841858,
+ 2.0999999046325684,
+ 2.100000023841858,
+ 2.200000047683716,
+ 2.100000023841858,
+ 2.899999976158142,
+ 2.299999952316284,
+ 3,
+ 3,
+ 2.899999976158142,
+ 2.700000047683716,
+ 3.399999976158142,
+ 2.899999976158142,
+ 2.8000000715255737,
+ 2.799999952316284,
+ 2.899999976158142,
+ 2.700000047683716,
+ 3.200000047683716,
+ 2.899999976158142,
+ 2.899999976158142,
+ 3,
+ 3,
+ 3.399999976158142,
+ 2.899999976158142,
+ 2.8000000715255737
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 2.8,
+ "p95": 3.4
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 9.299999952316284,
+ 9.100000023841858,
+ 8.600000023841858,
+ 9.200000047683716,
+ 9,
+ 9.299999952316284,
+ 9.100000023841858,
+ 9.199999928474426,
+ 9.200000047683716,
+ 9.100000023841858,
+ 9,
+ 9,
+ 8.600000023841858,
+ 8.799999952316284,
+ 9.299999952316284,
+ 9,
+ 9.200000047683716,
+ 9,
+ 9.200000047683716,
+ 8.699999928474426,
+ 9.100000023841858,
+ 9.100000023841858,
+ 9.5,
+ 9,
+ 9.199999928474426,
+ 9,
+ 9.300000071525574,
+ 9.199999928474426,
+ 9,
+ 8.600000023841858
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 9.1,
+ "p95": 9.3
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 84.70000004768372,
+ 88.80000007152557,
+ 87.39999997615814,
+ 118.79999995231628,
+ 114.39999997615814,
+ 117.29999995231628,
+ 115.79999995231628,
+ 85.79999995231628,
+ 114.80000007152557,
+ 114.30000007152557,
+ 112.39999997615814,
+ 111.69999992847443,
+ 112.79999995231628,
+ 111.39999997615814,
+ 111.70000004768372,
+ 115.20000004768372,
+ 112.60000002384186,
+ 113.69999992847443,
+ 113.39999997615814,
+ 121.80000007152557,
+ 112.40000009536743,
+ 114.30000007152557,
+ 111.90000009536743,
+ 113.5,
+ 113.20000004768372,
+ 111.60000002384186,
+ 112.79999995231628,
+ 115.39999997615814,
+ 112.39999997615814,
+ 112.39999997615814
+ ],
+ "mainThread": [
+ 0.5,
+ 0.5,
+ 0.5999999046325684,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.40000009536743164,
+ 0.5,
+ 0.3999999761581421,
+ 0.6000000238418579,
+ 0.3999999761581421,
+ 0.5,
+ 0.40000009536743164,
+ 0.30000007152557373,
+ 0.5,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421
+ ],
+ "timerDelay": [
+ 1.100000023841858,
+ 0.5,
+ 0.5999999046325684,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.6000000238418579,
+ 0.3999999761581421,
+ 0.5,
+ 0.5,
+ 0.40000009536743164,
+ 0.5,
+ 0.3999999761581421,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.3999999761581421
+ ],
+ "finishMs": 12,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 112.8,
+ "p95": 118.8,
+ "mainThreadMs": {
+ "p50": 0.4,
+ "p95": 0.6
+ },
+ "timerDelayMs": {
+ "p50": 0.5,
+ "p95": 0.6
+ }
+ }
+ }
+ ],
+ "regression": [
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ }
+ ],
+ "versions": {
+ "electron": "42.11.12",
+ "chrome": "148.0.7778.280"
+ },
+ "annotations": [
+ {
+ "side": "before",
+ "raw": [
+ 16.800000071525574,
+ 16,
+ 17.899999976158142,
+ 16,
+ 16.799999952316284,
+ 16.800000071525574,
+ 18,
+ 18.59999990463257,
+ 18.40000009536743,
+ 16.399999976158142,
+ 16.899999976158142,
+ 16.399999976158142,
+ 16.300000071525574,
+ 18.300000071525574,
+ 18.399999976158142,
+ 18.700000047683716,
+ 18.5,
+ 14.5,
+ 18.799999952316284,
+ 17.600000023841858,
+ 17.5,
+ 17.899999976158142,
+ 18.5,
+ 20.899999976158142,
+ 14.600000023841858,
+ 20,
+ 15.600000023841858,
+ 16.199999928474426,
+ 15.700000047683716,
+ 16.700000047683716
+ ],
+ "synchronous": {
+ "p50": 0.4,
+ "p95": 0.5
+ },
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 17.2,
+ "p95": 20
+ }
+ },
+ {
+ "side": "after",
+ "raw": [
+ 18.700000047683716,
+ 20.199999928474426,
+ 16.600000023841858,
+ 16.899999976158142,
+ 17.700000047683716,
+ 17.399999976158142,
+ 15.600000023841858,
+ 18.100000023841858,
+ 16.799999952316284,
+ 15.700000047683716,
+ 15.799999952316284,
+ 17.800000071525574,
+ 16.09999990463257,
+ 17,
+ 16.5,
+ 16.5,
+ 17.40000009536743,
+ 18.899999976158142,
+ 19,
+ 17.399999976158142,
+ 14.5,
+ 18.5,
+ 17.399999976158142,
+ 17.299999952316284,
+ 17.200000047683716,
+ 17.700000047683716,
+ 17.799999952316284,
+ 17.200000047683716,
+ 17.59999990463257,
+ 17.600000023841858
+ ],
+ "synchronous": {
+ "p50": 0.2,
+ "p95": 0.3
+ },
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 17.4,
+ "p95": 19
+ }
+ },
+ {
+ "side": "after",
+ "raw": [
+ 16.799999952316284,
+ 17.800000071525574,
+ 15.299999952316284,
+ 16,
+ 16.5,
+ 16.800000071525574,
+ 17.399999976158142,
+ 17.299999952316284,
+ 17.100000023841858,
+ 17.199999928474426,
+ 16.300000071525574,
+ 17.699999928474426,
+ 17.90000009536743,
+ 19.899999976158142,
+ 17.600000023841858,
+ 17.59999990463257,
+ 17.600000023841858,
+ 19.399999976158142,
+ 21,
+ 19.700000047683716,
+ 14.799999952316284,
+ 19.300000071525574,
+ 20.600000023841858,
+ 19.199999928474426,
+ 17.600000023841858,
+ 17.5,
+ 17.799999952316284,
+ 20,
+ 19.90000009536743,
+ 14.799999952316284
+ ],
+ "synchronous": {
+ "p50": 0.2,
+ "p95": 0.3
+ },
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 17.6,
+ "p95": 20.6
+ }
+ },
+ {
+ "side": "before",
+ "raw": [
+ 16.600000023841858,
+ 16.299999952316284,
+ 16,
+ 16.300000071525574,
+ 15.699999928474426,
+ 17.5,
+ 17.300000071525574,
+ 16.600000023841858,
+ 15.800000071525574,
+ 17.5,
+ 16.899999976158142,
+ 16.899999976158142,
+ 17.700000047683716,
+ 18.699999928474426,
+ 18.399999976158142,
+ 17.600000023841858,
+ 17.399999976158142,
+ 17.399999976158142,
+ 17.600000023841858,
+ 17.5,
+ 17.600000023841858,
+ 17.799999952316284,
+ 14.800000071525574,
+ 15.199999928474426,
+ 17.600000023841858,
+ 17.399999976158142,
+ 17.300000071525574,
+ 17.799999952316284,
+ 18,
+ 19.899999976158142
+ ],
+ "synchronous": {
+ "p50": 0.4,
+ "p95": 0.5
+ },
+ "hash": 1780816009,
+ "pixelsIdentical": true,
+ "width": 3840,
+ "height": 2160,
+ "effects": 48,
+ "timing": {
+ "p50": 17.4,
+ "p95": 18.7
+ }
+ }
+ ],
+ "gifMotion": [
+ {
+ "side": "before",
+ "raw": [
+ 79,
+ 89.29999995231628,
+ 115.5,
+ 121.69999992847443,
+ 115.90000009536743,
+ 115.80000007152557,
+ 114.30000007152557,
+ 113.39999997615814,
+ 116.19999992847443,
+ 114.5,
+ 119.70000004768372,
+ 114.20000004768372,
+ 111.89999997615814,
+ 112.70000004768372,
+ 118.30000007152557,
+ 113.80000007152557,
+ 111.70000004768372,
+ 111.39999997615814,
+ 114.20000004768372,
+ 115.39999997615814,
+ 111.39999997615814,
+ 113.29999995231628,
+ 111.19999992847443,
+ 115.09999990463257,
+ 112.60000002384186,
+ 111.79999995231628,
+ 113.60000002384186,
+ 112.20000004768372,
+ 113.10000002384186,
+ 113.29999995231628
+ ],
+ "bytes": 18438016,
+ "hash": 2564378677,
+ "timing": {
+ "p50": 113.5,
+ "p95": 119.7
+ }
+ },
+ {
+ "side": "after",
+ "raw": [
+ 81.29999995231628,
+ 17.5,
+ 17.600000023841858,
+ 18.600000023841858,
+ 16,
+ 19.40000009536743,
+ 19.100000023841858,
+ 15.899999976158142,
+ 15.900000095367432,
+ 17.700000047683716,
+ 15.600000023841858,
+ 15.899999976158142,
+ 17.200000047683716,
+ 16.300000071525574,
+ 15.800000071525574,
+ 15.600000023841858,
+ 15.899999976158142,
+ 14.899999976158142,
+ 15.799999952316284,
+ 14.700000047683716,
+ 14.5,
+ 15.5,
+ 15.700000047683716,
+ 16.199999928474426,
+ 14.399999976158142,
+ 14.700000047683716,
+ 16,
+ 14.5,
+ 14.800000071525574,
+ 16.40000009536743
+ ],
+ "bytes": 18438016,
+ "hash": 2564378677,
+ "timing": {
+ "p50": 15.9,
+ "p95": 19.4
+ }
+ },
+ {
+ "side": "after",
+ "raw": [
+ 81.60000002384186,
+ 17,
+ 17.699999928474426,
+ 18.199999928474426,
+ 16.899999976158142,
+ 19.40000009536743,
+ 18.100000023841858,
+ 15.5,
+ 15.899999976158142,
+ 17.09999990463257,
+ 15.699999928474426,
+ 16.700000047683716,
+ 16.5,
+ 16.199999928474426,
+ 15.899999976158142,
+ 15.600000023841858,
+ 15.700000047683716,
+ 14.800000071525574,
+ 15.5,
+ 14.699999928474426,
+ 14.600000023841858,
+ 16.700000047683716,
+ 14.400000095367432,
+ 16.200000047683716,
+ 15.299999952316284,
+ 14.699999928474426,
+ 17.200000047683716,
+ 15,
+ 14.899999976158142,
+ 16
+ ],
+ "bytes": 18438016,
+ "hash": 2564378677,
+ "timing": {
+ "p50": 15.95,
+ "p95": 19.4
+ }
+ },
+ {
+ "side": "before",
+ "raw": [
+ 80.89999997615814,
+ 88.70000004768372,
+ 116,
+ 118.10000002384186,
+ 116.89999997615814,
+ 115.90000009536743,
+ 122.20000004768372,
+ 113.10000002384186,
+ 117.19999992847443,
+ 115.69999992847443,
+ 113.39999997615814,
+ 112.60000002384186,
+ 114.89999997615814,
+ 118.89999997615814,
+ 113.39999997615814,
+ 114.69999992847443,
+ 119.29999995231628,
+ 112.29999995231628,
+ 114.5,
+ 120.89999997615814,
+ 117.39999997615814,
+ 114.10000002384186,
+ 115.60000002384186,
+ 115.39999997615814,
+ 112.29999995231628,
+ 113,
+ 115,
+ 112,
+ 116.10000002384186,
+ 121.40000009536743
+ ],
+ "bytes": 18438016,
+ "hash": 2564378677,
+ "timing": {
+ "p50": 115.2,
+ "p95": 121.4
+ }
+ }
+ ],
+ "gifParity": {
+ "bytes": 4634,
+ "identical": true,
+ "repeat": "Infinity",
+ "decoded": [
+ {
+ "width": 64,
+ "height": 48,
+ "duration": 230000,
+ "timestamp": 0,
+ "rgbaBytes": 12288
+ },
+ {
+ "width": 64,
+ "height": 48,
+ "duration": 140000,
+ "timestamp": 230000,
+ "rgbaBytes": 12288
+ },
+ {
+ "width": 64,
+ "height": 48,
+ "duration": 110000,
+ "timestamp": 370000,
+ "rgbaBytes": 12288
+ },
+ {
+ "width": 64,
+ "height": 48,
+ "duration": 210000,
+ "timestamp": 480000,
+ "rgbaBytes": 12288
+ },
+ {
+ "width": 64,
+ "height": 48,
+ "duration": 120000,
+ "timestamp": 690000,
+ "rgbaBytes": 12288
+ }
+ ]
+ }
+}
diff --git a/docs/acceptance/region-next-save-2026-10-29.json b/docs/acceptance/region-next-save-2026-10-29.json
new file mode 100644
index 0000000000..01db0e742c
--- /dev/null
+++ b/docs/acceptance/region-next-save-2026-10-29.json
@@ -0,0 +1,1281 @@
+{
+ "generatedAt": "2026-10-29T07:01:22.161Z",
+ "platform": "darwin",
+ "arch": "arm64",
+ "electron": "42.11.12",
+ "capture": [],
+ "save": [
+ {
+ "side": "before",
+ "width": 1920,
+ "height": 1080,
+ "format": "png",
+ "raw": [
+ 14.078000000000003,
+ 13.012917000000016,
+ 12.69229199999998,
+ 12.854124999999982,
+ 12.709499999999991,
+ 12.795792000000006,
+ 12.69108300000002,
+ 12.684458999999976,
+ 12.767708000000027,
+ 12.751791999999966
+ ],
+ "synchronous": [
+ 14.06895800000001,
+ 13.009041999999994,
+ 12.690208999999982,
+ 12.85216699999998,
+ 12.707459,
+ 12.794416999999981,
+ 12.690041000000008,
+ 12.683624999999978,
+ 12.766875000000027,
+ 12.75079199999999
+ ],
+ "timerDelay": [
+ 17.585624999999993,
+ 13.322334000000012,
+ 12.860291999999987,
+ 12.95675,
+ 12.802166999999997,
+ 12.854084,
+ 12.72512500000002,
+ 12.705874999999992,
+ 12.799208000000021,
+ 12.789832999999987
+ ],
+ "p50": 12.767708000000027,
+ "p95": 14.078000000000003,
+ "mainThread": {
+ "p50": 12.766875000000027,
+ "p95": 14.06895800000001
+ },
+ "timer": {
+ "p50": 12.854084,
+ "p95": 17.585624999999993
+ },
+ "bytes": 35922
+ },
+ {
+ "side": "after",
+ "width": 1920,
+ "height": 1080,
+ "format": "png",
+ "raw": [
+ 32.59945800000003,
+ 17.51483300000001,
+ 17.72999999999996,
+ 17.353707999999983,
+ 17.236000000000047,
+ 17.264250000000004,
+ 18.157332999999994,
+ 18.227999999999952,
+ 18.833874999999978,
+ 17.343541999999957
+ ],
+ "synchronous": [
+ 3.0402500000000146,
+ 1.768792000000019,
+ 1.7719999999999914,
+ 1.6512500000000045,
+ 1.6814580000000205,
+ 1.692875000000015,
+ 1.6637499999999932,
+ 2.4567499999999995,
+ 2.9863750000000095,
+ 1.710999999999956
+ ],
+ "timerDelay": [
+ 16.92874999999998,
+ 1.8776670000000308,
+ 1.8761250000000018,
+ 1.7685409999999706,
+ 1.7721250000000168,
+ 1.79362500000002,
+ 1.859041999999988,
+ 2.5788749999999823,
+ 3.092708000000016,
+ 1.8409999999999513
+ ],
+ "p50": 17.72999999999996,
+ "p95": 32.59945800000003,
+ "mainThread": {
+ "p50": 1.768792000000019,
+ "p95": 3.0402500000000146
+ },
+ "timer": {
+ "p50": 1.8761250000000018,
+ "p95": 16.92874999999998
+ },
+ "bytes": 35920
+ },
+ {
+ "side": "after",
+ "width": 1920,
+ "height": 1080,
+ "format": "png",
+ "raw": [
+ 17.352499999999964,
+ 17.580874999999992,
+ 18.08466599999997,
+ 18.169917000000055,
+ 18.811209000000076,
+ 17.411333000000013,
+ 17.31133299999999,
+ 17.41895800000009,
+ 17.257584000000065,
+ 17.275999999999954
+ ],
+ "synchronous": [
+ 1.6972920000000045,
+ 1.6755409999999529,
+ 1.7515409999999747,
+ 2.432792000000063,
+ 2.9321670000000495,
+ 1.6982920000000377,
+ 1.6839579999999614,
+ 1.7795419999999922,
+ 1.6829589999999826,
+ 1.6740409999999883
+ ],
+ "timerDelay": [
+ 1.790124999999989,
+ 1.749499999999955,
+ 2.001666,
+ 2.527500000000032,
+ 3.022250000000099,
+ 1.791166999999973,
+ 1.75,
+ 1.841542000000004,
+ 1.7407920000000559,
+ 1.718040999999971
+ ],
+ "p50": 17.41895800000009,
+ "p95": 18.811209000000076,
+ "mainThread": {
+ "p50": 1.6982920000000377,
+ "p95": 2.9321670000000495
+ },
+ "timer": {
+ "p50": 1.791166999999973,
+ "p95": 3.022250000000099
+ },
+ "bytes": 35920
+ },
+ {
+ "side": "before",
+ "width": 1920,
+ "height": 1080,
+ "format": "png",
+ "raw": [
+ 12.888249999999971,
+ 12.830124999999953,
+ 12.689416999999935,
+ 12.71508300000005,
+ 12.725833999999963,
+ 12.680165999999986,
+ 12.726958999999965,
+ 12.706209000000058,
+ 12.647500000000036,
+ 12.789084000000003
+ ],
+ "synchronous": [
+ 12.885999999999967,
+ 12.827792000000045,
+ 12.687833999999953,
+ 12.713791000000015,
+ 12.724874999999997,
+ 12.679291000000035,
+ 12.725999999999999,
+ 12.705459000000019,
+ 12.64650000000006,
+ 12.788209000000052
+ ],
+ "timerDelay": [
+ 12.917583000000036,
+ 13.616457999999966,
+ 12.833124999999995,
+ 12.734500000000025,
+ 12.749708999999939,
+ 12.701790999999957,
+ 15.872792000000004,
+ 12.7292920000001,
+ 12.668999999999983,
+ 12.813167000000021
+ ],
+ "p50": 12.725833999999963,
+ "p95": 12.888249999999971,
+ "mainThread": {
+ "p50": 12.724874999999997,
+ "p95": 12.885999999999967
+ },
+ "timer": {
+ "p50": 12.813167000000021,
+ "p95": 15.872792000000004
+ },
+ "bytes": 35922
+ },
+ {
+ "side": "before",
+ "width": 1920,
+ "height": 1080,
+ "format": "jpeg",
+ "raw": [
+ 4.357416999999941,
+ 4.3600830000000315,
+ 4.228417000000036,
+ 4.230625000000032,
+ 4.383624999999938,
+ 4.195625000000064,
+ 4.275624999999991,
+ 4.202791999999931,
+ 4.219708000000082,
+ 4.192040999999904
+ ],
+ "synchronous": [
+ 4.355749999999944,
+ 4.358457999999928,
+ 4.227499999999964,
+ 4.229874999999993,
+ 4.3826669999999694,
+ 4.194541000000072,
+ 4.2747909999999365,
+ 4.202083000000016,
+ 4.219125000000076,
+ 4.191582999999923
+ ],
+ "timerDelay": [
+ 4.391708999999992,
+ 4.654457999999977,
+ 4.8729170000000295,
+ 4.252582999999959,
+ 4.406624999999963,
+ 4.213416000000052,
+ 4.295749999999998,
+ 4.2227080000000115,
+ 4.243542000000048,
+ 4.209833000000003
+ ],
+ "p50": 4.230625000000032,
+ "p95": 4.383624999999938,
+ "mainThread": {
+ "p50": 4.229874999999993,
+ "p95": 4.3826669999999694
+ },
+ "timer": {
+ "p50": 4.295749999999998,
+ "p95": 4.8729170000000295
+ },
+ "bytes": 359127
+ },
+ {
+ "side": "after",
+ "width": 1920,
+ "height": 1080,
+ "format": "jpeg",
+ "raw": [
+ 4.18891700000006,
+ 4.109541999999919,
+ 4.140709000000015,
+ 4.130958000000078,
+ 4.1137919999999895,
+ 4.151791000000003,
+ 4.103791000000001,
+ 4.184374999999932,
+ 4.149874999999952,
+ 4.360416999999984
+ ],
+ "synchronous": [
+ 4.188041999999996,
+ 4.109041999999931,
+ 4.139999999999986,
+ 4.1304170000000795,
+ 4.113334000000009,
+ 4.15137500000003,
+ 4.103375000000028,
+ 4.182624999999916,
+ 4.149332999999956,
+ 4.359667000000059
+ ],
+ "timerDelay": [
+ 4.227250000000026,
+ 4.1303329999999505,
+ 4.159084000000007,
+ 4.148208000000068,
+ 4.1307919999999285,
+ 4.169250000000034,
+ 4.277041000000054,
+ 4.49695799999995,
+ 4.176166999999964,
+ 5.35470799999996
+ ],
+ "p50": 4.149874999999952,
+ "p95": 4.360416999999984,
+ "mainThread": {
+ "p50": 4.149332999999956,
+ "p95": 4.359667000000059
+ },
+ "timer": {
+ "p50": 4.176166999999964,
+ "p95": 5.35470799999996
+ },
+ "bytes": 359127
+ },
+ {
+ "side": "after",
+ "width": 1920,
+ "height": 1080,
+ "format": "jpeg",
+ "raw": [
+ 4.17612500000007,
+ 4.275375000000054,
+ 4.221333000000072,
+ 4.180915999999911,
+ 4.117042000000083,
+ 4.147375000000011,
+ 4.091083000000026,
+ 4.441459000000009,
+ 4.135874999999942,
+ 4.178207999999927
+ ],
+ "synchronous": [
+ 4.175125000000094,
+ 4.27475000000004,
+ 4.220666000000051,
+ 4.180207999999993,
+ 4.116624999999999,
+ 4.146958000000041,
+ 4.09050000000002,
+ 4.440917000000013,
+ 4.135415999999964,
+ 4.177542000000017
+ ],
+ "timerDelay": [
+ 4.225250000000074,
+ 4.2965410000000475,
+ 4.2466249999999945,
+ 4.200958000000014,
+ 4.136750000000006,
+ 4.166958000000022,
+ 4.108124999999973,
+ 4.462625000000003,
+ 4.154290999999944,
+ 4.197667000000024
+ ],
+ "p50": 4.178207999999927,
+ "p95": 4.441459000000009,
+ "mainThread": {
+ "p50": 4.177542000000017,
+ "p95": 4.440917000000013
+ },
+ "timer": {
+ "p50": 4.200958000000014,
+ "p95": 4.462625000000003
+ },
+ "bytes": 359127
+ },
+ {
+ "side": "before",
+ "width": 1920,
+ "height": 1080,
+ "format": "jpeg",
+ "raw": [
+ 4.145083999999997,
+ 4.193957999999952,
+ 4.088708999999994,
+ 4.208250000000021,
+ 4.164708000000019,
+ 4.275000000000091,
+ 4.247749999999996,
+ 4.207332999999949,
+ 4.208541000000082,
+ 4.213041999999859
+ ],
+ "synchronous": [
+ 4.1442089999999325,
+ 4.193125000000009,
+ 4.087791999999922,
+ 4.207333999999946,
+ 4.163791999999944,
+ 4.272874999999999,
+ 4.246999999999957,
+ 4.205707999999959,
+ 4.2075000000000955,
+ 4.2122089999998025
+ ],
+ "timerDelay": [
+ 4.188333999999941,
+ 4.214041999999949,
+ 4.106916999999953,
+ 4.227792000000022,
+ 4.182457999999997,
+ 4.305375000000026,
+ 4.454124999999976,
+ 4.230832999999961,
+ 4.616083000000003,
+ 4.24129199999993
+ ],
+ "p50": 4.208250000000021,
+ "p95": 4.275000000000091,
+ "mainThread": {
+ "p50": 4.207333999999946,
+ "p95": 4.272874999999999
+ },
+ "timer": {
+ "p50": 4.230832999999961,
+ "p95": 4.616083000000003
+ },
+ "bytes": 359127
+ },
+ {
+ "side": "before",
+ "width": 3840,
+ "height": 2160,
+ "format": "png",
+ "raw": [
+ 50.52841699999999,
+ 50.33845899999983,
+ 50.467625,
+ 50.489417,
+ 50.36029099999996,
+ 50.86550000000011,
+ 50.97745799999984,
+ 50.749250000000075,
+ 50.564167,
+ 50.504875000000084
+ ],
+ "synchronous": [
+ 50.51329200000009,
+ 50.33420899999987,
+ 50.46245900000008,
+ 50.485124999999925,
+ 50.356041000000005,
+ 50.861041000000114,
+ 50.97179199999982,
+ 50.74462500000004,
+ 50.55962499999987,
+ 50.50083399999994
+ ],
+ "timerDelay": [
+ 52.02337499999999,
+ 50.74358399999983,
+ 51.244500000000016,
+ 51.418916999999965,
+ 51.03233300000011,
+ 51.11412500000006,
+ 51.379249999999956,
+ 51.62908300000004,
+ 51.64974999999981,
+ 51.25125000000003
+ ],
+ "p50": 50.52841699999999,
+ "p95": 50.97745799999984,
+ "mainThread": {
+ "p50": 50.51329200000009,
+ "p95": 50.97179199999982
+ },
+ "timer": {
+ "p50": 51.379249999999956,
+ "p95": 52.02337499999999
+ },
+ "bytes": 141572
+ },
+ {
+ "side": "after",
+ "width": 3840,
+ "height": 2160,
+ "format": "png",
+ "raw": [
+ 67.62112500000012,
+ 70.66162499999996,
+ 65.66370799999982,
+ 66.11766700000021,
+ 65.52012500000001,
+ 65.30312499999991,
+ 65.75687500000004,
+ 65.93216699999994,
+ 65.96066599999995,
+ 65.37854200000038
+ ],
+ "synchronous": [
+ 8.756750000000011,
+ 12.168750000000045,
+ 7.642374999999902,
+ 7.327417000000196,
+ 7.253332999999884,
+ 7.037082999999939,
+ 7.163625000000138,
+ 7.756874999999582,
+ 7.332999999999629,
+ 7.321458000000348
+ ],
+ "timerDelay": [
+ 9.904666000000134,
+ 12.305000000000064,
+ 7.747790999999779,
+ 7.4340000000001965,
+ 7.359375,
+ 7.130208000000039,
+ 7.306375000000116,
+ 7.866957999999613,
+ 7.449374999999691,
+ 7.413833000000068
+ ],
+ "p50": 65.93216699999994,
+ "p95": 70.66162499999996,
+ "mainThread": {
+ "p50": 7.332999999999629,
+ "p95": 12.168750000000045
+ },
+ "timer": {
+ "p50": 7.449374999999691,
+ "p95": 12.305000000000064
+ },
+ "bytes": 141497
+ },
+ {
+ "side": "after",
+ "width": 3840,
+ "height": 2160,
+ "format": "png",
+ "raw": [
+ 65.41058299999986,
+ 64.92770799999971,
+ 65.47741600000018,
+ 65.208709,
+ 65.27920799999993,
+ 65.68795799999998,
+ 66.02895900000021,
+ 67.02504200000021,
+ 65.95004100000006,
+ 66.1332080000002
+ ],
+ "synchronous": [
+ 7.139290999999957,
+ 6.724957999999788,
+ 7.0768750000002,
+ 7.098583999999846,
+ 7.121916000000056,
+ 7.454874999999902,
+ 7.027042000000165,
+ 7.225917000000209,
+ 7.190583000000061,
+ 7.095749999999953
+ ],
+ "timerDelay": [
+ 7.2790829999999005,
+ 6.829624999999851,
+ 7.192290999999841,
+ 7.199374999999691,
+ 7.220416000000114,
+ 7.557874999999967,
+ 7.121917000000394,
+ 7.307999999999993,
+ 7.293707999999697,
+ 7.202333000000181
+ ],
+ "p50": 65.68795799999998,
+ "p95": 67.02504200000021,
+ "mainThread": {
+ "p50": 7.121916000000056,
+ "p95": 7.454874999999902
+ },
+ "timer": {
+ "p50": 7.220416000000114,
+ "p95": 7.557874999999967
+ },
+ "bytes": 141497
+ },
+ {
+ "side": "before",
+ "width": 3840,
+ "height": 2160,
+ "format": "png",
+ "raw": [
+ 51.586249999999836,
+ 50.56595800000014,
+ 50.44587499999989,
+ 50.72225000000026,
+ 50.41724999999997,
+ 50.63995900000009,
+ 50.72908400000006,
+ 50.452541999999994,
+ 50.561125000000175,
+ 50.50916700000016
+ ],
+ "synchronous": [
+ 51.58174999999983,
+ 50.56233299999985,
+ 50.441749999999956,
+ 50.719082999999955,
+ 50.415250000000015,
+ 50.63695899999993,
+ 50.725625000000036,
+ 50.44979199999989,
+ 50.5578330000003,
+ 50.50591700000041
+ ],
+ "timerDelay": [
+ 51.63195799999994,
+ 50.85474999999997,
+ 50.78333299999986,
+ 50.756041000000096,
+ 51.19404200000008,
+ 50.66879199999994,
+ 50.762416999999914,
+ 50.48124999999982,
+ 50.592167000000245,
+ 50.54083400000036
+ ],
+ "p50": 50.56595800000014,
+ "p95": 51.586249999999836,
+ "mainThread": {
+ "p50": 50.56233299999985,
+ "p95": 51.58174999999983
+ },
+ "timer": {
+ "p50": 50.762416999999914,
+ "p95": 51.63195799999994
+ },
+ "bytes": 141572
+ },
+ {
+ "side": "before",
+ "width": 3840,
+ "height": 2160,
+ "format": "jpeg",
+ "raw": [
+ 18.58337500000016,
+ 18.651792000000114,
+ 18.36908399999993,
+ 17.84083399999963,
+ 18.23354100000006,
+ 18.30391699999973,
+ 17.950459000000137,
+ 17.913041999999678,
+ 17.847208000000137,
+ 17.800332999999682
+ ],
+ "synchronous": [
+ 18.57791700000007,
+ 18.646708000000217,
+ 18.36424999999963,
+ 17.837333999999828,
+ 18.230375000000095,
+ 18.300416999999925,
+ 17.948709000000235,
+ 17.91137499999968,
+ 17.845332999999755,
+ 17.7981249999998
+ ],
+ "timerDelay": [
+ 18.648999999999887,
+ 19.0964170000002,
+ 20.715166999999838,
+ 17.8779999999997,
+ 18.269624999999905,
+ 18.339042000000063,
+ 17.98025000000007,
+ 17.93587499999967,
+ 17.878707999999733,
+ 17.833666999999878
+ ],
+ "p50": 18.23354100000006,
+ "p95": 18.651792000000114,
+ "mainThread": {
+ "p50": 18.230375000000095,
+ "p95": 18.646708000000217
+ },
+ "timer": {
+ "p50": 18.269624999999905,
+ "p95": 20.715166999999838
+ },
+ "bytes": 1643861
+ },
+ {
+ "side": "after",
+ "width": 3840,
+ "height": 2160,
+ "format": "jpeg",
+ "raw": [
+ 17.602458000000297,
+ 17.958000000000084,
+ 18.05212500000016,
+ 17.972167000000354,
+ 17.83954199999971,
+ 17.542125000000397,
+ 18.22241699999995,
+ 18.290666999999758,
+ 18.12741700000015,
+ 18.01233299999967
+ ],
+ "synchronous": [
+ 17.599750000000313,
+ 17.95633399999997,
+ 18.05133399999977,
+ 17.970291999999972,
+ 17.836833999999726,
+ 17.54058299999997,
+ 18.220084000000043,
+ 18.28945900000008,
+ 18.12525000000005,
+ 18.01062499999989
+ ],
+ "timerDelay": [
+ 17.64737500000001,
+ 17.983584000000064,
+ 18.077041999999892,
+ 18.00262500000008,
+ 18.2361249999999,
+ 20.49900000000025,
+ 18.253499999999804,
+ 18.319458999999824,
+ 18.1579999999999,
+ 18.043749999999818
+ ],
+ "p50": 18.01233299999967,
+ "p95": 18.290666999999758,
+ "mainThread": {
+ "p50": 18.01062499999989,
+ "p95": 18.28945900000008
+ },
+ "timer": {
+ "p50": 18.1579999999999,
+ "p95": 20.49900000000025
+ },
+ "bytes": 1643861
+ },
+ {
+ "side": "after",
+ "width": 3840,
+ "height": 2160,
+ "format": "jpeg",
+ "raw": [
+ 17.925208999999995,
+ 18.061875000000327,
+ 19.363459000000148,
+ 18.062917000000198,
+ 18.029875000000175,
+ 18.140292000000045,
+ 18.401708000000326,
+ 18.069166999999652,
+ 17.957499999999527,
+ 17.847999999999956
+ ],
+ "synchronous": [
+ 17.923041999999896,
+ 18.06012499999997,
+ 19.36183400000027,
+ 18.061749999999847,
+ 18.029083000000355,
+ 18.139125000000604,
+ 18.400540999999976,
+ 18.068249999999352,
+ 17.956374999999753,
+ 17.84675000000061
+ ],
+ "timerDelay": [
+ 17.97812500000009,
+ 18.09154099999978,
+ 19.38708400000087,
+ 18.084917000000132,
+ 18.055333000000246,
+ 18.164958000000297,
+ 18.426000000000386,
+ 18.10504200000014,
+ 17.98137499999939,
+ 17.87262499999997
+ ],
+ "p50": 18.062917000000198,
+ "p95": 19.363459000000148,
+ "mainThread": {
+ "p50": 18.061749999999847,
+ "p95": 19.36183400000027
+ },
+ "timer": {
+ "p50": 18.09154099999978,
+ "p95": 19.38708400000087
+ },
+ "bytes": 1643861
+ },
+ {
+ "side": "before",
+ "width": 3840,
+ "height": 2160,
+ "format": "jpeg",
+ "raw": [
+ 17.84845800000039,
+ 17.919459000000643,
+ 17.957500000000437,
+ 17.980458,
+ 18.131790999999794,
+ 18.08008400000017,
+ 18.065958000000137,
+ 18.055707999999868,
+ 17.982458000000406,
+ 18.03770799999984
+ ],
+ "synchronous": [
+ 17.846290999999837,
+ 17.917750000000524,
+ 17.956250000000182,
+ 17.978791000000456,
+ 18.12870799999928,
+ 18.077416999999514,
+ 18.06208300000071,
+ 18.053915999999845,
+ 17.980749999999716,
+ 18.036208000000443
+ ],
+ "timerDelay": [
+ 17.893165999999837,
+ 17.95008400000006,
+ 17.98700000000008,
+ 18.341041000000587,
+ 22.001290999999583,
+ 18.104959000000235,
+ 18.092000000000553,
+ 18.080582999999933,
+ 18.00566600000002,
+ 18.064290999999685
+ ],
+ "p50": 18.03770799999984,
+ "p95": 18.131790999999794,
+ "mainThread": {
+ "p50": 18.036208000000443,
+ "p95": 18.12870799999928
+ },
+ "timer": {
+ "p50": 18.080582999999933,
+ "p95": 22.001290999999583
+ },
+ "bytes": 1643861
+ },
+ {
+ "side": "before",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 100.16541700000016,
+ 100.22187500000018,
+ 99.96991700000035,
+ 99.67991700000039,
+ 99.51600000000053,
+ 99.63245800000004,
+ 99.50487499999963,
+ 99.46399999999994,
+ 99.71962499999972,
+ 99.8687089999994
+ ],
+ "synchronous": [
+ 100.15304199999991,
+ 100.21787500000028,
+ 99.96470899999986,
+ 99.67533300000014,
+ 99.51158300000043,
+ 99.62733299999945,
+ 99.50020799999947,
+ 99.4604159999999,
+ 99.71562499999982,
+ 99.86383399999977
+ ],
+ "timerDelay": [
+ 100.27466699999968,
+ 102.01729100000011,
+ 100.37512500000048,
+ 100.03233300000011,
+ 101.67520800000057,
+ 100.52141599999959,
+ 100.45629199999985,
+ 100.47291599999971,
+ 100.64179199999944,
+ 100.70687499999985
+ ],
+ "p50": 99.71962499999972,
+ "p95": 100.22187500000018,
+ "mainThread": {
+ "p50": 99.71562499999982,
+ "p95": 100.21787500000028
+ },
+ "timer": {
+ "p50": 100.52141599999959,
+ "p95": 102.01729100000011
+ },
+ "bytes": 279889
+ },
+ {
+ "side": "after",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 136.49074999999993,
+ 135.2970409999998,
+ 135.95349999999962,
+ 137.52366699999948,
+ 136.33520800000042,
+ 137.42774999999983,
+ 136.05537500000082,
+ 135.64808400000038,
+ 136.39937499999996,
+ 135.6627499999995
+ ],
+ "synchronous": [
+ 14.020249999999578,
+ 13.206500000000233,
+ 13.886833999999908,
+ 15.109958999999435,
+ 13.969583000000057,
+ 14.854874999999993,
+ 13.764542000000802,
+ 13.946834000000308,
+ 14.573957999999948,
+ 13.535458999999719
+ ],
+ "timerDelay": [
+ 15.527082999999948,
+ 13.323457999999846,
+ 14.015916999999718,
+ 15.24579199999971,
+ 14.0815419999999,
+ 14.982125000000451,
+ 13.879917000000205,
+ 14.063709000000017,
+ 14.680083000000195,
+ 13.64916699999958
+ ],
+ "p50": 136.33520800000042,
+ "p95": 137.52366699999948,
+ "mainThread": {
+ "p50": 13.969583000000057,
+ "p95": 15.109958999999435
+ },
+ "timer": {
+ "p50": 14.0815419999999,
+ "p95": 15.527082999999948
+ },
+ "bytes": 289381
+ },
+ {
+ "side": "after",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 138.57758399999966,
+ 135.234375,
+ 135.90641600000072,
+ 135.9812920000004,
+ 136.01320900000064,
+ 136.4722499999998,
+ 136.24341600000025,
+ 135.89766700000018,
+ 135.75366699999904,
+ 135.7194159999999
+ ],
+ "synchronous": [
+ 16.28704199999993,
+ 13.143167000000176,
+ 13.950041000000056,
+ 14.165500000000065,
+ 13.800250000000233,
+ 14.090332999999191,
+ 13.956750000000284,
+ 13.85870900000009,
+ 13.851999999998952,
+ 13.892041000000972
+ ],
+ "timerDelay": [
+ 16.440333999999893,
+ 13.245833999999377,
+ 14.068875000000844,
+ 14.282875000000786,
+ 13.901459000000614,
+ 14.213874999999462,
+ 14.059666000000107,
+ 13.962999999999738,
+ 13.97229200000038,
+ 14.008125000000291
+ ],
+ "p50": 135.9812920000004,
+ "p95": 138.57758399999966,
+ "mainThread": {
+ "p50": 13.950041000000056,
+ "p95": 16.28704199999993
+ },
+ "timer": {
+ "p50": 14.059666000000107,
+ "p95": 16.440333999999893
+ },
+ "bytes": 289381
+ },
+ {
+ "side": "before",
+ "width": 1600,
+ "height": 10000,
+ "format": "png",
+ "raw": [
+ 100.73624999999993,
+ 99.79433299999982,
+ 100.66154199999983,
+ 100.039084,
+ 98.85991699999977,
+ 99.68399999999929,
+ 99.53416599999946,
+ 100.23666599999888,
+ 99.67508300000009,
+ 99.68016700000044
+ ],
+ "synchronous": [
+ 100.73079199999847,
+ 99.7898750000004,
+ 100.65804199999911,
+ 100.03487499999937,
+ 98.85591699999895,
+ 99.68000000000029,
+ 99.5302499999998,
+ 100.23279099999854,
+ 99.67175000000134,
+ 99.67583299999933
+ ],
+ "timerDelay": [
+ 100.78987499999857,
+ 101.43625000000065,
+ 100.70108299999993,
+ 101.44529200000034,
+ 98.90204199999971,
+ 99.71899999999914,
+ 99.5680829999983,
+ 100.26766599999974,
+ 99.70620800000142,
+ 99.71658299999945
+ ],
+ "p50": 99.79433299999982,
+ "p95": 100.73624999999993,
+ "mainThread": {
+ "p50": 99.7898750000004,
+ "p95": 100.73079199999847
+ },
+ "timer": {
+ "p50": 100.26766599999974,
+ "p95": 101.44529200000034
+ },
+ "bytes": 279889
+ },
+ {
+ "side": "before",
+ "width": 1600,
+ "height": 10000,
+ "format": "jpeg",
+ "raw": [
+ 34.03358300000036,
+ 34.03770900000018,
+ 33.458708000000115,
+ 32.995709000000716,
+ 33.74720800000068,
+ 33.20287499999904,
+ 33.05999999999949,
+ 33.76087499999994,
+ 33.00149999999849,
+ 33.377042000000074
+ ],
+ "synchronous": [
+ 34.02866600000016,
+ 34.03349999999955,
+ 33.4548330000016,
+ 32.99325000000135,
+ 33.74358300000131,
+ 33.19949999999881,
+ 33.05583299999853,
+ 33.75683299999946,
+ 32.998624999998356,
+ 33.374416999999085
+ ],
+ "timerDelay": [
+ 34.09174999999959,
+ 34.41008399999919,
+ 37.47066700000141,
+ 33.02687500000138,
+ 33.780415999999605,
+ 33.232834000000366,
+ 33.09649999999965,
+ 33.799542000000656,
+ 33.035499999999956,
+ 33.407374999998865
+ ],
+ "p50": 33.458708000000115,
+ "p95": 34.03770900000018,
+ "mainThread": {
+ "p50": 33.4548330000016,
+ "p95": 34.03349999999955
+ },
+ "timer": {
+ "p50": 33.780415999999605,
+ "p95": 37.47066700000141
+ },
+ "bytes": 2573440
+ },
+ {
+ "side": "after",
+ "width": 1600,
+ "height": 10000,
+ "format": "jpeg",
+ "raw": [
+ 33.79033299999901,
+ 33.19800000000032,
+ 33.394874999999956,
+ 33.3125,
+ 33.20729199999914,
+ 33.83470800000032,
+ 32.64537500000006,
+ 33.88066699999945,
+ 33.61916700000074,
+ 32.941124999999374
+ ],
+ "synchronous": [
+ 33.78691599999911,
+ 33.19566599999962,
+ 33.391875000001164,
+ 33.310749999998734,
+ 33.20508399999926,
+ 33.83112500000061,
+ 32.643332999999984,
+ 33.878458999999566,
+ 33.617207999999664,
+ 32.93916700000045
+ ],
+ "timerDelay": [
+ 33.86958299999969,
+ 33.22791599999982,
+ 33.42737500000112,
+ 33.3391249999986,
+ 33.24162500000057,
+ 34.24466600000051,
+ 37.76537500000086,
+ 33.920749999999316,
+ 33.6583329999994,
+ 32.97716700000092
+ ],
+ "p50": 33.394874999999956,
+ "p95": 33.88066699999945,
+ "mainThread": {
+ "p50": 33.391875000001164,
+ "p95": 33.878458999999566
+ },
+ "timer": {
+ "p50": 33.6583329999994,
+ "p95": 37.76537500000086
+ },
+ "bytes": 2573440
+ },
+ {
+ "side": "after",
+ "width": 1600,
+ "height": 10000,
+ "format": "jpeg",
+ "raw": [
+ 33.372332999999344,
+ 33.32145900000069,
+ 33.00508300000001,
+ 33.5473750000001,
+ 33.275666999999885,
+ 33.3665830000009,
+ 34.28191700000025,
+ 35.34229199999936,
+ 34.15266700000029,
+ 34.148833000001105
+ ],
+ "synchronous": [
+ 33.3703749999986,
+ 33.31941700000061,
+ 33.0036659999987,
+ 33.54533300000003,
+ 33.27379199999996,
+ 33.36487500000112,
+ 34.27929200000108,
+ 35.33845800000017,
+ 34.150125000000116,
+ 34.14641599999959
+ ],
+ "timerDelay": [
+ 33.42633299999943,
+ 33.34966700000041,
+ 33.03399999999965,
+ 33.57974999999897,
+ 33.30616699999882,
+ 33.39695800000118,
+ 34.3415840000016,
+ 36.06987499999923,
+ 34.194666999999754,
+ 34.18470800000068
+ ],
+ "p50": 33.5473750000001,
+ "p95": 35.34229199999936,
+ "mainThread": {
+ "p50": 33.54533300000003,
+ "p95": 35.33845800000017
+ },
+ "timer": {
+ "p50": 33.57974999999897,
+ "p95": 36.06987499999923
+ },
+ "bytes": 2573440
+ },
+ {
+ "side": "before",
+ "width": 1600,
+ "height": 10000,
+ "format": "jpeg",
+ "raw": [
+ 34.083457999999155,
+ 34.63658299999952,
+ 33.47045900000012,
+ 33.76599999999962,
+ 33.70354100000077,
+ 33.94874999999956,
+ 33.42741700000079,
+ 33.74333300000035,
+ 33.430458000000726,
+ 33.61020899999858
+ ],
+ "synchronous": [
+ 34.07954099999915,
+ 34.63274999999885,
+ 33.4671670000007,
+ 33.76300000000083,
+ 33.69908300000134,
+ 33.94487499999923,
+ 33.42383300000074,
+ 33.73966600000131,
+ 33.42716600000131,
+ 33.607458999998926
+ ],
+ "timerDelay": [
+ 34.13462499999878,
+ 34.674957999999606,
+ 33.50658400000066,
+ 33.79591600000094,
+ 34.06087500000103,
+ 40.61870900000031,
+ 33.46116699999948,
+ 33.777625000000626,
+ 33.46366600000147,
+ 33.66033400000015
+ ],
+ "p50": 33.74333300000035,
+ "p95": 34.63658299999952,
+ "mainThread": {
+ "p50": 33.73966600000131,
+ "p95": 34.63274999999885
+ },
+ "timer": {
+ "p50": 33.79591600000094,
+ "p95": 40.61870900000031
+ },
+ "bytes": 2573440
+ }
+ ]
+}
\ No newline at end of file
diff --git a/docs/acceptance/region-next-startup-2026-10-29.json b/docs/acceptance/region-next-startup-2026-10-29.json
new file mode 100644
index 0000000000..1204d67b04
--- /dev/null
+++ b/docs/acceptance/region-next-startup-2026-10-29.json
@@ -0,0 +1,189 @@
+{
+ "generatedAt": "2026-10-29T07:19:58.585Z",
+ "platform": "darwin",
+ "arch": "arm64",
+ "candidate": "Batch three startup queries; rejected, production unchanged",
+ "scope": "Native process spawn + initial geometry snapshot, excluding Electron/system capture/overlay. Warm second query shown separately; no persistent helper proposed.",
+ "results": [
+ {
+ "side": "before",
+ "raw": [
+ 663.7456670000001,
+ 57.45587500000056,
+ 46.52520900000036,
+ 46.816084000000046,
+ 42.33050000000003,
+ 45.898708000000624,
+ 46.3568750000004,
+ 43.87316699999974,
+ 42.180333000000246,
+ 44.987833999999566,
+ 42.36987500000032,
+ 38.83491700000013,
+ 44.89245800000026,
+ 44.215541999999914,
+ 44.94004099999984
+ ],
+ "warm": [
+ 0.8507920000001832,
+ 0.9404589999994641,
+ 1.0128329999997732,
+ 0.7546659999998155,
+ 0.6218749999998181,
+ 0.6112080000002607,
+ 0.4609580000005735,
+ 0.6427909999993062,
+ 0.5714170000001104,
+ 0.6620839999995951,
+ 0.6610420000006343,
+ 1.8445409999994808,
+ 0.6144999999996799,
+ 0.811624999999367,
+ 0.9416250000003856
+ ],
+ "cold": {
+ "p50": 44.94004099999984,
+ "p95": 663.7456670000001
+ },
+ "queries": {
+ "p50": 0.6620839999995951,
+ "p95": 1.8445409999994808
+ }
+ },
+ {
+ "side": "after",
+ "raw": [
+ 504.6545419999993,
+ 53.738500000000386,
+ 47.857874999999694,
+ 46.42304100000001,
+ 44.01037500000075,
+ 44.39412500000071,
+ 42.077790999999706,
+ 48.05787499999951,
+ 47.418125000000146,
+ 47.54558300000008,
+ 42.63433299999997,
+ 39.890291000000616,
+ 45.60329200000069,
+ 45.396875000000364,
+ 44.58262500000001
+ ],
+ "warm": [
+ 0.9466670000001614,
+ 0.5752920000004451,
+ 0.6209999999991851,
+ 0.6170840000004318,
+ 0.6263749999998254,
+ 0.6239999999997963,
+ 0.6669590000001335,
+ 1.0148330000001806,
+ 0.8677499999994325,
+ 0.5614999999997963,
+ 0.6876249999995707,
+ 0.5270409999993717,
+ 0.6005409999997937,
+ 0.6680409999999029,
+ 0.6795830000000933
+ ],
+ "cold": {
+ "p50": 45.60329200000069,
+ "p95": 504.6545419999993
+ },
+ "queries": {
+ "p50": 0.6263749999998254,
+ "p95": 1.0148330000001806
+ }
+ },
+ {
+ "side": "after",
+ "raw": [
+ 44.766999999999825,
+ 42.662624999999935,
+ 42.69200000000001,
+ 43.59770800000024,
+ 38.727334000000155,
+ 47.3055830000003,
+ 44.825707999999395,
+ 41.35166699999991,
+ 42.359042000000045,
+ 45.59504200000083,
+ 46.06416699999954,
+ 44.61112499999945,
+ 41.79399999999987,
+ 47.74912500000028,
+ 42.56837499999983
+ ],
+ "warm": [
+ 0.6944999999996071,
+ 5.1200419999995574,
+ 0.6242919999995138,
+ 0.5156660000002375,
+ 0.6291670000000522,
+ 0.6501249999992069,
+ 0.5766249999996944,
+ 0.6291670000000522,
+ 0.6520000000000437,
+ 0.719333000000006,
+ 0.9121669999994992,
+ 0.9127499999995052,
+ 0.6462080000001151,
+ 4.865917000000081,
+ 0.6379170000000158
+ ],
+ "cold": {
+ "p50": 43.59770800000024,
+ "p95": 47.74912500000028
+ },
+ "queries": {
+ "p50": 0.6501249999992069,
+ "p95": 5.1200419999995574
+ }
+ },
+ {
+ "side": "before",
+ "raw": [
+ 46.88999999999942,
+ 41.38941699999941,
+ 40.41779199999928,
+ 46.32099999999991,
+ 44.84704199999942,
+ 45.162459000000126,
+ 42.59812500000044,
+ 44.33612499999981,
+ 44.60033300000032,
+ 41.27116699999988,
+ 41.364832999999635,
+ 44.35504200000014,
+ 41.64320800000041,
+ 45.78575000000001,
+ 45.17554199999995
+ ],
+ "warm": [
+ 0.5249579999999696,
+ 0.5939579999994749,
+ 0.640332999999373,
+ 0.5962079999999332,
+ 0.9381249999996726,
+ 0.6418749999993452,
+ 0.630500000000211,
+ 0.4890829999994821,
+ 0.749416999999994,
+ 0.6355839999996533,
+ 0.6319999999996071,
+ 0.7212920000001759,
+ 0.6494169999996302,
+ 0.7125839999998789,
+ 0.719333000000006
+ ],
+ "cold": {
+ "p50": 44.35504200000014,
+ "p95": 46.88999999999942
+ },
+ "queries": {
+ "p50": 0.640332999999373,
+ "p95": 0.9381249999996726
+ }
+ }
+ ]
+}
diff --git a/docs/acceptance/region-screenshot-next-performance-2026-10-29.md b/docs/acceptance/region-screenshot-next-performance-2026-10-29.md
new file mode 100644
index 0000000000..99d055c3bd
--- /dev/null
+++ b/docs/acceptance/region-screenshot-next-performance-2026-10-29.md
@@ -0,0 +1,110 @@
+# 截图工具第二轮逐项优化(2026-10-29)
+
+本轮在 macOS 选区修复、滚动匹配优化和 GIF Worker 已完成的工作区上继续优化。前后基准均包含上一轮改动,不将旧收益重复计入。本轮保留笔迹路径复用、采集帧减少复制、GIF 精确量化复用、大 PNG 异步编码;启动合并查询未改善冷启动,撤回。
+
+后续增量见 [Mac 按需编码实测](region-macos-demand-performance-2026-10-29.md):新增本地录制按请求编码,保存模块依赖改为仓库要求的静态加载。本页数字保留当时版本的实验结果,不把后续变化混入前后基线。
+
+环境:macOS 26.4 / arm64 / Apple M5,Electron 42.11.12 / Chromium 148.0.7778.280。性能采样与本任务类型检查、UI 验证分开执行。P50 为样本中位数,P95 为排序后第 ceil(N×0.95) 个值。
+
+## 1. 标注
+
+生产绘制入口 `drawAnnotations` 的笔迹曲线改为复用 `Path2D`,以不可变点数组为 WeakMap 键。移动、草稿更新会产生新数组,撤销重做可以复用旧路径;释放标注后缓存不保留它。绘制顺序、透明度、模糊、马赛克、导出路径及主题均保持原样。
+
+4K 画布,8 个模糊/马赛克区域、40 条各 500 点的笔迹,外加每次变化的荧光笔草稿。绘制指令提交 P50 **0.4→0.2ms**,P95 **0.5→0.3ms**。包括完整画布读取在内的耗时约 **17ms**,没有稳定改善,不能把提交耗时减半描述成整帧提速一倍。
+
+[标注专项原始数据](region-next-annotations-2026-10-29.json);[整套 Renderer 原始数据](region-next-renderer-2026-10-29.json)。验证包括透明输入、重叠荧光笔、边缘模糊、重排、撤销、移动、取样比例和源图变化;默认 Canvas 与频繁读回两种模式、1.5/0.75 倍缩放及分数偏移均与基线像素一致。
+
+未保留的方案:只缓存模糊/马赛克中间图没有稳定收益;整层位图复用及局部裁剪重绘在透明/模糊重叠处出现像素差异。没有放宽像素断言。
+
+## 2. macOS 采集帧处理
+
+删除相同尺寸的 `NativeImage.resize`;`toBitmap()` 已返回独立副本,完整 ArrayBuffer 直接建视图,避免复制第二遍。若返回的是切片或非 ArrayBuffer,则仍复制,防止 IPC 序列化带出选区之外的底层字节。
+
+| 阶段 | P50 前→后 | P95 前→后 |
+| --- | --- | --- |
+| 3200×2000 滚动选区的裁剪/像素准备 | 4.312→1.961ms | 4.564→2.704ms |
+| 1920×1080 视频选区,含整屏 JPEG 解码 | 25.105→24.238ms | 26.403→24.632ms |
+
+滚动帧每次少一次 **25.6MB** 的显式像素复制;这不是整个应用峰值内存下降 25.6MB 的测量。视频收益远小于滚动帧,整屏 JPEG 解码仍占主要开销。小/大 GIF 选区批次波动,未宣称稳定提速。
+
+[原始数据](region-next-native-2026-10-29.json)中 `capture` 是最终采集实现;其中 `save` 是被弃用的初始 PNG 参数实验,最终保存数据见第 5 节。该基准用真实生产 `captureLiveRegion` / `RegionVideoCapture` 与 Electron NativeImage,源图为合成图,替换系统采集与 helper。包含 4K JPEG 解码、裁剪、缩放与 BGRA 提取,不包含真实系统抓屏、跨进程 IPC 和磁盘。
+
+前后每个返回像素逐字节相等,另补[透明像素与混合 DPI 对照](region-next-native-parity-2026-10-29.json)。没有改 30fps 原生采集配置、录制采样周期或取帧顺序,也没有先裁剪再压缩;因此不引入录制帧时刻和压缩边缘变化。
+
+## 3. 截图启动:实验撤回
+
+尝试把窗口列表、前台进程和屏幕刘海信息合并到一次 helper 响应。真实启动原生进程,前后各 30 次、交替批次:
+
+| 指标 | P50 前→候选 | P95 前→候选 |
+| --- | --- | --- |
+| 新进程启动到快照完成 | 44.724→44.689ms | 57.456→53.739ms |
+| 已启动进程的第二次查询 | 0.646→0.648ms | 1.013→4.866ms |
+
+冷启动中位数基本不变;第二次查询也都在约 0.65ms,不值得扩大协议和生命周期复杂度。候选已撤回,原先并行抓屏和查询、窗口预热、会话结束即释放 helper 的策略不变。原始批次包含数百毫秒离群值,没有剔除。
+
+[原始数据](region-next-startup-2026-10-29.json)。`benchmark-region-startup.mjs` 在临时目录重建这个被撤回的候选,生产源码不包含合并查询。这不是完整截图打开的前后对比:没有计时系统抓屏与浮层打开,不声称整次截图已缩短。
+
+## 4. GIF 真实编码计算
+
+gifenc 的 rgb444 量化输入由每个颜色分组的计数、R/G/B 整数总和决定。只有 **4096 组的全部 16384 个整数完全相等**才复用量化结果,不用 hash 判等,不近似共享调色板。每一变化帧仍调用原始 `applyPalette` 和 GIF 编码器,保持颜色首次出现顺序的映射行为。逐字节相同帧的合并、暂停、时长与循环规则保持不变。
+
+每个编码器增加两份 64KiB 的统计数组,共 **128KiB**,只在本次 Worker 生命周期内保留。
+
+| 960×540 输入,各版本 60 帧 | P50 前→后 | P95 前→后 |
+| --- | --- | --- |
+| 颜色分布完全相同、颜色位置连续移动 | 114.25→15.90ms | 120.90→19.40ms |
+| 高色纹理中小白块移动,颜色统计持续变化 | 114.80→115.10ms | 123.20→129.70ms |
+
+第一种是可命中场景,计算等待降低约 **86.1%**;第二种没有稳定收益,并付出统计扫描开销,不能把前者推广到任意录屏。两者包含首帧量化和 Worker 启动,不预热 GIF;主线程仍约 0.5ms/帧。本表不包含系统抓屏、JPEG 解码和 IPC,不能推断真实录制帧率。
+
+[原始数据](region-next-renderer-2026-10-29.json)的 `gifMotion` / `pipeline`。移动序列前后均为 18,438,016 字节,完整流校验值一致;另在单测中将空间移动、同组 RGB 总和变化、alpha 变化和暂停后的完整 GIF 字节,与每帧重新量化的独立基准逐字节对比。Electron Worker 小动画继续验证全部 4,634 字节及独立解码的 5 帧 RGBA、230/140/110/210/120ms 时长和循环属性一致。
+
+## 5. 大图 PNG 保存
+
+只对至少 200 万像素、完全不透明的 PNG 使用已有 sharp/libvips 后台线程池;在自有 `toBitmap()` 副本上原地交换 BGRA/RGBA。采用无损 PNG,移除已确认全为 255 的 alpha 通道。透明图、小图、JPEG 保持 Electron 原编码;可选原生库加载或编码失败也回到原路径。磁盘仍只写用户在原生保存框选择的位置,取消不编码、不写文件。没有修改媒体入仓、复制或交给新任务的路径。
+
+| PNG 尺寸 | 主线程同步 P50 前→后 | 同步 P95 前→后 | 总编码 P50 前→后 |
+| --- | --- | --- | --- |
+| 1920×1080 | 12.725→1.705ms | 13.009→2.986ms | 12.726→17.467ms |
+| 3840×2160 | 50.536→7.208ms | 50.972→8.757ms | 50.545→65.722ms |
+| 1600×10000 | 99.698→13.948ms | 100.658→15.110ms | 99.702→135.997ms |
+
+这是**降低主线程阻塞约 86%**的取舍,总编码时间增加约 5/15/36ms。零延时定时器探针也确认 4K 的 P50 响应延迟由 51.073 降为 7.307ms、长图由 100.465 降为 14.062ms;不是实际鼠标到屏幕的呈现延迟。
+
+[最终保存原始数据](region-next-save-2026-10-29.json)。每个尺寸/格式/版本 20 个新建 NativeImage,避免 `toPNG()` 的已有编码缓存掩盖首次编码成本。包含异步库首次加载,未过滤首个样本。源图为确定性的高压缩比合成图,不代表所有照片内容。
+
+PNG 文件字节不是相同的压缩流,但 Electron 独立解码后的全部 BGRA 像素相同。对应文件大小为 35,922→35,920、141,572→141,497、279,889→289,381 字节;长图约增加 3.4%。透明 PNG 和 JPEG 的编码字节保持相同。默认 PNG 参数曾导致文件明显变大,已经弃用,没有隐去该实验。
+
+内存另用两个隔离 Electron 进程,分别连续处理 20 次 1600×10000 PNG,用 macOS `/usr/bin/time -l` 记录峰值 RSS:**740.8→721.2MiB**([前](region-next-memory-before-2026-10-29.json) / [后](region-next-memory-after-2026-10-29.json))。包含合成图、NativeImage 和编码器缓存,且各版本只有一次进程级采样;没有据此声称实际 Cindy 峰值内存下降。新增异步路径仍需要自有像素副本和 libvips 工作内存。
+
+## 验证与范围
+
+- 相关单测 11 文件、125 项通过,1.82s。新增 `encodeImage.test.ts` 4 项单独运行 2.28s;验证真实 PNG 编码像素、透明/小图/JPEG 保持原路径以及可选编码器失败回退。`liveCapture.test.ts` 增加底层切片不得跨 IPC 暴露的结果验证;GIF 补精确统计复用和失效的字节对照。均为 unit,不做真实等待或文件 I/O。
+- Chromium Light / Dark 全部 16/16 通过,63.7s,包含真实 Worker、GIF/WebM 录制、暂停、预览、导出与独立解码。帧来源与保存接收端为 fixture,不等同于真实系统采集或原生保存框验收。
+- Electron 离屏 UI 为 12/16;其余为此前已在 HEAD 基线复现的 WebM 预览超时和 GIF `Target.createTarget: Not supported`。没有标成通过,已由 Chromium 补验。已查看本地 overview 与播放图,没有上传截图。
+- 定向 ESLint、test-hygiene、dev-docs、diff 空白检查通过。Desktop 类型检查通过(首轮发现测试替身类型和 ArrayBuffer 类型边界,修复后重跑通过);修正后的 10 项采集/PNG 单测再次通过。
+- 未实测 Windows、真实系统采集下的五分钟录制、混合 DPI 实体显示器。Windows helper 主路径保持不变,共用回退路径有单测;不把 Mac 数据当成 Windows 验收。
+- 本轮没有提交、推送或发布,也没有替换用户安装版。
+
+## 复现增量基线
+
+增量基线是 HEAD `8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0` 加上一轮已完成改动。其[生产源码差异补丁](region-next-baseline-2026-10-29.patch)已保存;在临时目录从 HEAD 解包后应用补丁,验证重建的所有源文件与本轮开始前快照逐字节相同。它仅用于显式基准,不是产品要应用的补丁。
+
+```sh
+repo_root="$PWD"
+perf_baseline=$(mktemp -d "${TMPDIR:-/tmp}/cindy-perf-baseline.XXXXXX")
+git archive 8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0 apps/desktop/src/renderer/features/region-screenshot apps/desktop/src/shared/scrollCapture.ts apps/desktop/native/remote-desktop/macos-capture.m apps/desktop/native/region-screenshot/macos-snapshot.swift apps/desktop/src/main/region-screenshot | tar -x -C "$perf_baseline"
+git -C "$perf_baseline" apply --no-index "$repo_root/docs/acceptance/region-next-baseline-2026-10-29.patch"
+cat > "$perf_baseline/baseline.json" <<'JSON'
+{"head":"8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0","description":"Working tree after GIF Worker optimization, before this round"}
+JSON
+node apps/desktop/scripts/benchmark-region-screenshot.mjs --baseline-dir="$perf_baseline" --samples=30
+node apps/desktop/scripts/benchmark-region-screenshot.mjs --baseline-dir="$perf_baseline" --only=annotations --samples=30
+node apps/desktop/scripts/benchmark-region-native.mjs --baseline-dir="$perf_baseline"
+node apps/desktop/scripts/benchmark-region-startup.mjs --baseline-dir="$perf_baseline"
+node apps/desktop/scripts/benchmark-region-native.mjs --baseline-dir="$perf_baseline" --only=save --memory=true --side=before
+node apps/desktop/scripts/benchmark-region-native.mjs --baseline-dir="$perf_baseline" --only=save --memory=true --side=after
+rm -rf "$perf_baseline"
+```
+
+计时运行不要与本任务其它检查并发。各脚本支持 `--output=<路径>` 保存 JSON;运行器自建的 profile、bundle、原生候选和中间文件均在唯一临时目录,结束清理。benchmark/E2E 不进入默认单测。设计依据为 `docs/design-rules/DESIGN.md` §14.4;测试价值与预算依据为 `docs/dev-rules/engineering-conventions.md` §3.2。
diff --git a/docs/acceptance/region-screenshot-performance-macos-2026-10-29.json b/docs/acceptance/region-screenshot-performance-macos-2026-10-29.json
new file mode 100644
index 0000000000..32240d4645
--- /dev/null
+++ b/docs/acceptance/region-screenshot-performance-macos-2026-10-29.json
@@ -0,0 +1,2368 @@
+{
+ "generatedAt": "2026-10-29T05:54:25.427Z",
+ "baseline": "8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0",
+ "samples": 30,
+ "platform": "darwin",
+ "arch": "arm64",
+ "cpu": "Apple M5",
+ "scope": "Real Electron offscreen renderer (1040x760 DIP, 2x density), synthetic opaque BGRA source at the stated dimensions. Excludes OS capture, native window startup, IPC serialization, clipboard and disk. 3 warmups per screenshot/scroll batch; GIF streams include their first frame. Alternating before/after batches. First-paint timing includes two animation frames and is sensitive to vsync/GC. Pipeline probes use production scroll matching and GIF encoding; hover probes count real pointer-driven canvas size assignments; they do not measure presentation latency or allocated memory.",
+ "results": [
+ {
+ "width": 1920,
+ "height": 1080,
+ "scale": 1,
+ "before": {
+ "beginSyncMs": {
+ "p50": 3,
+ "p95": 4.5
+ },
+ "paintedMs": {
+ "p50": 33.4,
+ "p95": 34.5
+ },
+ "exportMs": {
+ "p50": 3,
+ "p95": 4.4
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 3.5,
+ "paintedMs": 33.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 3.6999999284744263
+ },
+ {
+ "syncMs": 2.5,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 4.5,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 4.399999976158142
+ },
+ {
+ "syncMs": 5,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 4.399999976158142
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.799999952316284,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 3.899999976158142
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 34.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.89999997615814,
+ "frameWrites": 1,
+ "exportMs": 3.1999999284744263
+ },
+ {
+ "syncMs": 3.200000047683716,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 3.0999999046325684
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.600000023841858
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 34.5,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 3.600000023841858
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 35,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.5,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 3.399999976158142
+ },
+ {
+ "syncMs": 4.199999928474426,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 3.899999976158142
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 34.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 4.100000023841858
+ },
+ {
+ "syncMs": 2.700000047683716,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 4.799999952316284
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.799999952316284,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 3.5,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 34.10000002384186,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 3.600000023841858,
+ "paintedMs": 34.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 3.399999976158142
+ },
+ {
+ "syncMs": 2.9000000953674316,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 3.100000023841858
+ }
+ ]
+ },
+ "after": {
+ "beginSyncMs": {
+ "p50": 2.9,
+ "p95": 4.7
+ },
+ "paintedMs": {
+ "p50": 33.4,
+ "p95": 33.6
+ },
+ "exportMs": {
+ "p50": 2.9,
+ "p95": 4.8
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 3.299999952316284,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 3.600000023841858
+ },
+ {
+ "syncMs": 2.600000023841858,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 4.699999928474426,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 4.199999928474426
+ },
+ {
+ "syncMs": 4.799999952316284,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 5.600000023841858
+ },
+ {
+ "syncMs": 2.8000000715255737,
+ "paintedMs": 33.60000002384186,
+ "frameWrites": 1,
+ "exportMs": 2.600000023841858
+ },
+ {
+ "syncMs": 2.6999999284744263,
+ "paintedMs": 33.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 2.6999999284744263,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.700000047683716
+ },
+ {
+ "syncMs": 3.200000047683716,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 4.399999976158142
+ },
+ {
+ "syncMs": 3.5,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 3.3000000715255737,
+ "paintedMs": 33.60000002384186,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.899999976158142
+ },
+ {
+ "syncMs": 3.1999999284744263,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 3.5,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 3.799999952316284
+ },
+ {
+ "syncMs": 2.700000047683716,
+ "paintedMs": 33.60000002384186,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 2.5,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 4.399999976158142
+ },
+ {
+ "syncMs": 2.5,
+ "paintedMs": 33.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 4.799999952316284
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.799999952316284
+ },
+ {
+ "syncMs": 2.799999952316284,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 3.100000023841858,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 3.1999999284744263
+ },
+ {
+ "syncMs": 3,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 3.299999952316284
+ },
+ {
+ "syncMs": 3.5,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.9000000953674316
+ },
+ {
+ "syncMs": 2.700000047683716,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 3
+ },
+ {
+ "syncMs": 3.3000000715255737,
+ "paintedMs": 33.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 2.799999952316284,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.8000000715255737
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 2.9000000953674316
+ },
+ {
+ "syncMs": 2.899999976158142,
+ "paintedMs": 33.5,
+ "frameWrites": 1,
+ "exportMs": 3.200000047683716
+ }
+ ]
+ }
+ },
+ {
+ "width": 3840,
+ "height": 2160,
+ "scale": 2,
+ "before": {
+ "beginSyncMs": {
+ "p50": 7.8,
+ "p95": 9.2
+ },
+ "paintedMs": {
+ "p50": 21.1,
+ "p95": 25.6
+ },
+ "exportMs": {
+ "p50": 9.25,
+ "p95": 13.8
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 8.899999976158142,
+ "paintedMs": 26.5,
+ "frameWrites": 1,
+ "exportMs": 13
+ },
+ {
+ "syncMs": 9.199999928474426,
+ "paintedMs": 17.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 13.399999976158142
+ },
+ {
+ "syncMs": 7.300000071525574,
+ "paintedMs": 13.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 9.900000095367432
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 11.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 9
+ },
+ {
+ "syncMs": 11.699999928474426,
+ "paintedMs": 19.59999990463257,
+ "frameWrites": 1,
+ "exportMs": 7.800000071525574
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 22.90000009536743,
+ "frameWrites": 1,
+ "exportMs": 9.399999976158142
+ },
+ {
+ "syncMs": 7.800000071525574,
+ "paintedMs": 19.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 9.100000023841858
+ },
+ {
+ "syncMs": 7.900000095367432,
+ "paintedMs": 21.5,
+ "frameWrites": 1,
+ "exportMs": 9.200000047683716
+ },
+ {
+ "syncMs": 7.599999904632568,
+ "paintedMs": 20.09999990463257,
+ "frameWrites": 1,
+ "exportMs": 9.800000071525574
+ },
+ {
+ "syncMs": 7.800000071525574,
+ "paintedMs": 20,
+ "frameWrites": 1,
+ "exportMs": 8.800000071525574
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 21,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.400000095367432,
+ "paintedMs": 22.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 9.300000071525574
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 20.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 22.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 9.899999976158142
+ },
+ {
+ "syncMs": 9.099999904632568,
+ "paintedMs": 25.59999990463257,
+ "frameWrites": 1,
+ "exportMs": 13.899999976158142
+ },
+ {
+ "syncMs": 8,
+ "paintedMs": 15.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 13.799999952316284
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 14.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 10.200000047683716
+ },
+ {
+ "syncMs": 7.400000095367432,
+ "paintedMs": 25.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 9.5
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 20.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 9
+ },
+ {
+ "syncMs": 7.799999952316284,
+ "paintedMs": 21.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 9.800000071525574
+ },
+ {
+ "syncMs": 8.399999976158142,
+ "paintedMs": 20,
+ "frameWrites": 1,
+ "exportMs": 8.699999928474426
+ },
+ {
+ "syncMs": 7.799999952316284,
+ "paintedMs": 21.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.799999952316284
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 22,
+ "frameWrites": 1,
+ "exportMs": 9.399999976158142
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 20.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 22,
+ "frameWrites": 1,
+ "exportMs": 8.699999928474426
+ },
+ {
+ "syncMs": 7.800000071525574,
+ "paintedMs": 22,
+ "frameWrites": 1,
+ "exportMs": 9.700000047683716
+ },
+ {
+ "syncMs": 8.299999952316284,
+ "paintedMs": 20.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 7.700000047683716,
+ "paintedMs": 22.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 9.200000047683716
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 21.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 10.700000047683716
+ }
+ ]
+ },
+ "after": {
+ "beginSyncMs": {
+ "p50": 7.6,
+ "p95": 9.1
+ },
+ "paintedMs": {
+ "p50": 21.6,
+ "p95": 26.2
+ },
+ "exportMs": {
+ "p50": 9.05,
+ "p95": 13.9
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 8.899999976158142,
+ "paintedMs": 26.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 13.899999976158142
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 16.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 13.5
+ },
+ {
+ "syncMs": 7.400000095367432,
+ "paintedMs": 15.400000095367432,
+ "frameWrites": 1,
+ "exportMs": 9.699999928474426
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 10.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.799999952316284
+ },
+ {
+ "syncMs": 8,
+ "paintedMs": 20.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 9
+ },
+ {
+ "syncMs": 7.699999928474426,
+ "paintedMs": 22.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 9.5
+ },
+ {
+ "syncMs": 9.100000023841858,
+ "paintedMs": 20.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 9
+ },
+ {
+ "syncMs": 7.900000095367432,
+ "paintedMs": 21.5,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 9.5
+ },
+ {
+ "syncMs": 8.599999904632568,
+ "paintedMs": 21,
+ "frameWrites": 1,
+ "exportMs": 8.800000071525574
+ },
+ {
+ "syncMs": 7.799999952316284,
+ "paintedMs": 22.09999990463257,
+ "frameWrites": 1,
+ "exportMs": 8.800000071525574
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 22.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 9.600000023841858
+ },
+ {
+ "syncMs": 8.400000095367432,
+ "paintedMs": 21.40000009536743,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 22.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.900000095367432
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 22.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 9.199999928474426
+ },
+ {
+ "syncMs": 9.100000023841858,
+ "paintedMs": 26.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 14
+ },
+ {
+ "syncMs": 7.699999928474426,
+ "paintedMs": 15.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 13.899999976158142
+ },
+ {
+ "syncMs": 7.300000071525574,
+ "paintedMs": 14.5,
+ "frameWrites": 1,
+ "exportMs": 9.600000023841858
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 24.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.899999976158142
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 21.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 8.899999976158142
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 20.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 9.399999976158142
+ },
+ {
+ "syncMs": 8,
+ "paintedMs": 20.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 8.600000023841858
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 22.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 8.5
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 22.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 9.700000047683716
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 20,
+ "frameWrites": 1,
+ "exportMs": 8.700000047683716
+ },
+ {
+ "syncMs": 7.600000023841858,
+ "paintedMs": 21.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 8.899999976158142
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 21.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 9.399999976158142
+ },
+ {
+ "syncMs": 7.399999976158142,
+ "paintedMs": 20.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 9.099999904632568
+ },
+ {
+ "syncMs": 7.899999976158142,
+ "paintedMs": 22.5,
+ "frameWrites": 1,
+ "exportMs": 8.899999976158142
+ },
+ {
+ "syncMs": 7.5,
+ "paintedMs": 21.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 9.600000023841858
+ }
+ ]
+ }
+ },
+ {
+ "width": 1600,
+ "height": 10000,
+ "scale": 2,
+ "before": {
+ "beginSyncMs": {
+ "p50": 14.75,
+ "p95": 15.9
+ },
+ "paintedMs": {
+ "p50": 29.55,
+ "p95": 32.8
+ },
+ "exportMs": {
+ "p50": 17.55,
+ "p95": 26.7
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 15.899999976158142,
+ "paintedMs": 26.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 26.699999928474426
+ },
+ {
+ "syncMs": 14.899999976158142,
+ "paintedMs": 18.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 25.299999952316284
+ },
+ {
+ "syncMs": 13.599999904632568,
+ "paintedMs": 17.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 18.5
+ },
+ {
+ "syncMs": 14.600000023841858,
+ "paintedMs": 27.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 16.300000071525574
+ },
+ {
+ "syncMs": 13.599999904632568,
+ "paintedMs": 17,
+ "frameWrites": 1,
+ "exportMs": 18.399999976158142
+ },
+ {
+ "syncMs": 15,
+ "paintedMs": 25.59999990463257,
+ "frameWrites": 1,
+ "exportMs": 15.700000047683716
+ },
+ {
+ "syncMs": 15.100000023841858,
+ "paintedMs": 30.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 16.299999952316284
+ },
+ {
+ "syncMs": 15,
+ "paintedMs": 30,
+ "frameWrites": 1,
+ "exportMs": 15.799999952316284
+ },
+ {
+ "syncMs": 15.199999928474426,
+ "paintedMs": 30.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 15.800000071525574
+ },
+ {
+ "syncMs": 15.600000023841858,
+ "paintedMs": 29.90000009536743,
+ "frameWrites": 1,
+ "exportMs": 15.699999928474426
+ },
+ {
+ "syncMs": 13.300000071525574,
+ "paintedMs": 16.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 17.5
+ },
+ {
+ "syncMs": 14.799999952316284,
+ "paintedMs": 28.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 17.600000023841858
+ },
+ {
+ "syncMs": 14.700000047683716,
+ "paintedMs": 28.5,
+ "frameWrites": 1,
+ "exportMs": 15.299999952316284
+ },
+ {
+ "syncMs": 13.299999952316284,
+ "paintedMs": 15.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 16.199999928474426
+ },
+ {
+ "syncMs": 15.899999976158142,
+ "paintedMs": 29.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.300000071525574
+ },
+ {
+ "syncMs": 16.600000023841858,
+ "paintedMs": 31.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 27.299999952316284
+ },
+ {
+ "syncMs": 14.700000047683716,
+ "paintedMs": 17.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 26.700000047683716
+ },
+ {
+ "syncMs": 15.199999928474426,
+ "paintedMs": 32.799999952316284,
+ "frameWrites": 1,
+ "exportMs": 17.899999976158142
+ },
+ {
+ "syncMs": 14.299999952316284,
+ "paintedMs": 29.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 18
+ },
+ {
+ "syncMs": 15.5,
+ "paintedMs": 42.39999997615814,
+ "frameWrites": 1,
+ "exportMs": 19.59999990463257
+ },
+ {
+ "syncMs": 14.5,
+ "paintedMs": 27.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 17.600000023841858
+ },
+ {
+ "syncMs": 14.299999952316284,
+ "paintedMs": 29.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 17.700000047683716
+ },
+ {
+ "syncMs": 15.100000023841858,
+ "paintedMs": 29.5,
+ "frameWrites": 1,
+ "exportMs": 17.799999952316284
+ },
+ {
+ "syncMs": 15.599999904632568,
+ "paintedMs": 28.899999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.899999976158142
+ },
+ {
+ "syncMs": 14.399999976158142,
+ "paintedMs": 32.09999990463257,
+ "frameWrites": 1,
+ "exportMs": 17.100000023841858
+ },
+ {
+ "syncMs": 15.800000071525574,
+ "paintedMs": 30,
+ "frameWrites": 1,
+ "exportMs": 16.40000009536743
+ },
+ {
+ "syncMs": 14.399999976158142,
+ "paintedMs": 30.5,
+ "frameWrites": 1,
+ "exportMs": 18
+ },
+ {
+ "syncMs": 14.700000047683716,
+ "paintedMs": 29.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 15.699999928474426
+ },
+ {
+ "syncMs": 14.599999904632568,
+ "paintedMs": 32.09999990463257,
+ "frameWrites": 1,
+ "exportMs": 17.399999976158142
+ },
+ {
+ "syncMs": 14.200000047683716,
+ "paintedMs": 30.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 17.699999928474426
+ }
+ ]
+ },
+ "after": {
+ "beginSyncMs": {
+ "p50": 14.55,
+ "p95": 16.2
+ },
+ "paintedMs": {
+ "p50": 29.65,
+ "p95": 31.5
+ },
+ "exportMs": {
+ "p50": 16.4,
+ "p95": 26.7
+ },
+ "frameWrites": 1,
+ "raw": [
+ {
+ "syncMs": 13.799999952316284,
+ "paintedMs": 24.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 17.199999928474426
+ },
+ {
+ "syncMs": 14.600000023841858,
+ "paintedMs": 29.699999928474426,
+ "frameWrites": 1,
+ "exportMs": 25.200000047683716
+ },
+ {
+ "syncMs": 13.900000095367432,
+ "paintedMs": 21.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 26.699999928474426
+ },
+ {
+ "syncMs": 14.800000071525574,
+ "paintedMs": 20.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 15.699999928474426
+ },
+ {
+ "syncMs": 16.300000071525574,
+ "paintedMs": 30.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 15.800000071525574
+ },
+ {
+ "syncMs": 15.199999928474426,
+ "paintedMs": 30.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.399999976158142
+ },
+ {
+ "syncMs": 14,
+ "paintedMs": 15.599999904632568,
+ "frameWrites": 1,
+ "exportMs": 16.299999952316284
+ },
+ {
+ "syncMs": 15.5,
+ "paintedMs": 29.700000047683716,
+ "frameWrites": 1,
+ "exportMs": 15.599999904632568
+ },
+ {
+ "syncMs": 14.399999976158142,
+ "paintedMs": 31.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 17.200000047683716
+ },
+ {
+ "syncMs": 13.599999904632568,
+ "paintedMs": 30.09999990463257,
+ "frameWrites": 1,
+ "exportMs": 17.199999928474426
+ },
+ {
+ "syncMs": 15,
+ "paintedMs": 29.200000047683716,
+ "frameWrites": 1,
+ "exportMs": 15.399999976158142
+ },
+ {
+ "syncMs": 14.799999952316284,
+ "paintedMs": 31.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 15.600000023841858
+ },
+ {
+ "syncMs": 14.5,
+ "paintedMs": 31.5,
+ "frameWrites": 1,
+ "exportMs": 16
+ },
+ {
+ "syncMs": 15,
+ "paintedMs": 30.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 15.700000047683716
+ },
+ {
+ "syncMs": 13.5,
+ "paintedMs": 17,
+ "frameWrites": 1,
+ "exportMs": 18.200000047683716
+ },
+ {
+ "syncMs": 13.700000047683716,
+ "paintedMs": 26.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 18.300000071525574
+ },
+ {
+ "syncMs": 15.399999976158142,
+ "paintedMs": 28.800000071525574,
+ "frameWrites": 1,
+ "exportMs": 24.800000071525574
+ },
+ {
+ "syncMs": 14.5,
+ "paintedMs": 21.100000023841858,
+ "frameWrites": 1,
+ "exportMs": 26.699999928474426
+ },
+ {
+ "syncMs": 14,
+ "paintedMs": 21.5,
+ "frameWrites": 1,
+ "exportMs": 15.5
+ },
+ {
+ "syncMs": 16.199999928474426,
+ "paintedMs": 29.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 15.099999904632568
+ },
+ {
+ "syncMs": 13.899999976158142,
+ "paintedMs": 16,
+ "frameWrites": 1,
+ "exportMs": 16.5
+ },
+ {
+ "syncMs": 15.799999952316284,
+ "paintedMs": 29.5,
+ "frameWrites": 1,
+ "exportMs": 15.100000023841858
+ },
+ {
+ "syncMs": 14.600000023841858,
+ "paintedMs": 31,
+ "frameWrites": 1,
+ "exportMs": 15.5
+ },
+ {
+ "syncMs": 13.5,
+ "paintedMs": 32.10000002384186,
+ "frameWrites": 1,
+ "exportMs": 16.700000047683716
+ },
+ {
+ "syncMs": 15.300000071525574,
+ "paintedMs": 30.399999976158142,
+ "frameWrites": 1,
+ "exportMs": 15.300000071525574
+ },
+ {
+ "syncMs": 15.100000023841858,
+ "paintedMs": 29.600000023841858,
+ "frameWrites": 1,
+ "exportMs": 17.399999976158142
+ },
+ {
+ "syncMs": 13.799999952316284,
+ "paintedMs": 30.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 17.700000047683716
+ },
+ {
+ "syncMs": 14.5,
+ "paintedMs": 29.199999928474426,
+ "frameWrites": 1,
+ "exportMs": 17.100000023841858
+ },
+ {
+ "syncMs": 13.600000023841858,
+ "paintedMs": 31.300000071525574,
+ "frameWrites": 1,
+ "exportMs": 17.100000023841858
+ },
+ {
+ "syncMs": 15.299999952316284,
+ "paintedMs": 30.299999952316284,
+ "frameWrites": 1,
+ "exportMs": 15.5
+ }
+ ]
+ }
+ }
+ ],
+ "pipeline": [
+ {
+ "side": "before",
+ "hover": {
+ "canvasResizes": 120,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.8000000715255737,
+ 0.6999999284744263,
+ 0.7000000476837158,
+ 0.6999999284744263,
+ 0.7000000476837158,
+ 0.7000000476837158,
+ 0.6999999284744263,
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.6999999284744263,
+ 0.6000000238418579,
+ 0.7000000476837158,
+ 0.5999999046325684,
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.6999999284744263,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.5999999046325684,
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5999999046325684,
+ 0.6000000238418579,
+ 0.6000000238418579
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.6,
+ "p95": 0.7
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 6.099999904632568,
+ 5.5,
+ 5.400000095367432,
+ 5.799999952316284,
+ 5,
+ 5,
+ 5.600000023841858,
+ 5,
+ 5.199999928474426,
+ 5.200000047683716,
+ 5.600000023841858,
+ 5.199999928474426,
+ 5.200000047683716,
+ 5.700000047683716,
+ 5.100000023841858,
+ 5.100000023841858,
+ 5.299999952316284,
+ 5,
+ 4.900000095367432,
+ 5.299999952316284,
+ 4.899999976158142,
+ 4.899999976158142,
+ 5.300000071525574,
+ 4.799999952316284,
+ 4.899999976158142,
+ 5,
+ 5.200000047683716,
+ 4.899999976158142,
+ 5.100000023841858,
+ 5.5
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 5.2,
+ "p95": 5.8
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 10.299999952316284,
+ 9.399999976158142,
+ 9.300000071525574,
+ 9.099999904632568,
+ 9.5,
+ 9.200000047683716,
+ 9.399999976158142,
+ 9.300000071525574,
+ 9.199999928474426,
+ 9.300000071525574,
+ 9.199999928474426,
+ 9.200000047683716,
+ 9.199999928474426,
+ 9.400000095367432,
+ 9.299999952316284,
+ 9.399999976158142,
+ 9.200000047683716,
+ 9.299999952316284,
+ 9.200000047683716,
+ 9.100000023841858,
+ 9.199999928474426,
+ 9.200000047683716,
+ 9.399999976158142,
+ 9.200000047683716,
+ 9.299999952316284,
+ 9.299999952316284,
+ 9.200000047683716,
+ 9.200000047683716,
+ 9.099999904632568,
+ 9.300000071525574
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 9.25,
+ "p95": 9.5
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 32.10000002384186,
+ 31.699999928474426,
+ 32,
+ 31.800000071525574,
+ 31.799999952316284,
+ 31.700000047683716,
+ 31.699999928474426,
+ 31.800000071525574,
+ 32,
+ 31.799999952316284,
+ 32,
+ 31.899999976158142,
+ 31.800000071525574,
+ 32,
+ 32,
+ 31.899999976158142,
+ 33,
+ 33.799999952316284,
+ 33.700000047683716,
+ 33.799999952316284,
+ 33.5,
+ 33.300000071525574,
+ 33.39999997615814,
+ 33.60000002384186,
+ 33.59999990463257,
+ 33.200000047683716,
+ 33.39999997615814,
+ 33.39999997615814,
+ 33.60000002384186,
+ 33.60000002384186
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 32.05,
+ "p95": 33.8
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 124.70000004768372,
+ 117.90000009536743,
+ 114.90000009536743,
+ 114.89999997615814,
+ 114.39999997615814,
+ 112.80000007152557,
+ 111.40000009536743,
+ 111.10000002384186,
+ 111.89999997615814,
+ 111.10000002384186,
+ 110.89999997615814,
+ 112,
+ 112.5,
+ 112.20000004768372,
+ 111.29999995231628,
+ 111.20000004768372,
+ 111.29999995231628,
+ 114.39999997615814,
+ 113.5,
+ 113.09999990463257,
+ 113.80000007152557,
+ 113.70000004768372,
+ 110.79999995231628,
+ 111.10000002384186,
+ 111.69999992847443,
+ 110.39999997615814,
+ 112.60000002384186,
+ 112.39999997615814,
+ 111.79999995231628,
+ 110.70000004768372
+ ],
+ "finishMs": 13,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 112.1,
+ "p95": 117.9
+ }
+ },
+ {
+ "side": "after",
+ "hover": {
+ "canvasResizes": 0,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 1,
+ 1,
+ 1,
+ 0.6999999284744263,
+ 0.8000000715255737,
+ 0.6000000238418579,
+ 0.7999999523162842,
+ 0.7000000476837158,
+ 0.5999999046325684,
+ 0.7000000476837158,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.6999999284744263,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.6999999284744263,
+ 0.7000000476837158,
+ 0.5,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5999999046325684,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5999999046325684
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.6,
+ "p95": 1
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 1.899999976158142,
+ 1.5,
+ 1.5,
+ 1.399999976158142,
+ 1.2999999523162842,
+ 1.4000000953674316,
+ 1.2999999523162842,
+ 1.2999999523162842,
+ 1.3000000715255737,
+ 1.399999976158142,
+ 1.5,
+ 1.2999999523162842,
+ 1.5,
+ 1.3000000715255737,
+ 1.1999999284744263,
+ 1.2000000476837158,
+ 1.2999999523162842,
+ 1.2000000476837158,
+ 1.2000000476837158,
+ 1.1999999284744263,
+ 1.3000000715255737,
+ 1.7999999523162842,
+ 1.600000023841858,
+ 1.6999999284744263,
+ 1.8000000715255737,
+ 1.600000023841858,
+ 1.5,
+ 1.5,
+ 1.5,
+ 1.5999999046325684
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 1.4,
+ "p95": 1.8
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 2.5,
+ 2.899999976158142,
+ 2.8000000715255737,
+ 2.799999952316284,
+ 2.700000047683716,
+ 2.799999952316284,
+ 3.100000023841858,
+ 3.100000023841858,
+ 2.799999952316284,
+ 2.799999952316284,
+ 2.9000000953674316,
+ 2.5999999046325684,
+ 3.100000023841858,
+ 2.8000000715255737,
+ 2.5999999046325684,
+ 2.9000000953674316,
+ 2.799999952316284,
+ 3,
+ 3.200000047683716,
+ 2.899999976158142,
+ 2.6999999284744263,
+ 3.100000023841858,
+ 5,
+ 3.200000047683716,
+ 2.899999976158142,
+ 2.799999952316284,
+ 3,
+ 2.9000000953674316,
+ 3.1999999284744263,
+ 2.8000000715255737
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 2.9,
+ "p95": 3.2
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 7.799999952316284,
+ 7.799999952316284,
+ 7.600000023841858,
+ 7.300000071525574,
+ 7.799999952316284,
+ 7.399999976158142,
+ 7.300000071525574,
+ 7.299999952316284,
+ 7.299999952316284,
+ 7.700000047683716,
+ 7.5,
+ 7.299999952316284,
+ 7.700000047683716,
+ 7.299999952316284,
+ 8,
+ 7.700000047683716,
+ 7.700000047683716,
+ 7.599999904632568,
+ 7.600000023841858,
+ 7.5,
+ 7.5,
+ 7.700000047683716,
+ 7.699999928474426,
+ 7.5,
+ 7.200000047683716,
+ 7.399999976158142,
+ 7.700000047683716,
+ 7.299999952316284,
+ 7.799999952316284,
+ 7.300000071525574
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 7.55,
+ "p95": 7.8
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 122.90000009536743,
+ 87.79999995231628,
+ 114.79999995231628,
+ 114.5,
+ 113.60000002384186,
+ 110.89999997615814,
+ 113.5,
+ 111.30000007152557,
+ 86.89999997615814,
+ 112.30000007152557,
+ 112.5,
+ 112.10000002384186,
+ 113.09999990463257,
+ 86.80000007152557,
+ 111,
+ 112.39999997615814,
+ 111,
+ 114,
+ 111.10000002384186,
+ 87,
+ 111.39999997615814,
+ 113.10000002384186,
+ 109.70000004768372,
+ 111.30000007152557,
+ 116.19999992847443,
+ 112,
+ 112.60000002384186,
+ 114.79999995231628,
+ 111,
+ 111.09999990463257
+ ],
+ "finishMs": 12.100000023841858,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 112.05,
+ "p95": 116.2
+ }
+ },
+ {
+ "side": "after",
+ "hover": {
+ "canvasResizes": 0,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.7000000476837158,
+ 0.6999999284744263,
+ 0.8000000715255737,
+ 0.5999999046325684,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5999999046325684,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.6000000238418579,
+ 0.5
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.5,
+ "p95": 0.7
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 1.6999999284744263,
+ 1.3000000715255737,
+ 1.2999999523162842,
+ 1.3000000715255737,
+ 1.2999999523162842,
+ 1.2000000476837158,
+ 1.2999999523162842,
+ 1.2999999523162842,
+ 1.5,
+ 1.3000000715255737,
+ 1.6999999284744263,
+ 1.4000000953674316,
+ 1.0999999046325684,
+ 1.2000000476837158,
+ 1.2000000476837158,
+ 1.2999999523162842,
+ 1.2000000476837158,
+ 1.0999999046325684,
+ 1.3000000715255737,
+ 1.100000023841858,
+ 1.2999999523162842,
+ 1.2000000476837158,
+ 1.1999999284744263,
+ 1.399999976158142,
+ 1.9000000953674316,
+ 1.5999999046325684,
+ 1.5,
+ 1.600000023841858,
+ 1.5,
+ 1.600000023841858
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 1.3,
+ "p95": 1.7
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 2.799999952316284,
+ 2.399999976158142,
+ 2.100000023841858,
+ 2.100000023841858,
+ 2,
+ 2.100000023841858,
+ 2.100000023841858,
+ 2.5,
+ 2.0999999046325684,
+ 2.200000047683716,
+ 2.200000047683716,
+ 2.399999976158142,
+ 3.100000023841858,
+ 2.899999976158142,
+ 3.399999976158142,
+ 2.700000047683716,
+ 2.899999976158142,
+ 3.100000023841858,
+ 2.899999976158142,
+ 4.100000023841858,
+ 3.0999999046325684,
+ 2.8000000715255737,
+ 2.799999952316284,
+ 2.8000000715255737,
+ 2.899999976158142,
+ 3.100000023841858,
+ 2.799999952316284,
+ 3,
+ 3.299999952316284,
+ 4.800000071525574
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 2.8,
+ "p95": 4.1
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 7.399999976158142,
+ 7.899999976158142,
+ 7.700000047683716,
+ 7.5,
+ 8,
+ 7.399999976158142,
+ 7.299999952316284,
+ 7.300000071525574,
+ 7.799999952316284,
+ 7.700000047683716,
+ 7.699999928474426,
+ 7.800000071525574,
+ 7.399999976158142,
+ 7.699999928474426,
+ 7.600000023841858,
+ 7.700000047683716,
+ 7.299999952316284,
+ 7.800000071525574,
+ 7.599999904632568,
+ 7.200000047683716,
+ 7.299999952316284,
+ 7.600000023841858,
+ 7.600000023841858,
+ 7.600000023841858,
+ 7.699999928474426,
+ 7.900000095367432,
+ 7.599999904632568,
+ 7.800000071525574,
+ 7.5,
+ 7.5
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 7.6,
+ "p95": 7.9
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 119.39999997615814,
+ 116.89999997615814,
+ 114.60000002384186,
+ 113.60000002384186,
+ 113.89999997615814,
+ 112,
+ 111.29999995231628,
+ 111.39999997615814,
+ 113.10000002384186,
+ 112.5,
+ 111.10000002384186,
+ 111.69999992847443,
+ 111.30000007152557,
+ 111.80000007152557,
+ 111.79999995231628,
+ 111,
+ 112.29999995231628,
+ 111.39999997615814,
+ 84,
+ 111,
+ 111.10000002384186,
+ 111.29999995231628,
+ 110.40000009536743,
+ 114.69999992847443,
+ 114.5,
+ 111.5,
+ 112,
+ 113.10000002384186,
+ 111.60000002384186,
+ 111.79999995231628
+ ],
+ "finishMs": 12.200000047683716,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 111.8,
+ "p95": 116.9
+ }
+ },
+ {
+ "side": "before",
+ "hover": {
+ "canvasResizes": 120,
+ "hash": 200778981,
+ "width": 240,
+ "height": 240
+ },
+ "scroll": [
+ {
+ "name": "stationary",
+ "raw": [
+ 0.5,
+ 0.5999999046325684,
+ 0.6000000238418579,
+ 0.6000000238418579,
+ 0.3999999761581421,
+ 0.8000000715255737,
+ 0.5999999046325684,
+ 0.5,
+ 0.40000009536743164,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.6000000238418579,
+ 0.5,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.7000000476837158,
+ 0.5,
+ 0.6999999284744263,
+ 0.5,
+ 0.7000000476837158,
+ 0.5,
+ 0.3999999761581421,
+ 0.5,
+ 0.6000000238418579,
+ 0.6999999284744263,
+ 0.6000000238418579
+ ],
+ "result": {
+ "kind": "same"
+ },
+ "p50": 0.5,
+ "p95": 0.7
+ },
+ {
+ "name": "forward",
+ "raw": [
+ 6.800000071525574,
+ 6.299999952316284,
+ 6.600000023841858,
+ 6.199999928474426,
+ 6.100000023841858,
+ 6,
+ 5.399999976158142,
+ 5.700000047683716,
+ 6.100000023841858,
+ 5.600000023841858,
+ 5.799999952316284,
+ 5.899999976158142,
+ 5.5,
+ 5.800000071525574,
+ 5.799999952316284,
+ 5.299999952316284,
+ 6.100000023841858,
+ 5.899999976158142,
+ 5.400000095367432,
+ 5.599999904632568,
+ 5.600000023841858,
+ 5.399999976158142,
+ 5.5,
+ 5.600000023841858,
+ 5.399999976158142,
+ 5.300000071525574,
+ 5.600000023841858,
+ 5.399999976158142,
+ 5.299999952316284,
+ 5.5
+ ],
+ "result": {
+ "kind": "append",
+ "offset": 240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 5.6,
+ "p95": 6.6
+ },
+ {
+ "name": "reverse",
+ "raw": [
+ 10,
+ 9.700000047683716,
+ 9.5,
+ 9.699999928474426,
+ 9.300000071525574,
+ 9.399999976158142,
+ 9.299999952316284,
+ 9.300000071525574,
+ 9.399999976158142,
+ 9.299999952316284,
+ 9.100000023841858,
+ 9.399999976158142,
+ 9.399999976158142,
+ 9.200000047683716,
+ 9.299999952316284,
+ 9.300000071525574,
+ 9.299999952316284,
+ 9.5,
+ 9.200000047683716,
+ 9.199999928474426,
+ 9.300000071525574,
+ 9.5,
+ 9.399999976158142,
+ 9.299999952316284,
+ 9.200000047683716,
+ 9.299999952316284,
+ 9.300000071525574,
+ 9.299999952316284,
+ 9.200000047683716,
+ 9.299999952316284
+ ],
+ "result": {
+ "kind": "prepend",
+ "offset": -240,
+ "header": 0,
+ "footer": 0
+ },
+ "p50": 9.3,
+ "p95": 9.7
+ },
+ {
+ "name": "unmatched",
+ "raw": [
+ 31.799999952316284,
+ 31.600000023841858,
+ 31.799999952316284,
+ 31.90000009536743,
+ 31.799999952316284,
+ 32,
+ 31.600000023841858,
+ 31.699999928474426,
+ 31.5,
+ 31.600000023841858,
+ 32.10000002384186,
+ 31.600000023841858,
+ 31.600000023841858,
+ 31.699999928474426,
+ 31.800000071525574,
+ 31.899999976158142,
+ 32.699999928474426,
+ 33.800000071525574,
+ 33.199999928474426,
+ 34.10000002384186,
+ 33.700000047683716,
+ 33.39999997615814,
+ 33.5,
+ 33.200000047683716,
+ 33.199999928474426,
+ 33.300000071525574,
+ 33.39999997615814,
+ 33.39999997615814,
+ 33.200000047683716,
+ 33.39999997615814
+ ],
+ "result": {
+ "kind": "unmatched"
+ },
+ "p50": 32.05,
+ "p95": 33.8
+ }
+ ],
+ "stitched": {
+ "height": 1840,
+ "hash": 2919636060
+ },
+ "gif": {
+ "raw": [
+ 123.60000002384186,
+ 118.19999992847443,
+ 114.79999995231628,
+ 114.20000004768372,
+ 115.79999995231628,
+ 113.10000002384186,
+ 112.10000002384186,
+ 113.5,
+ 112,
+ 111.5,
+ 115.10000002384186,
+ 111.10000002384186,
+ 112.39999997615814,
+ 112,
+ 110.89999997615814,
+ 114,
+ 112.70000004768372,
+ 112.89999997615814,
+ 112.79999995231628,
+ 113.5,
+ 112.20000004768372,
+ 117.20000004768372,
+ 113.5,
+ 113.10000002384186,
+ 115.60000002384186,
+ 112,
+ 111,
+ 115.39999997615814,
+ 112.20000004768372,
+ 112.29999995231628
+ ],
+ "finishMs": 12.5,
+ "bytes": 17977154,
+ "hash": 618687468,
+ "p50": 113,
+ "p95": 118.2
+ }
+ }
+ ],
+ "regression": [
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "light",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "before",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "offset-crop",
+ "width": 400,
+ "height": 320,
+ "oracle": "canvas",
+ "hash": 3731316037
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "alpha-fallback",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 2433304853
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "mixed-dpi-resize",
+ "width": 800,
+ "height": 600,
+ "oracle": "baseline",
+ "hash": 2914514502
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "rectangle-annotation",
+ "width": 800,
+ "height": 600,
+ "oracle": "canvas",
+ "hash": 68105983
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-1-1",
+ "hash": 4032118533,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-1038-758",
+ "hash": 1006162821,
+ "width": 240,
+ "height": 240
+ },
+ {
+ "theme": "dark",
+ "side": "after",
+ "name": "magnifier-200-200",
+ "hash": 1690276421,
+ "width": 240,
+ "height": 240
+ }
+ ],
+ "versions": {
+ "electron": "42.11.12",
+ "chrome": "148.0.7778.280"
+ }
+}
diff --git a/docs/acceptance/region-screenshot-performance-macos-2026-10-29.md b/docs/acceptance/region-screenshot-performance-macos-2026-10-29.md
new file mode 100644
index 0000000000..8d37708e05
--- /dev/null
+++ b/docs/acceptance/region-screenshot-performance-macos-2026-10-29.md
@@ -0,0 +1,61 @@
+# macOS 截图工具性能分析与优化(2026-10-29)
+
+用户已实机验收本分支的 macOS 选区识别修复,见[选区验收记录](macos-region-snapping-2026-10-29.md)。本轮在此基础上检查打开、鼠标交互、编辑导出、滚动拼接和录制链路,实际优化滚动匹配与放大镜绘制,不改变截图精度、拼接置信规则、选区命中或鼠标控制。
+
+## 实测收益
+
+环境:macOS 26.4 / arm64 / Apple M5,Electron 42.11.12 / Chromium 148.0.7778.280。基线为 `8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0`,优化版为本工作区源码。完整数据见[原始 JSON](region-screenshot-performance-macos-2026-10-29.json)。
+
+使用隔离 Electron offscreen 窗口、1040 × 760 DIP、2x 密度和程序生成的像素,不采集用户桌面内容。截图每种尺寸、每个版本各 30 次;滚动匹配和 GIF 每个版本各两批 30 次,旧→新、新→旧交替。截图与滚动每批预热 3 次;GIF 连续编码包含首帧,不另做预热。下表将同一版本两批原始样本合并后取分位数,单位 ms。
+
+| 960 × 1600 滚动匹配 | P50:前 → 后 | 耗时下降 | P95:前 → 后 |
+| --- | --- | --- | --- |
+| 前进 240 像素 | 5.40 → 1.30 | 75.9% | 6.20 → 1.80 |
+| 回退 240 像素 | 9.30 → 2.80 | 69.9% | 9.70 → 3.40 |
+| 无法匹配的帧 | 32.05 → 7.60 | 76.3% | 33.80 → 7.90 |
+| 完全静止 | 0.60 → 0.60 | 无变化 | 0.70 → 0.80 |
+
+匹配阶段提前停止读取已经不可能胜出或造成歧义的候选行。各行误差非负,部分误差之和除以总采样行数是最终均值的下界;允许匹配的最大得分为 3、最大歧义余量为 1.5,超过 4.5 的候选可以提前停止。90% 以上行保持静止时仍保留完整候选评分,因为这条路径允许零位移得分超过 3。既有独立逐行校验、前后滚动、固定页眉页脚和透明背景重试均保留。
+
+放大镜每次鼠标移动原来都会给 Canvas 的宽、高重新赋值,即使尺寸没有变化也会重置上下文与 backing store。现在仅在像素尺寸变化时赋值,每次仍完整填充背景并绘制采样像素与十字线。真实 Playwright 鼠标移动 60 次,尺寸赋值从 **120 次降为 0 次**;这测量的是重置次数,不代表已测得延迟或峰值内存下降。Light / Dark 下中心、两侧边缘与返回中心的完整像素 hash 均与基线一致,边缘没有残留旧像素。
+
+## 全链路观察与剩余开销
+
+| 环节 | 实测或源码结论 | 本轮处理 |
+| --- | --- | --- |
+| 打开截图 | 用户刚才验收的 10 次真实日志中,并行准备抓屏与原生窗口快照为 67–603ms;浮层打开多数为 7–13ms,另有 39ms、167ms | 瓶颈主要在准备阶段;日志没有拆分系统抓屏和原生查询,不能把这个数字全归因于系统 API。保留既有并行准备、预热与首帧屏障 |
+| 悬停吸附与放大镜 | 吸附查询已有一个在途请求与最新待处理点,避免鼠标移动堆积;放大镜存在无效画布重置 | 去掉重置,保留吸附调度与坐标换算 |
+| 普通编辑与导出 | 1080p / 4K / 1600 × 10000 导出 P50 分别为 3.00→2.90 / 9.25→9.05 / 17.55→16.40ms | 本轮未改导出链路;这些差异视为波动,不宣称加速。保留已有不透明选区直裁剪、带标注/缩放/透明像素的 Canvas 路径 |
+| 滚动采集与拼接 | macOS 采集使用系统抓屏;预览只读取可见行,最终导出才组装完整图;无匹配帧的匹配计算约占 32ms | 优化匹配搜索,未降低采样精度或改变系统鼠标位置;没有测量真实网页自动滚动的端到端帧率 |
+| GIF | 960 × 540 高色彩变化的合成纹理,每帧移动小白块;编码 P50 112.55→111.80ms,P95 117.90→116.20ms | 这是剩余热点,编码本身超过 100ms 采样周期,不能保证这种画面达到 10fps。既有完全相同帧合并仍有效;本轮未改变编码、画质或帧时长 |
+| WebM | 使用浏览器 MediaRecorder,实际采样等待上一帧完成,不无限排队;macOS 原生录制帧经 JPEG 解码、裁剪后送 Renderer | 本轮做功能回归,未测原生采集/编码端到端吞吐量,不宣称提速 |
+| 保存、复制、贴图、交给新任务 | PNG/JPEG 编码与系统剪贴板在 main 侧;磁盘写入异步;这些路径不在 Renderer 导出计时内 | 检查实际实现和既有回归;未计时系统保存框、磁盘、剪贴板、IPC 或媒体入仓 |
+
+真实打开日志中的 `(captureMs, openMs)` 原始值为 `(603,9)、(165,13)、(148,12)、(126,167)、(78,8)、(109,12)、(184,10)、(67,39)、(169,7)、(97,8)`。这是同一次用户验收的观察数据,不是控制变量的优化前后对比。
+
+GIF 后续值得单独把调色板生成和编码移出 Renderer 主线程,并保证暂停、停止、帧顺序、时长与在途队列有界;这会改变异步生命周期,需要专门的交互和取消回归。本轮没有通过降低颜色数、降低画质或复用不适用的调色板获得表面提速。
+
+同日后续已完成上述 Worker 优化及完整 GIF 字节、逐帧像素和时长对照,详见[GIF 编码专项验收](region-gif-worker-performance-2026-10-29.md)。本节数值保留为该优化之前的原始观察。
+
+## 验证与复跑
+
+- 截图相关 10 个单测文件、114 项全部通过,1.49s;覆盖窗口生命周期、迟到结果、取色、导出、前进/回退、固定页眉页脚、局部重绘、固定壁纸、重复段落、录制、剪贴板和交给新任务。复用现有充分覆盖,不增加源码字面量或重复用例。
+- 原生 macOS 选区脚本通过,6.40s(与类型检查/UI 检查并行,含编译);涵盖冷启动、焦点与系统鼠标保持、内容区域、标题栏、遮挡、排除浮层、系统透明命中语义及第二次会话。
+- Electron 性能脚本调用真实生产组件、匹配器与 GIF 编码器;核对前后匹配决策、拼接图像和 GIF 输出 hash,以及偏移裁剪、透明像素、混合 DPI、矩形标注和放大镜的深浅色像素。全套通过,采样期间未并发本任务其它测试或类型检查。
+- Electron 离屏 UI 检查为 12/16:截图场景全部通过;WebM 两种主题预览超时,GIF 两种主题独立解码页报 `Target.createTarget: Not supported`。未把失败记成通过,另用基线对照和 Chromium 补验。
+- `--case video,gif --theme light --compare=HEAD` 复现未修改基线的相同超时/协议错误;真实 Chromium 全场景 Light / Dark **16/16 通过**,96.7s,包括滚动、预览、工具条拖动、标注、WebM/GIF、暂停、保存和独立解码。此处保存是 fixture 接收导出数据,不等于系统原生保存框验收。已目检深浅色选区与放大镜,图片仅留本地,没有上传。
+- Desktop typecheck、两处生产 TypeScript 的 ESLint、test-hygiene、dev-docs 与 `git diff --check` 通过。开发实例仍来自本 worktree,`desktop:whoami --all` 返回 `DESKTOP_DEV_VERDICT=ready`;本轮只改 Renderer 所用代码,沿用已有实例热更新。
+
+```sh
+node apps/desktop/scripts/benchmark-region-screenshot.mjs --baseline=8c15788c0a4c20cf9dcd20f2ccd8c63a857faeb0 --samples=30 --output=docs/acceptance/region-screenshot-performance-macos-2026-10-29.json
+node apps/desktop/scripts/check-macos-region-snapping.mjs
+pnpm --filter desktop exec vitest run src/main/region-screenshot src/renderer/features/region-screenshot src/shared/__tests__/regionScreenshot.test.ts
+pnpm --filter desktop run typecheck
+pnpm ui:check --changed --theme all
+pnpm ui:check --page region-capture --case video,gif --theme light --compare=HEAD
+pnpm ui:check --page region-capture --case all --theme all --engine chromium
+```
+
+性能/E2E 验证扩展了已有显式 benchmark,不进入默认单测。依据为 `docs/dev-rules/engineering-conventions.md` §3.2 和 `docs/design-rules/DESIGN.md` §10、§14.4:验证真实生产入口,量测直接交互成本,保持两种主题与像素结果一致。新覆盖补上既有 benchmark 没有的实际鼠标移动、滚动搜索和连续 GIF 编码;最小代表输入是两张 960 × 1600、相差 240 行的图,以及一张含边缘取样的真实放大镜画布。
+
+上述量测不等于整个截图工具已达到某个端到端时延目标。本轮未实测 Windows 性能、物理混合 DPI、多屏、真实自动滚动的鼠标移动/停止验收或完整录制链路;共享算法不含平台分支,但 Windows 仍需实机复跑,不能沿用历史 Windows 数据作为本次证据。
diff --git a/docs/dev-rules/electron-security-and-process-boundaries.md b/docs/dev-rules/electron-security-and-process-boundaries.md
index 36cdfc428b..3c1dbf0c63 100644
--- a/docs/dev-rules/electron-security-and-process-boundaries.md
+++ b/docs/dev-rules/electron-security-and-process-boundaries.md
@@ -166,6 +166,14 @@ Windows 真实 Chrome+原生 helper+生产浮层的黑盒回归入口为
记录 Light/Dark 连续移动时的 DOM 提交与绘制帧,并延后真实元素响应验证过程中无整窗闪回及跨边界切换;
只适配测试传输,不替代生产 IPC 授权用例或 macOS 实机验证。
+macOS helper 在读取首条请求前初始化 `NSApplication`,使用 `.prohibited` 激活策略保持
+后台进程;否则 AppKit 窗口命中可能始终返回 0。不得为初始化激活应用、显示 Dock 图标或
+启动阻塞 stdin 协议的应用事件循环。原生回归入口为
+`node apps/desktop/scripts/check-macos-region-snapping.mjs`(需要 macOS 图形桌面与辅助功能权限),
+实际编译生产 helper 并查询独立 AppKit 测试窗口,覆盖冷启动、焦点/鼠标保持、内容区、
+截图浮层排除和真实遮挡;`--helper=<binary>` 可对旧二进制运行同一用例。
+透明像素使用独立 AppKit 应用的实际命中作参照,不假定每个系统都把视觉透明区域视为鼠标穿透。
+
滚动截图与区域录制复用该浮层和会话 token,开始后把控制区移到选区之外。
滚动截图在原透明浮层显示选区轮廓与侧边预览,只在预览和自动滚动按钮处接收鼠标。
长图编辑交给独立无标题栏窗口,复用辅助窗口 controller,原浮层结束;首份图片绘制后才显示。
@@ -188,8 +196,21 @@ main 按所属窗口、顶层 frame 和当前 token 校验每次采集,只向
不授予 Renderer 通用屏幕媒体流,不扩大 device-link 的远程 IPC 白名单。
Windows 滚动截图与录制由当前用户会话的截图 helper 直接读取已选矩形(单帧最多 3200 万像素),不启动 SYSTEM broker;
macOS 复用本地 ScreenCaptureKit helper,main 裁剪后才跨 IPC。没有录制临时文件或音频采集。
+本地区域 GIF/视频录制通过同包 helper 的 `cursor-overlay-demand` 模式按请求编码:
+系统仍按原来的 30fps 配置提供画面,仅保留最新一张尚未编码的 IOSurface,使用 CF retain 与
+IOSurface use count 阻止缓冲复用;替换、编码完成、空白画面和销毁均释放它。无请求时不做 JPEG
+编码,静止画面可复用已编码结果;请求早于首帧时等第一张有效画面。分辨率、JPEG 参数和大小预算
+降级规则不变,仍先压缩整屏再由 main 裁选区。远程桌面与单窗口拍照沿用原 `cursor-overlay`
+即时编码方式;不新增远端字段、权限、allowlist 或 relay 行为。单次取帧会增加编码等待,验收需
+同时检查 CPU、取帧速率和暂停恢复,不能只报编码次数。原生对照与实机入口分别为
+`benchmark-macos-demand-capture.mjs`、`benchmark-macos-live-capture.mjs`(位于 Desktop scripts)。
暂停停止采样,关闭、显示器变化或 Renderer 故障结束会话;异步迟到帧丢弃。
视频与 GIF 在内存中编码;保存通过原生保存框选择导出路径,取消保存保留本次结果供重试。
+GIF 的量化与压缩在 Renderer 专属 Web Worker 中完成,仅接收已裁剪像素,不获得 Node 或
+屏幕访问权限。每次等待上一帧完成再采样,暂停与停止按序处理;取消、异常和超时均终止 Worker。
+GIF 只在 rgb444 每个分组的计数与 RGB 总和全部相同时复用量化结果,索引映射和压缩仍逐帧执行,
+不得用近似调色板或降低颜色数替代。大幅不透明 PNG 保存可用已有 libvips 线程池无损编码;
+透明图、JPEG 与编码器不可用时保持原生路径,仍先经用户的保存框选址,不新增临时媒体文件。
复制通过媒体总仓保留文件,并写入原生文件剪贴板。
`webviewTag` 默认关闭;受控例外目前只有两类——主界面与右侧栏子窗口(内置浏览器需要;