// Rust vs browser on the frame limits (owner brief 2026-11-01): each case is a composed canvas
// (`frame_probe_generator.rs.txt`) with the core's f64 expectation of every visible disc (size and
// centre in CSS px on the smallest preview box). The browser draws it in a box of that size, CSS as
// AnatomyCanvas (svg max-width/max-height 100 %, centred); answers the largest size and centre gaps.
import { createRequire } from 'node:module'
import { readFileSync, readdirSync } from 'node:fs'
const require = createRequire(process.argv[2] + '/apps/app/package.json')
const pw = require('@playwright/test')
const DIR = process.argv[3]
const cases = readdirSync(DIR).filter((f) => f.endsWith('.json')).sort().map((f) => JSON.parse(readFileSync(`${DIR}/${f}`, 'utf8')))
for (const engine of process.argv[4].split(',')) {
const browser = await pw[engine].launch()
const page = await browser.newPage({ viewport: { width: 600, height: 600 } })
console.log(`== ${engine} ${browser.version()}`)
for (const c of cases) {
const [bw, bh] = c.box
await page.setContent(`