LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.
C cdebiandesktop-environmentebpffirewalllandlocklinuxlinux-distributionopen-sourceprivacyquickjsraspberry-pi-5reactsecuritywaylandwayland-compositor
LordBench, second part (0.8.6 in development): software video decoding and the remote desktop's encoders in lord-media (MK_VBENCH), the desktop-impact mode (lord-server's own frame times while a scene window moves through the drag's path, alone and under a low-priority load), the N-boot test (boot-test admin action, lord-sessiond restarts while the state file says so), the Raspberry Pi 5 reference and its first measurements (5.99 s to the login screen, 59 fps alone and 24 fps under load), the Pi GPU sandbox fix; CHANGELOG, BENCHMARK, paper (en/es/pt), FAQ and ROADMAP updated
Federico Pereira4d82ae995eef
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex adaf815..aa01ffb 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -50,12 +50,50 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),condition, the boot time per LordOS version and **Save to Documents**. Nothing is sent anywhere.- **Recorded conditions:** temperatures and trip points, power, governor, platform profile, GPU kind, disk kind,composition and display modes. No names or identities.- - **Reference:** the only reference machine so far is VM 116 (8 vCPU Xeon Silver 4108, llvmpipe). A Full run there- measured 977 MB/s SHA-256 and 19.7 GFLOP/s on all cores, and 20.2 GB/s memory copy. The Pi 5 and x86 PC- references come when they are measured.- - **Tests:** `tests/lordbench_test.c` (260 checks: records, workloads, fake sysfs trees of an x86 laptop and a Pi 5,- boot history) and `tests/sysinfo_perf_test.mjs` (30 checks).- - **Not built yet:** the desktop-impact mode, the compositor and video workloads, and `lordos-sysreport bench`.+ - **Video:** a `lord-media` job (`MK_VBENCH`, `media/helper/lm_vbench.c`, launched by `bench/lbvideo.c` with no+ fds) generates its own test clips in memory from a fixed synthetic picture (H.264, HEVC, VP9 and AV1 at 1080p;+ H.264 and HEVC at 4K) and decodes each in software the way the player does, as frames per second; then the+ remote desktop's own encoders (`lm_stream_sw_encoder`: H.264 and VP8) encode 1080p frames. Quick measures H.264+ 1080p and the H.264 encoder. lord-media answers only `MM_BENCH` records, checked by `lbv_record_valid`. Hardware+ decoding is not measured (neither test machine has it).+ - **Desktop impact** (its own button and result file, `lordbench-desktop.json`): System Information opens a scene+ window and lord-server moves it along a figure of eight through the drag's own path (`lord.wm.script`,+ `grab_script_begin` in `ui/grab.c`, no JS per frame; `wm.scriptMove`/`wm.stopScript` in the SDK). lord-server+ records every frame it builds and every frame the display shows (`bench/lbframes.c`): 10 s alone, then 10 s+ while `lord-bench` loads every core at the lowest priority (`LB_MODE_LOAD`, nice 19, idle I/O). Each phase gives+ frames per second, the time to build a frame (median, 99th percentile) and the share of late frames (intervals+ over 1.5 refresh periods); the verdict compares the 99th percentile with the refresh period in use and warns+ above 5 % late (problem above 25 %). Frame times never come from a helper: `lb_msg_valid` refuses ids past+ `LB_HELPER_LAST`.+ - **Boot time test** (Performance → Boot time, administrators): 3, 5 or 10 boots in a row. The closed admin action+ `boot-test <2..10>` writes `/var/lib/lordos/boot-test` in a fixed format (`bench/boottest.c`) and+ `boot-test-cancel` (anyone) removes it; the session restarts as usual. At each boot's first frame lord-sessiond+ records the boot with its number in the test and, while boots are left, restarts 30 s later. The login screen+ shows the boot and the countdown with **Stop the test**, and a login stops it too. The count only goes down, a+ state older than 30 minutes is discarded, and the action is refused in the live session. The Boot time group shows+ each version's latest test (median and range). Checked by unit tests; not yet run end to end on a machine.+ - **References:** VM 116 (8 vCPU Xeon Silver 4108, llvmpipe) and a **Raspberry Pi 5 16 GB** (SD card, V3D), each a+ real Full run (`apps/sysinfo/references.js`):+ - VM 116: SHA-256 166/984 MB/s (one core/all), matrix product 3.3/19.9 GFLOP/s, memory copy 20.0 GB/s; software+ decoding H.264 1080p 399 fps, AV1 1080p 201 fps, HEVC 4K 102 fps; H.264 encoder 106 fps.+ - Pi 5: SHA-256 933/3,693 MB/s, matrix product 2.26/5.99 GFLOP/s, memory copy 7.6 GB/s, latency 115 ns; V3D scene+ 795 fps, fill 2,455 Mpixel/s; SD card 66 MB/s write, 91 MB/s read; 3 minutes sustained at 5.86 → 5.88 GFLOP/s+ with the fan, 55.6 °C at most; software decoding H.264 1080p 258 fps, AV1 1080p 159 fps, H.264 4K 55 fps,+ HEVC 4K 57 fps; H.264 encoder 75 fps. Quick takes 34 s, Full 339 s.+ - **Desktop impact measured** on the Pi 5 with a 1920×1080 60 Hz monitor and GPU composition: alone 59.4 fps, frame+ build 10.9 ms median and 13.0 ms p99, 1.0 % late; under the low-priority all-core load 24.0 fps, 20.1/29.3 ms,+ 96.5 % late. A stability problem found by LordBench, to be investigated. On VM 116 (headless, with a remote viewer)+ 59.6 fps alone, p99 13.3 ms; p99 22.9 ms and 12.5 % late under load.+ - **Boot measured:** the Pi 5 reaches the login screen on its monitor 5.99 s after the kernel starts (systemd: 2.1 s+ kernel + 4.2 s userspace).+ - **Pi limitation:** the LordOS Pi kernel exposes neither the firmware's `get_throttled` nor a cpufreq cooling+ device, so LordBench's stop on throttling can't fire there (the under-voltage alarm is read); the sustained curve+ and the temperature are the evidence instead.+ - **Tests:** `tests/lordbench_test.c` (records, workloads, fake sysfs trees of an x86 laptop and a Pi 5, boot+ history, the frame recorder, the video records, the boot test state file) and `tests/sysinfo_perf_test.mjs` (40+ checks, with the desktop verdict and the video category).+ - **Not built yet:** input latency, hardware video decoding, the layout/paint/shaping workloads, the helper-sandbox+ self-test inside `lord-bench`, the x86 PC reference and `lordos-sysreport bench`.- **Flatpak and Flathub design review, kept for the future** (`docs/FLATPAK.md`, no code; the maintainer decided on2026-10-27 not to implement Flatpak for now, to keep the system stable, and it is not planned for any release): alauncher-owned scope per Flatpak app so the@@ -65,6 +103,10 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),### Fixed+- **LordBench on the Raspberry Pi 5 measured no GPU:** inside `lord-bench`'s sandbox Mesa's loader could not identify+ the V3D render node ("failed to retrieve device information") and every GPU measurement was skipped. The sandbox+ now also allows reading `/sys/firmware/devicetree` and `/dev/dri` (read-only; the GPU is still reached only+ through the render node fd lord-server opens), and the Pi reports a hardware GPU.- **Raspberry Pi image on an x86-64 host with an aarch64 `server/build`:** `tools/iso/mkdeb.sh` checks thesigned system code by running `lord-server --check-code`, which can't run an aarch64 binary on x86-64(it failed as "the staged system code does not match code-manifest.json"). `CODE_CHECK_SERVER` now namesdiff --git a/apps/sysinfo/index.jsx b/apps/sysinfo/index.jsxindex bbe6da3..9033b5f 100644--- a/apps/sysinfo/index.jsx+++ b/apps/sysinfo/index.jsx@@ -6,11 +6,12 @@import {View, Text, ScrollView, Button, useTheme, useLocale, LordOSLogo, systemReport, systemInfo, lordosVersion, formatBytes, formatNumber,Toolbar, ToolbarSpacer, ToolbarButton, Segmented, SidebarItem, GroupBox, FormRow, EmptyState, Hairline, spacing, typeScale,- fs, userDirs, clipboard, wm, admin, remote, codeStatus, launchApp,+ fs, userDirs, clipboard, wm, admin, remote, codeStatus, launchApp, useAppWindow,} from '@lordos/sdk';import { useMemo, useState } from 'react';import { evaluate as evaluateChecks, evaluateProbe, evaluateBench, PENDING as PENDING_CHECKS, PROBE_CHECKS } from './checks.js';import Performance from './performance.jsx';+import { Scene } from './scene.jsx';import { cardLayers, sessionLayers, compatibility, hardwareSections, throttleFlags, machineName, compositionReason, reportFileName, reportJson, parseMemoryLines } from './model.js';// The app's icon: a chip on the brand gradient.@@ -523,6 +524,12 @@ function Report({ r }) {}export default function SystemInformation() {+ const { args } = useAppWindow() || {};+ if (args && args.scene) return <Scene />; // LordBench's desktop scene (scene.jsx)+ return <SystemInformationMain />;+}++function SystemInformationMain() {const { t: tr } = useLocale();const [tab, setTab] = useState('overview');const [n, setN] = useState(0);diff --git a/apps/sysinfo/perf.js b/apps/sysinfo/perf.jsindex 245936b..8553258 100644--- a/apps/sysinfo/perf.js+++ b/apps/sysinfo/perf.js@@ -1,6 +1,7 @@// LordBench's model (0.8.6, docs/BENCHMARK.md "0.8.6 — LordBench"): the measurements by category, how a// result compares with the reference machines (×N of each, never one score), the three verdicts-// (performance, compatibility, stability), and what changed against the previous result. Pure+// (performance, compatibility, stability), the desktop run's verdict against the refresh budget, and what+// changed against the previous result. Pure// functions over the result JSON lord.sysinfo.bench writes (server/src/bench/lbrun.c); tested in// server/tests/sysinfo_perf_test.mjs.import { REFERENCES } from './references.js';@@ -11,8 +12,17 @@ export const CATEGORIES = [{ id: 'gpu', ids: ['gpu.scene', 'gpu.fill', 'gpu.upload', 'gpu.layers'] },{ id: 'storage', ids: ['disk.seqwrite', 'disk.seqread', 'disk.random4k'] },{ id: 'sustained', ids: ['sustained.start', 'sustained.end'] },+ { id: 'video', ids: ['video.h264.1080', 'video.hevc.1080', 'video.vp9.1080', 'video.av1.1080', 'video.h264.2160', 'video.hevc.2160', 'video.enc.h264', 'video.enc.vp8'] },];+// the desktop run (mode 'desktop'): the compositor alone, then with every core loaded at the lowest priority+export const DESKTOP_CATEGORIES = [+ { id: 'compositor', ids: ['comp.fps', 'comp.p50', 'comp.p99', 'comp.missed'] },+ { id: 'desktop', ids: ['desk.fps', 'desk.p50', 'desk.p99', 'desk.missed', 'desk.work'] },+];+export const MISSED_WARN = 5; // % of frames shown late before the verdict warns+export const MISSED_FAIL = 25;+export { REFERENCES };// ×N of the reference for one measurement (latency: the reference's time over ours); null if either@@ -73,6 +83,27 @@ export function compatibilityVerdict(rows) {return { state, count };}+// the desktop verdict (docs/BENCHMARK.md, "Frame times against the refresh budget"): a phase passes when the+// 99th percentile of the time to build a frame fits the refresh period in use and few frames came late+export function desktopVerdict(res) {+ const r = (res && res.results) || {};+ const budget = res && res.frames && res.frames.budgetMs;+ if (!budget || (!r['comp.p99'] && !r['desk.p99'])) return { state: 'unknown', notes: [] };+ const notes = [];+ let state = 'pass';+ const worse = (s) => { if (s === 'fail' || (s === 'warn' && state === 'pass')) state = s; };+ for (const phase of ['comp', 'desk']) {+ const p99 = r[`${phase}.p99`], missed = r[`${phase}.missed`];+ if (!p99) continue;+ const vars = { p99: p99.value, budget, pct: missed ? missed.value : 0 };+ if (p99.value > budget) { notes.push({ id: `${phase}Over`, vars }); worse('warn'); }+ else notes.push({ id: `${phase}Fits`, vars });+ if (missed && missed.value > MISSED_FAIL) { notes.push({ id: `${phase}MissedMany`, vars }); worse('fail'); }+ else if (missed && missed.value > MISSED_WARN) { notes.push({ id: `${phase}Missed`, vars }); worse('warn'); }+ }+ return { state, notes };+}+// ---- comparing two results ----// conditions that change the numbers; listed next to a comparison when they differdiff --git a/apps/sysinfo/performance.jsx b/apps/sysinfo/performance.jsxindex 09aac5d..899895d 100644--- a/apps/sysinfo/performance.jsx+++ b/apps/sysinfo/performance.jsx@@ -1,14 +1,18 @@-// System Information → Performance (0.8.6, docs/BENCHMARK.md "0.8.6 — LordBench"). Quick (about half a-// minute) or Full (storage on a scratch file and a sustained load too) runs of the lord-bench helper-// through lord.sysinfo.bench (server/src/bench/lbrun.c); while it runs this view polls every 500 ms. The-// result is shown by category as "×N" of each reference machine (perf.js, references.js), with the-// three verdicts, the conditions it ran under, the change since the previous run and the boot times-// per version. Nothing is sent anywhere; Save writes the JSON to Documents.+// System Information → Performance (0.8.6, docs/BENCHMARK.md "0.8.6 — LordBench"). Quick (about a minute)+// or Full (storage on a scratch file, a sustained load and every video codec too) runs of the lord-bench+// helper and of lord-media's video measurement through lord.sysinfo.bench (server/src/bench/lbrun.c), and+// Desktop impact: the compositor's frame times while a test window moves (scene.jsx), alone and with every+// core loaded at the lowest priority. While a run goes on this view polls every 500 ms. A peak result is+// shown by category as "×N" of each reference machine (perf.js, references.js), with the three verdicts;+// a desktop result against the display's refresh budget. Both with the conditions they ran under and the+// change since the previous run of the same kind, and the boot times per version. Nothing is sent+// anywhere; Save writes the JSON to Documents.import {- View, Text, ScrollView, Button, useTheme, useLocale, GroupBox, FormRow, formatNumber, spacing, typeScale, fs, userDirs, wm,+ View, Text, ScrollView, Button, useTheme, useLocale, GroupBox, FormRow, Segmented, formatNumber, spacing, typeScale, fs, userDirs, wm, admin, session,} from '@lordos/sdk';import { useEffect, useMemo, useState } from 'react';-import { CATEGORIES, categoryRatios, comparableReferences, stability, compatibilityVerdict, conditionDiffs, changes, sustainedSeries, fileName } from './perf.js';+import { CATEGORIES, DESKTOP_CATEGORIES, categoryRatios, comparableReferences, stability, compatibilityVerdict, desktopVerdict, conditionDiffs, changes, sustainedSeries, fileName } from './perf.js';+import { startScene } from './scene.jsx';import { compatibility } from './model.js';const VERDICT_COLOR = { pass: '#30d158', warn: '#ff9f0a', fail: '#ff453a', unknown: '#8e8e93' };@@ -38,7 +42,7 @@ function useBench() {const start = (mode) => {let ok = false;try { ok = !!bench().start(mode, mode === 'full' ? SUSTAINED_S : 0); } catch (e) { ok = false; }- if (ok) setSt({ state: 'waiting', step: '', progress: 0 });+ if (ok) setSt({ state: 'waiting', mode, step: '', progress: 0 });else setSt((x) => ({ ...x, error: 'start' }));};const cancel = () => { try { bench().cancel(); } catch (e) { /* nothing to cancel */ } };@@ -54,14 +58,14 @@ function Bar({ value }) {);}-function Verdict({ label, state, detail }) {+function Verdict({ label, state, detail, states = 'verdictState' }) {const t = useTheme();const { t: tr } = useLocale();return (<View style={{ flexDirection: 'row', alignItems: 'flex-start', gap: spacing.m, minHeight: 40, paddingVertical: 8 }}><View style={{ width: 10, height: 10, marginTop: 5, borderRadius: 5, backgroundColor: VERDICT_COLOR[state] || '#8e8e93' }} /><Text style={{ width: 150, fontSize: typeScale.body, color: t.text, textAlign: 'start' }}>{label}</Text>- <Text style={{ width: 110, fontSize: typeScale.callout, fontWeight: 600, color: VERDICT_COLOR[state], textAlign: 'start' }}>{tr(`sysinfo.perf.verdictState.${state}`)}</Text>+ <Text style={{ width: 110, fontSize: typeScale.callout, fontWeight: 600, color: VERDICT_COLOR[state], textAlign: 'start' }}>{tr(`sysinfo.perf.${states}.${state}`)}</Text><Text style={{ flex: 1, minWidth: 0, fontSize: typeScale.callout, color: t.textDim, textAlign: 'start', lineHeight: 1.4 }}>{detail}</Text></View>);@@ -122,18 +126,58 @@ function Conditions({ res }) {);}+// the boot time test (bench/boottest.h): N restarts in a row, each boot's time recorded by lord-sessiond;+// started with the boot-test admin action and then the normal Restart (its confirmation included)+const BOOT_TEST_N = [3, 5, 10];+function BootTest({ onChange }) {+ const t = useTheme();+ const { t: tr } = useLocale();+ const [n, setN] = useState(5);+ const [state, setState] = useState(() => { try { return bench().bootTest(); } catch (e) { return null; } });+ const [err, setErr] = useState('');+ const refresh = () => { try { setState(bench().bootTest()); } catch (e) { setState(null); } onChange && onChange(); };+ const start = async () => {+ setErr('');+ try { await admin.run('boot-test', String(n)); } catch (e) { setErr(e.message || String(e)); return; }+ refresh();+ session.restart();+ };+ const stop = async () => { try { await admin.run('boot-test-cancel', ''); } catch (e) { setErr(e.message || String(e)); } refresh(); };+ return (+ <View style={{ gap: spacing.s, paddingVertical: 6 }}>+ {state ? (+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: spacing.m }}>+ <Text style={{ flex: 1, fontSize: typeScale.body, color: t.text, textAlign: 'start', lineHeight: 1.4 }}>+ {tr(state.left === state.total ? 'sysinfo.perf.bootTestSet' : 'sysinfo.perf.bootTestRunning', { n: state.total, done: state.total - state.left })}</Text>+ {state.left === state.total && session.canPower() ? <Button label={tr('sysinfo.perf.bootTestRestart')} onClick={() => session.restart()} /> : null}+ <Button label={tr('sysinfo.perf.bootTestStop')} onClick={stop} />+ </View>+ ) : (+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: spacing.m }}>+ <Text style={{ flex: 1, fontSize: typeScale.body, color: t.text, textAlign: 'start', lineHeight: 1.4 }}>{tr('sysinfo.perf.bootTestAsk')}</Text>+ <Segmented appearance="neutral" value={n} onChange={setN} options={BOOT_TEST_N.map((x) => [x, String(x)])} />+ <Button label={tr('sysinfo.perf.bootTestStart')} disabled={!session.canPower()} onClick={start} />+ </View>+ )}+ {err ? <Text style={{ fontSize: typeScale.callout, color: '#ff453a', textAlign: 'start' }}>{err}</Text> : null}+ </View>+ );+}+function Boots() {const { t: tr } = useLocale();- const rows = useMemo(() => { try { return bench() ? bench().boots() : null; } catch (e) { return null; } }, []);- if (!rows || !rows.length) return null;+ const [rev, setRev] = useState(0);+ const rows = useMemo(() => { try { return bench() ? bench().boots() : null; } catch (e) { return null; } }, [rev]);return (<GroupBox title={tr('sysinfo.perf.boots')} footer={tr('sysinfo.perf.bootsFooter')}>- {rows.slice(-6).reverse().map((r) => (- <Row key={r.version} label={r.version} value={r.boots+ {(rows || []).slice(-6).reverse().map((r) => (+ <Row key={r.version} label={r.version} value={(r.boots? tr('sysinfo.perf.bootLine', { median: formatNumber(r.median, 1), min: formatNumber(r.min, 1), max: formatNumber(r.max, 1), n: r.boots })+ (r.first != null ? ` · ${tr('sysinfo.perf.bootFirst', { s: formatNumber(r.first, 1) })}` : '')- : tr('sysinfo.perf.bootOnlyFirst', { s: formatNumber(r.first, 1) })} />+ : tr('sysinfo.perf.bootOnlyFirst', { s: formatNumber(r.first, 1) }))+ + (r.test ? ` · ${tr('sysinfo.perf.bootTestLine', { median: formatNumber(r.test.median, 1), min: formatNumber(r.test.min, 1), max: formatNumber(r.test.max, 1), n: r.test.boots, of: r.test.of })}` : '')} />))}+ <BootTest onChange={() => setRev((x) => x + 1)} /></GroupBox>);}@@ -141,12 +185,14 @@ function Boots() {function Result({ res, report }) {const t = useTheme();const { t: tr } = useLocale();- const refs = useMemo(() => comparableReferences(res), [res]);- const prev = useMemo(() => { const s0 = readSaved(0); return s0 && s0.at === res.at ? readSaved(1) : s0; }, [res]);+ const desktop = res.mode === 'desktop', slot = desktop ? 2 : 0;+ const refs = useMemo(() => (desktop ? [] : comparableReferences(res)), [res]);+ const prev = useMemo(() => { const s0 = readSaved(slot); return s0 && s0.at === res.at ? readSaved(slot + 1) : s0; }, [res]);const prevComparable = prev && prev.at !== res.at ? prev : null;const ch = useMemo(() => changes(res, prevComparable), [res, prevComparable]);const diffs = useMemo(() => (ch ? conditionDiffs(res, prevComparable) : []), [res, prevComparable, ch]);const stab = useMemo(() => stability(res), [res]);+ const dv = useMemo(() => desktopVerdict(res), [res]);const compat = useMemo(() => compatibilityVerdict(compatibility(report)), [report]);const perfText = refs.map((r) => {const cr = categoryRatios(res, r);@@ -179,14 +225,23 @@ function Result({ res, report }) {{msg.dir ? <Button small plain label={tr('sysinfo.report.showInFiles')} onClick={() => wm.open('files', { new: true, args: { path: msg.dir } })} /> : null}</View>) : null}- <GroupBox title={tr('sysinfo.perf.verdicts')} footer={tr('sysinfo.perf.verdictsFooter')}>- <Verdict label={tr('sysinfo.perf.v.performance')} state={refs.length ? 'pass' : 'unknown'} detail={perfText} />- <Verdict label={tr('sysinfo.perf.v.compatibility')} state={compat.state}- detail={tr('sysinfo.perf.compatCount', { works: compat.count.works, limits: compat.count.limits, no: compat.count.no })} />- <Verdict label={tr('sysinfo.perf.v.stability')} state={stab.state}- detail={stab.notes.length ? stab.notes.map((n) => tr(`sysinfo.perf.note.${n.id}`, n.vars)).join(' ') : tr('sysinfo.perf.note.none')} />- </GroupBox>- {CATEGORIES.map((c) => (+ {desktop ? (+ <GroupBox title={tr('sysinfo.perf.verdicts')} footer={tr('sysinfo.perf.deskFooter', { budget: formatNumber((res.frames && res.frames.budgetMs) || 0, 1) })}>+ <Verdict label={tr('sysinfo.perf.v.desktop')} state={dv.state} states="deskState"+ detail={dv.notes.map((n) => tr(`sysinfo.perf.dnote.${n.id}`, { p99: formatNumber(n.vars.p99, 1), budget: formatNumber(n.vars.budget, 1), pct: formatNumber(n.vars.pct, 1) })).join(' ') || tr('sysinfo.perf.dnote.none')} />+ <Verdict label={tr('sysinfo.perf.v.stability')} state={stab.state}+ detail={stab.notes.length ? stab.notes.map((n) => tr(`sysinfo.perf.note.${n.id}`, n.vars)).join(' ') : tr('sysinfo.perf.note.none')} />+ </GroupBox>+ ) : (+ <GroupBox title={tr('sysinfo.perf.verdicts')} footer={tr('sysinfo.perf.verdictsFooter')}>+ <Verdict label={tr('sysinfo.perf.v.performance')} state={refs.length ? 'pass' : 'unknown'} detail={perfText} />+ <Verdict label={tr('sysinfo.perf.v.compatibility')} state={compat.state}+ detail={tr('sysinfo.perf.compatCount', { works: compat.count.works, limits: compat.count.limits, no: compat.count.no })} />+ <Verdict label={tr('sysinfo.perf.v.stability')} state={stab.state}+ detail={stab.notes.length ? stab.notes.map((n) => tr(`sysinfo.perf.note.${n.id}`, n.vars)).join(' ') : tr('sysinfo.perf.note.none')} />+ </GroupBox>+ )}+ {(desktop ? DESKTOP_CATEGORIES : CATEGORIES).map((c) => (<GroupBox key={c.id} title={tr(`sysinfo.perf.cat.${c.id}`)}>{c.ids.map((id) => <Measurement key={id} id={id} res={res} refs={refs} change={ch ? ch[id] : null} />)}{c.id === 'sustained' && series.length ? (@@ -209,7 +264,12 @@ export default function Performance({ r }) {const t = useTheme();const { t: tr } = useLocale();const [st, running, start, cancel] = useBench();- const res = st.result || (running ? null : readSaved(0));+ const fresh = st.result || null;+ const res = fresh && fresh.mode !== 'desktop' ? fresh : running ? null : readSaved(0);+ const dres = fresh && fresh.mode === 'desktop' ? fresh : running ? null : readSaved(2);+ // the desktop run's scene, while lord-server records frames (comp.* and desk.* steps)+ const scene = running && st.mode === 'desktop' && /^(comp|desk)\./.test(st.step || '');+ useEffect(() => (scene ? startScene() : undefined), [scene]);if (st.state === 'unavailable') return <View style={{ padding: spacing.xl }}><Text style={{ color: t.textDim, textAlign: 'start' }}>{tr('sysinfo.perf.unavailable')}</Text></View>;return (<ScrollView style={{ flex: 1 }}>@@ -220,6 +280,7 @@ export default function Performance({ r }) {<Text style={{ fontSize: typeScale.callout, color: t.textDim, textAlign: 'start', lineHeight: 1.4 }}>{tr('sysinfo.perf.intro')}</Text></View>{running ? <Button label={tr('sysinfo.perf.cancel')} onClick={cancel} /> : [+ <Button key="d" label={tr('sysinfo.perf.desktop')} onClick={() => start('desktop')} />,<Button key="f" label={tr('sysinfo.perf.full')} onClick={() => start('full')} />,<Button key="q" primary label={tr('sysinfo.perf.quick')} onClick={() => start('quick')} />,]}@@ -231,10 +292,16 @@ export default function Performance({ r }) {<Text style={{ fontSize: typeScale.body, color: t.text, textAlign: 'start' }}>{st.state === 'waiting' ? tr('sysinfo.perf.waiting') : tr('sysinfo.perf.measuring', { what: st.step ? tr(`sysinfo.perf.m.${key(st.step)}`) : '…' })}</Text><Bar value={st.progress || 0} />- <Text style={{ fontSize: typeScale.caption, color: t.textDim, textAlign: 'start' }}>{tr('sysinfo.perf.keepStill')}</Text>+ <Text style={{ fontSize: typeScale.caption, color: t.textDim, textAlign: 'start' }}>{tr(st.mode === 'desktop' ? 'sysinfo.perf.deskKeepStill' : 'sysinfo.perf.keepStill')}</Text>+ </View>+ ) : null}+ {res ? <Result res={res} report={r} /> : !running && !dres ? <Text style={{ fontSize: typeScale.callout, color: t.textDim, textAlign: 'start' }}>{tr('sysinfo.perf.none')}</Text> : null}+ {dres ? (+ <View style={{ gap: spacing.l }}>+ <Text style={{ fontSize: typeScale.headline, fontWeight: 600, color: t.text, textAlign: 'start', paddingTop: spacing.m }}>{tr('sysinfo.perf.deskTitle')}</Text>+ <Result res={dres} report={r} /></View>) : null}- {res ? <Result res={res} report={r} /> : !running ? <Text style={{ fontSize: typeScale.callout, color: t.textDim, textAlign: 'start' }}>{tr('sysinfo.perf.none')}</Text> : null}{!running ? <Boots /> : null}</View></ScrollView>diff --git a/apps/sysinfo/references.js b/apps/sysinfo/references.jsindex fb59b00..04e82d0 100644--- a/apps/sysinfo/references.js+++ b/apps/sysinfo/references.js@@ -1,21 +1,49 @@// LordBench's reference machines (docs/BENCHMARK.md, "Results without one magic number"): a result is// shown as "×N" of each one measured with the same LordBench version. Every entry is a real Full run,// copied from the lordbench.json it wrote, with the machine described in sysinfo.perf.ref.<id>.-// Planned: a Raspberry Pi 5 8 GB and a modest x86 PC; they are added when they have been measured.+// Planned: a modest x86 PC; it is added when it has been measured.export const REFERENCES = [{// VM 116 on Proxmox VE: 8 vCPU (host CPU, Xeon Silver 4108 at 1.8 GHz), 4 GB, virtio disk, no- // GPU passthrough (Mesa llvmpipe); LordOS 0.8.5 + LordBench 1, 2026-10-27, Full with 30 s sustained+ // GPU passthrough (Mesa llvmpipe); LordOS 0.8.6 in development, 2026-10-27, Full with 30 s sustainedid: 'vm', lordbench: 1, mode: 'full',results: {- 'cpu.sha256.1': { value: 166.557 }, 'cpu.sha256.n': { value: 976.519 },- 'cpu.matmul.1': { value: 3.41756 }, 'cpu.matmul.n': { value: 19.6958 },- 'cpu.xz.1': { value: 60.9097 }, 'cpu.xz.n': { value: 353.612 },- 'cpu.js.1': { value: 58.2072 }, 'cpu.js.n': { value: 335.649 },- 'mem.copy': { value: 20.157 }, 'mem.triad': { value: 22.7711 }, 'mem.latency': { value: 90.1192 },- 'gpu.scene': { value: 793.718 }, 'gpu.fill': { value: 394.575 }, 'gpu.upload': { value: 9676.24 }, 'gpu.layers': { value: 22.6118 },- 'disk.seqwrite': { value: 219.028 }, 'disk.seqread': { value: 517.082 }, 'disk.random4k': { value: 5619.17 },- 'sustained.start': { value: 19.7626 }, 'sustained.end': { value: 19.7667 },+ 'cpu.sha256.1': { value: 165.951 }, 'cpu.sha256.n': { value: 984.265 },+ 'cpu.matmul.1': { value: 3.31858 }, 'cpu.matmul.n': { value: 19.9376 },+ 'cpu.xz.1': { value: 60.2491 }, 'cpu.xz.n': { value: 362.977 },+ 'cpu.js.1': { value: 56.6665 }, 'cpu.js.n': { value: 335.945 },+ 'mem.copy': { value: 20.0074 }, 'mem.triad': { value: 22.8006 },+ 'mem.latency': { value: 90.9222 }, 'gpu.scene': { value: 802.066 },+ 'gpu.fill': { value: 406.961 }, 'gpu.upload': { value: 9456.65 },+ 'gpu.layers': { value: 22.925 }, 'disk.seqwrite': { value: 378.126 },+ 'disk.seqread': { value: 516.647 }, 'disk.random4k': { value: 6256.32 },+ 'sustained.start': { value: 19.5814 }, 'sustained.end': { value: 19.77 },+ 'video.h264.1080': { value: 399.438 }, 'video.hevc.1080': { value: 385.477 },+ 'video.vp9.1080': { value: 215.005 }, 'video.av1.1080': { value: 200.887 },+ 'video.h264.2160': { value: 75.624 }, 'video.hevc.2160': { value: 102.252 },+ 'video.enc.h264': { value: 106.12 }, 'video.enc.vp8': { value: 54.175 },+ },+ },+ {+ // Raspberry Pi 5 Model B Rev 1.1, 16 GB, a 32 GB SD card, the LordOS kernel 6.18.57-lordos.3, the fan on+ // its header (lord-fand), GPU V3D 7.1; LordOS 0.8.5 with LordBench 1 from the 0.8.6 tree run from a+ // terminal, 2026-10-27, Full with 180 s sustained (55.6 °C at most, no speed lost)+ id: 'pi5', lordbench: 1, mode: 'full',+ results: {+ 'cpu.sha256.1': { value: 933.43 }, 'cpu.sha256.n': { value: 3692.78 },+ 'cpu.matmul.1': { value: 2.26049 }, 'cpu.matmul.n': { value: 5.98807 },+ 'cpu.xz.1': { value: 66.9597 }, 'cpu.xz.n': { value: 254.003 },+ 'cpu.js.1': { value: 54.342 }, 'cpu.js.n': { value: 181.428 },+ 'mem.copy': { value: 7.61055 }, 'mem.triad': { value: 7.29512 },+ 'mem.latency': { value: 114.505 }, 'gpu.scene': { value: 795.282 },+ 'gpu.fill': { value: 2454.68 }, 'gpu.upload': { value: 3897.05 },+ 'gpu.layers': { value: 115.042 }, 'disk.seqwrite': { value: 65.9909 },+ 'disk.seqread': { value: 90.5924 }, 'disk.random4k': { value: 2692.31 },+ 'sustained.start': { value: 5.85622 }, 'sustained.end': { value: 5.87865 },+ 'video.h264.1080': { value: 257.551 }, 'video.hevc.1080': { value: 246.029 },+ 'video.vp9.1080': { value: 204.453 }, 'video.av1.1080': { value: 159.402 },+ 'video.h264.2160': { value: 55.007 }, 'video.hevc.2160': { value: 57.213 },+ 'video.enc.h264': { value: 75.332 }, 'video.enc.vp8': { value: 54.526 },},},];diff --git a/apps/sysinfo/scene.jsx b/apps/sysinfo/scene.jsxnew file mode 100644index 0000000..31bb8c3--- /dev/null+++ b/apps/sysinfo/scene.jsx@@ -0,0 +1,66 @@+// LordBench's desktop scene (0.8.6, docs/BENCHMARK.md "Desktop impact"): while a desktop run is in its+// comp.* or desk.* step, Performance opens a second System Information window with this scene and asks+// lord-server to move it along a figure of eight (wm.scriptMove: the drag's own path in C, one step per+// frame, no JS per frame), while one element inside it turns through lord.setStyle (no React render per+// frame). lord-server records its own frame times meanwhile (bench/lbframes.c); nothing here measures.+import { View, Text, useTheme, useLocale, spacing, typeScale, wm, workArea } from '@lordos/sdk';+import { useEffect, useRef } from 'react';++export const SCENE_INSTANCE = 'lordbench-scene';+const SCENE_ID = `sysinfo#${SCENE_INSTANCE}`;+const W = 760, H = 480, TICK_MS = 16; // the app's minimum size+const PERIOD_MS = 6000;++// the window's place (centered in the work area) and the size of its figure of eight+export function scenePath(a) {+ return {+ x: Math.round(a.x + (a.w - W) / 2), y: Math.round(a.y + (a.h - H) / 2),+ rx: Math.max(0, Math.floor((a.w - W) / 2) - 20), ry: Math.max(0, (a.h - H) - 40),+ };+}++// opens the scene and starts its move once the window is on screen; the returned function stops it+export function startScene() {+ const p = scenePath(workArea());+ wm.open('sysinfo', { instance: SCENE_INSTANCE, args: { scene: true }, frame: { x: p.x, y: p.y, w: W, h: H } });+ let tm = null, tries = 0;+ const go = () => { // the frame's node exists after the first render+ if (wm.scriptMove(SCENE_ID, { rx: p.rx, ry: p.ry, periodMs: PERIOD_MS }) || ++tries > 50) return;+ tm = setTimeout(go, 50);+ };+ tm = setTimeout(go, 50);+ return () => { clearTimeout(tm); wm.stopScript(); wm.close(SCENE_ID, true); };+}++export function Scene() {+ const t = useTheme();+ const { t: tr } = useLocale();+ const spin = useRef(null);+ useEffect(() => {+ let a = 0, tm = null;+ const step = () => {+ a = (a + 6) % 360;+ const n = spin.current && spin.current.id;+ if (n != null) try { lord.setStyle(n, 'transform', `rotate(${a}deg)`); } catch (e) { /* gone */ }+ tm = setTimeout(step, TICK_MS);+ };+ tm = setTimeout(step, TICK_MS);+ return () => clearTimeout(tm);+ }, []);+ const card = (i) => (+ <View key={i} style={{ width: 180, height: 96, borderRadius: 12, padding: spacing.m, gap: 4, backgroundColor: t.mode === 'dark' ? 'rgba(255,255,255,0.08)' : 'rgba(0,0,0,0.05)',+ boxShadow: '0 2px 8px rgba(0,0,0,0.25)' }}>+ <View style={{ width: 28, height: 28, borderRadius: 8, backgroundColor: ['#0a84ff', '#30d158', '#ff9f0a', '#bf5af2', '#ff453a', '#64d2ff'][i % 6] }} />+ <Text style={{ fontSize: typeScale.callout, fontWeight: 600, color: t.text, textAlign: 'start' }}>{tr('sysinfo.perf.sceneTitle')}</Text>+ <Text style={{ fontSize: typeScale.caption, color: t.textDim, textAlign: 'start' }}>{tr('sysinfo.perf.sceneCard', { n: i + 1 })}</Text>+ </View>+ );+ return (+ <View style={{ flex: 1, padding: spacing.l, gap: spacing.m, alignItems: 'center', justifyContent: 'center' }}>+ <View ref={spin} style={{ width: 72, height: 72, borderRadius: 16, backgroundColor: t.accent || '#0a84ff', alignItems: 'center', justifyContent: 'center' }}>+ <View style={{ width: 24, height: 24, borderRadius: 12, backgroundColor: '#ffffff' }} />+ </View>+ <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: spacing.m, justifyContent: 'center' }}>{[0, 1, 2, 3, 4, 5].map(card)}</View>+ </View>+ );+}diff --git a/assets/locales/en/errors.json b/assets/locales/en/errors.jsonindex d321ca8..fb9a834 100644--- a/assets/locales/en/errors.json+++ b/assets/locales/en/errors.json@@ -53,6 +53,8 @@"backup.tooManyExclusions": "Too many exclusions","backup.verifyFailed": "A backup file failed verification (tampered with or wrong key)","backup.wrongPassphrase": "Wrong passphrase",+ "bench.bootTestFailed": "Could not save the boot time test's state",+ "bench.bootTestLive": "The boot time test can't run in the live session: nothing it records survives a restart","camera.busy": "The camera is busy","camera.failed": "The camera stopped working","camera.invalid": "Invalid camera",diff --git a/assets/locales/en/greeter.json b/assets/locales/en/greeter.jsonindex 82dc0e9..a689428 100644--- a/assets/locales/en/greeter.json+++ b/assets/locales/en/greeter.json@@ -1,4 +1,6 @@{+ "bootTest": "Measuring the boot time: boot {k} of {n} done. Restarting in {s} s. Logging in also stops the test.",+ "bootTestCancel": "Stop the test","busy": "One moment…","cancel": "Cancel","confirmRestart": "There are open sessions: unsaved work will be lost. Restart anyway?",diff --git a/assets/locales/en/status.json b/assets/locales/en/status.jsonindex e1495b8..24722bc 100644--- a/assets/locales/en/status.json+++ b/assets/locales/en/status.json@@ -1,4 +1,6 @@{+ "bench.bootTestCancelled": "Boot time test stopped",+ "bench.bootTestSet": "Boot time test: {n} boots","disk.cancelling": "Cancelling","disk.ejected": "Ejected","disk.erased": "Erased",diff --git a/assets/locales/en/sysinfo.json b/assets/locales/en/sysinfo.jsonindex b488031..4724d02 100644--- a/assets/locales/en/sysinfo.json+++ b/assets/locales/en/sysinfo.json@@ -245,6 +245,13 @@"perf.bootFirst": "first boot {s} s","perf.bootLine": "median {median} s (from {min} to {max} s, {n} boots)","perf.bootOnlyFirst": "only the first boot so far: {s} s",+ "perf.bootTestAsk": "Measure the boot time over several restarts in a row. The computer restarts by itself 30 s after each login screen appears; logging in stops it. Administrators only.",+ "perf.bootTestLine": "test: median {median} s ({min} to {max} s, {n} of {of} boots)",+ "perf.bootTestRestart": "Restart now",+ "perf.bootTestRunning": "Boot time test: {done} of {n} boots measured.",+ "perf.bootTestSet": "A boot time test of {n} boots is set: it begins with the next restart.",+ "perf.bootTestStart": "Restart and measure…",+ "perf.bootTestStop": "Stop the test","perf.boots": "Boot time","perf.bootsFooter": "From the kernel's start to the first frame on the screen, recorded at every boot. The first boot after an update is kept apart: it builds caches.","perf.c.cpufreq": "Processor frequency",@@ -258,17 +265,28 @@"perf.c.threads": "Threads","perf.c.versions": "Versions","perf.cancel": "Stop",+ "perf.cat.compositor": "Compositor alone","perf.cat.cpu": "Processor",+ "perf.cat.desktop": "With every core busy","perf.cat.gpu": "Graphics","perf.cat.memory": "Memory","perf.cat.storage": "Storage","perf.cat.sustained": "Sustained load",+ "perf.cat.video": "Video","perf.catTimes": "{cat} ×{x}","perf.compatCount": "{works} working, {limits} with limits, {no} not working (Compatibility tab).","perf.composition": "composition: {c}","perf.conditions": "Conditions","perf.conditionsFooter": "What affects the numbers, recorded with every result. Results are compared only with the same LordBench version.","perf.critical": "critical at {v} °C",+ "perf.deskFooter": "How long the compositor takes to build each frame, against the refresh period of the display in use ({budget} ms). It passes when the 99th percentile fits that period and few frames come late.",+ "perf.deskKeepStill": "A test window moves around the screen by itself, first alone and then with every core busy at the lowest priority. Leave the mouse and keyboard alone until it ends.",+ "perf.deskState.fail": "Problems",+ "perf.deskState.pass": "Smooth",+ "perf.deskState.unknown": "Not measured",+ "perf.deskState.warn": "With notes",+ "perf.deskTitle": "Desktop impact",+ "perf.desktop": "Desktop impact","perf.diff.composition": "Screen composition","perf.diff.governor": "CPU governor","perf.diff.gpuKind": "Renderer",@@ -289,8 +307,17 @@"perf.disk.unknown": "Unknown disk","perf.disk.usb": "USB drive","perf.disk.virtual": "Virtual disk",+ "perf.dnote.compFits": "Alone, 99 % of the frames were built in {p99} ms or less, within the {budget} ms period.",+ "perf.dnote.compMissed": "Alone, {pct} % of the frames came late.",+ "perf.dnote.compMissedMany": "Alone, {pct} % of the frames came late: the desktop stutters.",+ "perf.dnote.compOver": "Alone, the slowest 1 % of the frames took {p99} ms, more than the {budget} ms period.",+ "perf.dnote.deskFits": "Under load, 99 % of the frames were built in {p99} ms or less, within the period.",+ "perf.dnote.deskMissed": "Under load, {pct} % of the frames came late.",+ "perf.dnote.deskMissedMany": "Under load, {pct} % of the frames came late: the desktop stutters while something else works.",+ "perf.dnote.deskOver": "Under load, the slowest 1 % of the frames took {p99} ms, more than the {budget} ms period.",+ "perf.dnote.none": "No frames were recorded.","perf.full": "Full test",- "perf.fullNote": "The quick test takes about half a minute. The full test also measures the disk with a temporary file of up to 1 GB (deleted at the end) and keeps every core busy for {min} minutes; on an SD card it adds wear.",+ "perf.fullNote": "The quick test takes about half a minute. The full test also measures the disk with a temporary file of up to 1 GB (deleted at the end), decodes every video codec at 1080p and 4K and keeps every core busy for {min} minutes: about 4 to 6 minutes in all. On an SD card it adds wear.","perf.gpuKind.hardware": "hardware GPU","perf.gpuKind.software": "software renderer (on the CPU)","perf.gpuKind.virtual": "virtual GPU (the host draws)",@@ -299,6 +326,10 @@"perf.kernel": "kernel {v}","perf.liveNo": "installed","perf.liveYes": "live session from the USB stick",+ "perf.m.comp_fps": "Frames shown",+ "perf.m.comp_missed": "Frames late",+ "perf.m.comp_p50": "Time to build a frame, median",+ "perf.m.comp_p99": "Time to build a frame, slowest 1 %","perf.m.cpu_js_1": "JavaScript, one core","perf.m.cpu_js_n": "JavaScript, all cores","perf.m.cpu_matmul_1": "Matrix multiply, one core",@@ -307,6 +338,11 @@"perf.m.cpu_sha256_n": "SHA-256, all cores","perf.m.cpu_xz_1": "Package decompression, one core","perf.m.cpu_xz_n": "Package decompression, all cores",+ "perf.m.desk_fps": "Frames shown",+ "perf.m.desk_missed": "Frames late",+ "perf.m.desk_p50": "Time to build a frame, median",+ "perf.m.desk_p99": "Time to build a frame, slowest 1 %",+ "perf.m.desk_work": "Work done by the load meanwhile","perf.m.disk_random4k": "Random 4 KiB reads","perf.m.disk_seqread": "Sequential read","perf.m.disk_seqwrite": "Sequential write",@@ -319,8 +355,17 @@"perf.m.mem_triad": "Memory bandwidth (triad)","perf.m.sustained_end": "All cores, last 10 s","perf.m.sustained_start": "All cores, first 10 s",+ "perf.m.video_av1_1080": "AV1 decoding, 1080p",+ "perf.m.video_enc_h264": "Remote desktop encoder, H.264",+ "perf.m.video_enc_vp8": "Remote desktop encoder, VP8",+ "perf.m.video_h264_1080": "H.264 decoding, 1080p",+ "perf.m.video_h264_2160": "H.264 decoding, 4K",+ "perf.m.video_hevc_1080": "HEVC decoding, 1080p",+ "perf.m.video_hevc_2160": "HEVC decoding, 4K",+ "perf.m.video_vp9_1080": "VP9 decoding, 1080p","perf.maxMHz": "up to {v} MHz","perf.measuring": "Measuring: {what}",+ "perf.mode.desktop": "Desktop impact","perf.mode.full": "Full test","perf.mode.quick": "Quick test","perf.noRefs": "No reference machine measured with this LordBench version yet.",@@ -345,13 +390,18 @@"perf.quietNo": "busy ({pct} % CPU after {s} s)","perf.quietYes": "quiet ({pct} % CPU, waited {s} s)","perf.ranAt": "{mode} · {time} · {s} s",+ "perf.ref.pi5": "the Raspberry Pi 5","perf.ref.vm": "the reference VM","perf.sample": "{s} s: {g} GFLOP/s, {temp} °C","perf.sampleNoTemp": "{s} s: {g} GFLOP/s",+ "perf.sceneCard": "Card {n}",+ "perf.sceneTitle": "Test window","perf.skip.failed": "failed","perf.skip.memory": "not enough memory","perf.skip.mode": "full test only",+ "perf.skip.nocodec": "this system's FFmpeg lacks the codec","perf.skip.nodev": "no device",+ "perf.skip.noframes": "too few frames shown (another session in front?)","perf.startEnd": "{a} at start, {b} at the end","perf.startFailed": "LordBench couldn't start (another run, or the lord-bench helper is missing).","perf.status.cancelled": "cancelled",@@ -365,6 +415,7 @@"perf.timesRef": "×{x} {ref}","perf.unavailable": "LordBench isn't available in this session.","perf.v.compatibility": "Compatibility",+ "perf.v.desktop": "Smoothness","perf.v.performance": "Performance","perf.v.stability": "Stability","perf.verdictState.fail": "Problems",diff --git a/assets/locales/es/errors.json b/assets/locales/es/errors.jsonindex 9bcce5c..c373631 100644--- a/assets/locales/es/errors.json+++ b/assets/locales/es/errors.json@@ -53,6 +53,8 @@"backup.tooManyExclusions": "Demasiadas exclusiones","backup.verifyFailed": "Un archivo de la copia no pasó la verificación (alterado o clave equivocada)","backup.wrongPassphrase": "Frase incorrecta",+ "bench.bootTestFailed": "No se pudo guardar el estado de la prueba de arranque",+ "bench.bootTestLive": "La prueba de arranque no funciona en la sesión en vivo: nada de lo que registra sobrevive a un reinicio","camera.busy": "La cámara está ocupada","camera.failed": "La cámara dejó de funcionar","camera.invalid": "Cámara inválida",diff --git a/assets/locales/es/greeter.json b/assets/locales/es/greeter.jsonindex 6c115c0..11456b6 100644--- a/assets/locales/es/greeter.json+++ b/assets/locales/es/greeter.json@@ -1,4 +1,6 @@{+ "bootTest": "Midiendo el tiempo de arranque: arranque {k} de {n} listo. Reinicia en {s} s. Iniciar sesión también detiene la prueba.",+ "bootTestCancel": "Detener la prueba","busy": "Un momento…","cancel": "Cancelar","confirmRestart": "Hay sesiones abiertas: lo que no esté guardado se pierde. ¿Reiniciar igual?",diff --git a/assets/locales/es/status.json b/assets/locales/es/status.jsonindex abd2392..f30d01a 100644--- a/assets/locales/es/status.json+++ b/assets/locales/es/status.json@@ -1,4 +1,6 @@{+ "bench.bootTestCancelled": "Prueba de arranque detenida",+ "bench.bootTestSet": "Prueba de arranque: {n} arranques","disk.cancelling": "Cancelando","disk.ejected": "Expulsado","disk.erased": "Borrado",diff --git a/assets/locales/es/sysinfo.json b/assets/locales/es/sysinfo.jsonindex 3fee10a..1b70882 100644--- a/assets/locales/es/sysinfo.json+++ b/assets/locales/es/sysinfo.json@@ -245,6 +245,13 @@"perf.bootFirst": "primer arranque {s} s","perf.bootLine": "mediana {median} s (de {min} a {max} s, {n} arranques)","perf.bootOnlyFirst": "por ahora solo el primer arranque: {s} s",+ "perf.bootTestAsk": "Medí el tiempo de arranque en varios reinicios seguidos. La computadora reinicia sola 30 s después de que aparece la pantalla de inicio de sesión; iniciar sesión la detiene. Solo administradores.",+ "perf.bootTestLine": "prueba: mediana {median} s (de {min} a {max} s, {n} de {of} arranques)",+ "perf.bootTestRestart": "Reiniciar ahora",+ "perf.bootTestRunning": "Prueba de arranque: {done} de {n} arranques medidos.",+ "perf.bootTestSet": "Hay una prueba de arranque de {n} arranques preparada: empieza con el próximo reinicio.",+ "perf.bootTestStart": "Reiniciar y medir…",+ "perf.bootTestStop": "Detener la prueba","perf.boots": "Tiempo de arranque","perf.bootsFooter": "Desde que arranca el kernel hasta el primer cuadro en pantalla, registrado en cada arranque. El primer arranque después de una actualización va aparte: arma cachés.","perf.c.cpufreq": "Frecuencia del procesador",@@ -258,17 +265,28 @@"perf.c.threads": "Hilos","perf.c.versions": "Versiones","perf.cancel": "Detener",+ "perf.cat.compositor": "Compositor solo","perf.cat.cpu": "Procesador",+ "perf.cat.desktop": "Con todos los núcleos ocupados","perf.cat.gpu": "Gráficos","perf.cat.memory": "Memoria","perf.cat.storage": "Almacenamiento","perf.cat.sustained": "Carga sostenida",+ "perf.cat.video": "Video","perf.catTimes": "{cat} ×{x}","perf.compatCount": "{works} funcionan, {limits} con límites, {no} no funcionan (pestaña Compatibilidad).","perf.composition": "composición: {c}","perf.conditions": "Condiciones","perf.conditionsFooter": "Lo que afecta a los números, registrado con cada resultado. Solo se comparan resultados de la misma versión de LordBench.","perf.critical": "crítica a {v} °C",+ "perf.deskFooter": "Cuánto tarda el compositor en armar cada cuadro, frente al período de refresco de la pantalla en uso ({budget} ms). Aprueba cuando el percentil 99 entra en ese período y llegan pocos cuadros tarde.",+ "perf.deskKeepStill": "Una ventana de prueba se mueve sola por la pantalla, primero sola y después con todos los núcleos ocupados a la prioridad más baja. No uses el mouse ni el teclado hasta que termine.",+ "perf.deskState.fail": "Con problemas",+ "perf.deskState.pass": "Fluido",+ "perf.deskState.unknown": "Sin medir",+ "perf.deskState.warn": "Con observaciones",+ "perf.deskTitle": "Impacto en el escritorio",+ "perf.desktop": "Impacto en el escritorio","perf.diff.composition": "Composición de la pantalla","perf.diff.governor": "Governor de CPU","perf.diff.gpuKind": "Renderizador",@@ -289,8 +307,17 @@"perf.disk.unknown": "Disco desconocido","perf.disk.usb": "Unidad USB","perf.disk.virtual": "Disco virtual",+ "perf.dnote.compFits": "Solo, el 99 % de los cuadros se armó en {p99} ms o menos, dentro del período de {budget} ms.",+ "perf.dnote.compMissed": "Solo, el {pct} % de los cuadros llegó tarde.",+ "perf.dnote.compMissedMany": "Solo, el {pct} % de los cuadros llegó tarde: el escritorio se traba.",+ "perf.dnote.compOver": "Solo, el 1 % más lento de los cuadros tardó {p99} ms, más que el período de {budget} ms.",+ "perf.dnote.deskFits": "Con carga, el 99 % de los cuadros se armó en {p99} ms o menos, dentro del período.",+ "perf.dnote.deskMissed": "Con carga, el {pct} % de los cuadros llegó tarde.",+ "perf.dnote.deskMissedMany": "Con carga, el {pct} % de los cuadros llegó tarde: el escritorio se traba mientras otra cosa trabaja.",+ "perf.dnote.deskOver": "Con carga, el 1 % más lento de los cuadros tardó {p99} ms, más que el período de {budget} ms.",+ "perf.dnote.none": "No se registraron cuadros.","perf.full": "Prueba completa",- "perf.fullNote": "La prueba rápida dura alrededor de medio minuto. La completa también mide el disco con un archivo temporal de hasta 1 GB (se borra al terminar) y mantiene todos los núcleos ocupados durante {min} minutos; en una tarjeta SD suma desgaste.",+ "perf.fullNote": "La prueba rápida dura alrededor de medio minuto. La completa también mide el disco con un archivo temporal de hasta 1 GB (se borra al terminar), decodifica cada códec de video en 1080p y 4K y mantiene todos los núcleos ocupados durante {min} minutos: entre 4 y 6 minutos en total. En una tarjeta SD suma desgaste.","perf.gpuKind.hardware": "GPU por hardware","perf.gpuKind.software": "renderizador por software (en la CPU)","perf.gpuKind.virtual": "GPU virtual (dibuja el anfitrión)",@@ -299,6 +326,10 @@"perf.kernel": "kernel {v}","perf.liveNo": "instalado","perf.liveYes": "sesión live desde el pendrive",+ "perf.m.comp_fps": "Cuadros mostrados",+ "perf.m.comp_missed": "Cuadros tarde",+ "perf.m.comp_p50": "Tiempo para armar un cuadro, mediana",+ "perf.m.comp_p99": "Tiempo para armar un cuadro, el 1 % más lento","perf.m.cpu_js_1": "JavaScript, un núcleo","perf.m.cpu_js_n": "JavaScript, todos los núcleos","perf.m.cpu_matmul_1": "Producto de matrices, un núcleo",@@ -307,6 +338,11 @@"perf.m.cpu_sha256_n": "SHA-256, todos los núcleos","perf.m.cpu_xz_1": "Descompresión de paquetes, un núcleo","perf.m.cpu_xz_n": "Descompresión de paquetes, todos los núcleos",+ "perf.m.desk_fps": "Cuadros mostrados",+ "perf.m.desk_missed": "Cuadros tarde",+ "perf.m.desk_p50": "Tiempo para armar un cuadro, mediana",+ "perf.m.desk_p99": "Tiempo para armar un cuadro, el 1 % más lento",+ "perf.m.desk_work": "Trabajo hecho por la carga mientras tanto","perf.m.disk_random4k": "Lecturas aleatorias de 4 KiB","perf.m.disk_seqread": "Lectura secuencial","perf.m.disk_seqwrite": "Escritura secuencial",@@ -319,8 +355,17 @@"perf.m.mem_triad": "Ancho de banda de memoria (tríada)","perf.m.sustained_end": "Todos los núcleos, últimos 10 s","perf.m.sustained_start": "Todos los núcleos, primeros 10 s",+ "perf.m.video_av1_1080": "Decodificación AV1, 1080p",+ "perf.m.video_enc_h264": "Codificador del escritorio remoto, H.264",+ "perf.m.video_enc_vp8": "Codificador del escritorio remoto, VP8",+ "perf.m.video_h264_1080": "Decodificación H.264, 1080p",+ "perf.m.video_h264_2160": "Decodificación H.264, 4K",+ "perf.m.video_hevc_1080": "Decodificación HEVC, 1080p",+ "perf.m.video_hevc_2160": "Decodificación HEVC, 4K",+ "perf.m.video_vp9_1080": "Decodificación VP9, 1080p","perf.maxMHz": "hasta {v} MHz","perf.measuring": "Midiendo: {what}",+ "perf.mode.desktop": "Impacto en el escritorio","perf.mode.full": "Prueba completa","perf.mode.quick": "Prueba rápida","perf.noRefs": "Todavía no hay máquinas de referencia medidas con esta versión de LordBench.",@@ -345,13 +390,18 @@"perf.quietNo": "ocupado ({pct} % de CPU después de {s} s)","perf.quietYes": "en reposo ({pct} % de CPU, esperó {s} s)","perf.ranAt": "{mode} · {time} · {s} s",+ "perf.ref.pi5": "la Raspberry Pi 5","perf.ref.vm": "la VM de referencia","perf.sample": "{s} s: {g} GFLOP/s, {temp} °C","perf.sampleNoTemp": "{s} s: {g} GFLOP/s",+ "perf.sceneCard": "Tarjeta {n}",+ "perf.sceneTitle": "Ventana de prueba","perf.skip.failed": "falló","perf.skip.memory": "memoria insuficiente","perf.skip.mode": "solo en la completa",+ "perf.skip.nocodec": "el FFmpeg de este sistema no tiene el códec","perf.skip.nodev": "sin dispositivo",+ "perf.skip.noframes": "se mostraron muy pocos cuadros (¿otra sesión adelante?)","perf.startEnd": "{a} al empezar, {b} al terminar","perf.startFailed": "LordBench no pudo arrancar (hay otra prueba en curso o falta el ayudante lord-bench).","perf.status.cancelled": "cancelada",@@ -365,6 +415,7 @@"perf.timesRef": "×{x} {ref}","perf.unavailable": "LordBench no está disponible en esta sesión.","perf.v.compatibility": "Compatibilidad",+ "perf.v.desktop": "Fluidez","perf.v.performance": "Rendimiento","perf.v.stability": "Estabilidad","perf.verdictState.fail": "Problemas",diff --git a/assets/locales/pt/errors.json b/assets/locales/pt/errors.jsonindex 6ffd3c7..81f7391 100644--- a/assets/locales/pt/errors.json+++ b/assets/locales/pt/errors.json@@ -53,6 +53,8 @@"backup.tooManyExclusions": "Exclusões demais","backup.verifyFailed": "Um arquivo do backup falhou na verificação (adulterado ou chave errada)","backup.wrongPassphrase": "Frase incorreta",+ "bench.bootTestFailed": "Não foi possível salvar o estado do teste de inicialização",+ "bench.bootTestLive": "O teste de inicialização não funciona na sessão ao vivo: nada do que ele registra sobrevive a uma reinicialização","camera.busy": "A câmera está ocupada","camera.failed": "A câmera parou de funcionar","camera.invalid": "Câmera inválida",diff --git a/assets/locales/pt/greeter.json b/assets/locales/pt/greeter.jsonindex 96931c5..f6e1638 100644--- a/assets/locales/pt/greeter.json+++ b/assets/locales/pt/greeter.json@@ -1,4 +1,6 @@{+ "bootTest": "Medindo o tempo de inicialização: inicialização {k} de {n} concluída. Reiniciando em {s} s. Entrar também interrompe o teste.",+ "bootTestCancel": "Parar o teste","busy": "Um momento…","cancel": "Cancelar","confirmRestart": "Há sessões abertas: o que não estiver salvo será perdido. Reiniciar mesmo assim?",diff --git a/assets/locales/pt/status.json b/assets/locales/pt/status.jsonindex aff4ba1..a9b1860 100644--- a/assets/locales/pt/status.json+++ b/assets/locales/pt/status.json@@ -1,4 +1,6 @@{+ "bench.bootTestCancelled": "Teste de inicialização interrompido",+ "bench.bootTestSet": "Teste de inicialização: {n} inicializações","disk.cancelling": "Cancelando","disk.ejected": "Ejetado","disk.erased": "Apagado",diff --git a/assets/locales/pt/sysinfo.json b/assets/locales/pt/sysinfo.jsonindex 97d4795..15d7bad 100644--- a/assets/locales/pt/sysinfo.json+++ b/assets/locales/pt/sysinfo.json@@ -245,6 +245,13 @@"perf.bootFirst": "primeira inicialização {s} s","perf.bootLine": "mediana {median} s (de {min} a {max} s, {n} inicializações)","perf.bootOnlyFirst": "por enquanto só a primeira inicialização: {s} s",+ "perf.bootTestAsk": "Meça o tempo de inicialização em várias reinicializações seguidas. O computador reinicia sozinho 30 s depois que a tela de login aparece; entrar interrompe. Só administradores.",+ "perf.bootTestLine": "teste: mediana {median} s (de {min} a {max} s, {n} de {of} inicializações)",+ "perf.bootTestRestart": "Reiniciar agora",+ "perf.bootTestRunning": "Teste de inicialização: {done} de {n} inicializações medidas.",+ "perf.bootTestSet": "Há um teste de inicialização de {n} inicializações preparado: começa na próxima reinicialização.",+ "perf.bootTestStart": "Reiniciar e medir…",+ "perf.bootTestStop": "Parar o teste","perf.boots": "Tempo de inicialização","perf.bootsFooter": "Do início do kernel até o primeiro quadro na tela, registrado a cada inicialização. A primeira inicialização após uma atualização fica à parte: ela monta caches.","perf.c.cpufreq": "Frequência do processador",@@ -258,17 +265,28 @@"perf.c.threads": "Threads","perf.c.versions": "Versões","perf.cancel": "Parar",+ "perf.cat.compositor": "Compositor sozinho","perf.cat.cpu": "Processador",+ "perf.cat.desktop": "Com todos os núcleos ocupados","perf.cat.gpu": "Gráficos","perf.cat.memory": "Memória","perf.cat.storage": "Armazenamento","perf.cat.sustained": "Carga contínua",+ "perf.cat.video": "Vídeo","perf.catTimes": "{cat} ×{x}","perf.compatCount": "{works} funcionam, {limits} com limites, {no} não funcionam (aba Compatibilidade).","perf.composition": "composição: {c}","perf.conditions": "Condições","perf.conditionsFooter": "O que afeta os números, registrado com cada resultado. Só se comparam resultados da mesma versão do LordBench.","perf.critical": "crítica a {v} °C",+ "perf.deskFooter": "Quanto o compositor demora para montar cada quadro, frente ao período de atualização da tela em uso ({budget} ms). Passa quando o percentil 99 cabe nesse período e poucos quadros chegam atrasados.",+ "perf.deskKeepStill": "Uma janela de teste se move sozinha pela tela, primeiro sozinha e depois com todos os núcleos ocupados na prioridade mais baixa. Não use o mouse nem o teclado até terminar.",+ "perf.deskState.fail": "Com problemas",+ "perf.deskState.pass": "Fluido",+ "perf.deskState.unknown": "Não medido",+ "perf.deskState.warn": "Com observações",+ "perf.deskTitle": "Impacto na área de trabalho",+ "perf.desktop": "Impacto na área de trabalho","perf.diff.composition": "Composição da tela","perf.diff.governor": "Governor da CPU","perf.diff.gpuKind": "Renderizador",@@ -289,8 +307,17 @@"perf.disk.unknown": "Disco desconhecido","perf.disk.usb": "Unidade USB","perf.disk.virtual": "Disco virtual",+ "perf.dnote.compFits": "Sozinho, 99 % dos quadros foram montados em {p99} ms ou menos, dentro do período de {budget} ms.",+ "perf.dnote.compMissed": "Sozinho, {pct} % dos quadros chegaram atrasados.",+ "perf.dnote.compMissedMany": "Sozinho, {pct} % dos quadros chegaram atrasados: a área de trabalho trava.",+ "perf.dnote.compOver": "Sozinho, o 1 % mais lento dos quadros levou {p99} ms, mais que o período de {budget} ms.",+ "perf.dnote.deskFits": "Com carga, 99 % dos quadros foram montados em {p99} ms ou menos, dentro do período.",+ "perf.dnote.deskMissed": "Com carga, {pct} % dos quadros chegaram atrasados.",+ "perf.dnote.deskMissedMany": "Com carga, {pct} % dos quadros chegaram atrasados: a área de trabalho trava enquanto outra coisa trabalha.",+ "perf.dnote.deskOver": "Com carga, o 1 % mais lento dos quadros levou {p99} ms, mais que o período de {budget} ms.",+ "perf.dnote.none": "Nenhum quadro foi registrado.","perf.full": "Teste completo",- "perf.fullNote": "O teste rápido leva cerca de meio minuto. O completo também mede o disco com um arquivo temporário de até 1 GB (apagado no fim) e mantém todos os núcleos ocupados por {min} minutos; num cartão SD aumenta o desgaste.",+ "perf.fullNote": "O teste rápido leva cerca de meio minuto. O completo também mede o disco com um arquivo temporário de até 1 GB (apagado no fim), decodifica cada codec de vídeo em 1080p e 4K e mantém todos os núcleos ocupados por {min} minutos: de 4 a 6 minutos no total. Num cartão SD aumenta o desgaste.","perf.gpuKind.hardware": "GPU por hardware","perf.gpuKind.software": "renderizador por software (na CPU)","perf.gpuKind.virtual": "GPU virtual (o hospedeiro desenha)",@@ -299,6 +326,10 @@"perf.kernel": "kernel {v}","perf.liveNo": "instalado","perf.liveYes": "sessão live a partir do pendrive",+ "perf.m.comp_fps": "Quadros mostrados",+ "perf.m.comp_missed": "Quadros atrasados",+ "perf.m.comp_p50": "Tempo para montar um quadro, mediana",+ "perf.m.comp_p99": "Tempo para montar um quadro, o 1 % mais lento","perf.m.cpu_js_1": "JavaScript, um núcleo","perf.m.cpu_js_n": "JavaScript, todos os núcleos","perf.m.cpu_matmul_1": "Produto de matrizes, um núcleo",@@ -307,6 +338,11 @@"perf.m.cpu_sha256_n": "SHA-256, todos os núcleos","perf.m.cpu_xz_1": "Descompressão de pacotes, um núcleo","perf.m.cpu_xz_n": "Descompressão de pacotes, todos os núcleos",+ "perf.m.desk_fps": "Quadros mostrados",+ "perf.m.desk_missed": "Quadros atrasados",+ "perf.m.desk_p50": "Tempo para montar um quadro, mediana",+ "perf.m.desk_p99": "Tempo para montar um quadro, o 1 % mais lento",+ "perf.m.desk_work": "Trabalho feito pela carga enquanto isso","perf.m.disk_random4k": "Leituras aleatórias de 4 KiB","perf.m.disk_seqread": "Leitura sequencial","perf.m.disk_seqwrite": "Escrita sequencial",@@ -319,8 +355,17 @@"perf.m.mem_triad": "Largura de banda da memória (tríade)","perf.m.sustained_end": "Todos os núcleos, últimos 10 s","perf.m.sustained_start": "Todos os núcleos, primeiros 10 s",+ "perf.m.video_av1_1080": "Decodificação AV1, 1080p",+ "perf.m.video_enc_h264": "Codificador da área de trabalho remota, H.264",+ "perf.m.video_enc_vp8": "Codificador da área de trabalho remota, VP8",+ "perf.m.video_h264_1080": "Decodificação H.264, 1080p",+ "perf.m.video_h264_2160": "Decodificação H.264, 4K",+ "perf.m.video_hevc_1080": "Decodificação HEVC, 1080p",+ "perf.m.video_hevc_2160": "Decodificação HEVC, 4K",+ "perf.m.video_vp9_1080": "Decodificação VP9, 1080p","perf.maxMHz": "até {v} MHz","perf.measuring": "Medindo: {what}",+ "perf.mode.desktop": "Impacto na área de trabalho","perf.mode.full": "Teste completo","perf.mode.quick": "Teste rápido","perf.noRefs": "Ainda não há máquinas de referência medidas com esta versão do LordBench.",@@ -345,13 +390,18 @@"perf.quietNo": "ocupado ({pct} % de CPU depois de {s} s)","perf.quietYes": "em repouso ({pct} % de CPU, esperou {s} s)","perf.ranAt": "{mode} · {time} · {s} s",+ "perf.ref.pi5": "o Raspberry Pi 5","perf.ref.vm": "a VM de referência","perf.sample": "{s} s: {g} GFLOP/s, {temp} °C","perf.sampleNoTemp": "{s} s: {g} GFLOP/s",+ "perf.sceneCard": "Cartão {n}",+ "perf.sceneTitle": "Janela de teste","perf.skip.failed": "falhou","perf.skip.memory": "memória insuficiente","perf.skip.mode": "só no completo",+ "perf.skip.nocodec": "o FFmpeg deste sistema não tem o codec","perf.skip.nodev": "sem dispositivo",+ "perf.skip.noframes": "poucos quadros mostrados (outra sessão na frente?)","perf.startEnd": "{a} no início, {b} no fim","perf.startFailed": "O LordBench não pôde iniciar (outro teste em curso ou falta o auxiliar lord-bench).","perf.status.cancelled": "cancelado",@@ -365,6 +415,7 @@"perf.timesRef": "×{x} {ref}","perf.unavailable": "O LordBench não está disponível nesta sessão.","perf.v.compatibility": "Compatibilidade",+ "perf.v.desktop": "Fluidez","perf.v.performance": "Desempenho","perf.v.stability": "Estabilidade","perf.verdictState.fail": "Problemas",diff --git a/docs/BENCHMARK.md b/docs/BENCHMARK.mdindex ece51ce..e5c2cbe 100644--- a/docs/BENCHMARK.md+++ b/docs/BENCHMARK.md@@ -197,7 +197,10 @@ Three separate verdicts, never folded into one score:Unreleased; the latest release is 0.8.5-beta. Checked on VM 116 (Proxmox VE, 8 vCPU of a Xeon Silver4108, 4 GB, virtio disk, no GPU passthrough: Mesa's llvmpipe) from a terminal (`build/lordbench-cli`) and-in an isolated headless session through System Information → Performance.+in an isolated headless session through System Information → Performance, and on a Raspberry Pi 5 16 GB+(SD card, the LordOS kernel 6.18.57-lordos.3, V3D 7.1, the fan on its header) from a terminal and in the+maintainer's own session on a 1920×1080 60 Hz monitor (HDMI-A-1 and HDMI-A-2 both tried), with a 0.8.6+development package.- **`lord-bench`** (`server/src/bench/lbmain.c`, `mk/lordbench.mk`): launched by lord-server(`bench/lbrun.c`) from its own folder only (owned by root or the user, not writable by others), no@@ -206,7 +209,9 @@ in an isolated headless session through System Information → Performance.GPU's render node (`/dev/dri/renderD128…`) and, for Full, an unnamed scratch file (`O_TMPFILE` in`~/.cache`, at most 1 GB and a quarter of the free space). Then it locks itself in with`sandbox_apply_helper` before any work (scope `lordos-bench.scope`, 2 GB memory cap, read-only- `/usr/lib`, `/usr/share`, `/sys/dev/char`, `/sys/devices` for Mesa, DRM and dma-buf ioctls only when+ `/usr/lib`, `/usr/share`, `/sys/dev/char`, `/sys/devices`, `/sys/firmware/devicetree` and `/dev/dri` for+ Mesa (without the last two, Mesa's loader on the Pi 5 could not identify the V3D device and every GPU+ measurement was skipped; the GPU itself is still reached only through the render node fd), DRM and dma-buf ioctls only whenit got the render node, no sockets, no exec, threads only). It answers only with fixed-size records(`LbMsg`: a measurement id, a value and its spread); lord-server checks each one (`lb_msg_valid`: themagic, a known kind and id, finite values in range) and writes the JSON itself. Stopping is a SIGKILL.@@ -229,6 +234,40 @@ in an isolated headless session through System Information → Performance.disappears with the fd.- Sustained (Full only, 3 minutes from the app): the matrix product on every core, a sample every10 s with the temperature lord-server read at that moment.+- **Video** (after the helper's measurements, Quick and Full): a `lord-media` job (`MK_VBENCH`,+ `media/helper/lm_vbench.c`, launched from lord-server's folder by `bench/lbvideo.c`, no fds at all). It makes its+ own test clips in memory from a synthetic picture (gradients, moving blocks and a little noise, the same every+ time) with this system's FFmpeg: H.264 (libx264 `veryfast`, 8 Mbit/s), HEVC (libx265 `ultrafast`), VP9 (libvpx+ realtime) and AV1 (SVT-AV1 preset 12, else libaom or rav1e) at 1080p, and H.264 and HEVC at 4K. Each clip is+ decoded in software the way the player does (every core, frame and slice threads) over and over for at least a+ second, three times, as frames per second. Then the remote desktop's own encoders with their settings+ (`lm_stream_sw_encoder`: libx264 `ultrafast`/`zerolatency`, libvpx VP8 realtime) encode 1920×1080 frames as fast+ as they can. Quick measures H.264 at 1080p and the H.264 encoder; an encoder or decoder this FFmpeg lacks is+ "skipped: no codec". lord-media answers only `MM_BENCH` records (a measurement, a kind, a rate in thousandths),+ checked by `lbv_record_valid` before they become results. Hardware decoding is not measured: neither test+ machine has it (no VA-API on VM 116; the Pi 5's HEVC decoder needs FFmpeg's `v4l2request`, which Debian's FFmpeg+ lacks).+- **Desktop impact** (its own button, its own result file `lordbench-desktop.json`): after the quiet wait,+ System Information opens a second window with a scene (cards, shadows and one element that turns through+ `lord.setStyle`) and lord-server moves that window along a figure of eight through the drag's own path+ (`lord.wm.script`, `grab_script_begin` in `ui/grab.c`: painted once into a layer, one step per frame, no JS per+ frame). lord-server records every frame it builds and every frame the main display shows (`bench/lbframes.c`,+ from `render()` and the page flips; one atomic read per frame when off): 10 s alone, then 10 s while `lord-bench`+ loads every core at the lowest priority (`LB_MODE_LOAD`: nice 19, idle I/O class) after 2 s of warm-up. Each+ phase gives the frames shown per second, the time to build a frame (median and 99th percentile) and the share of+ intervals between shown frames longer than 1.5 refresh periods; the load phase also gives the work the load+ got done. The verdict compares the 99th percentile with the refresh period actually in use and warns above 5 %+ late frames (problems above 25 %). Without a monitor the compositor draws only while someone watches (the+ remote desktop), so a headless session gives "skipped: too few frames" unless a viewer is connected. Input+ latency is not measured yet.+- **Boot time test** (Performance → Boot time, administrators): N boots in a row (3, 5 or 10). The closed admin+ action `boot-test <n>` writes `/var/lib/lordos/boot-test` in a fixed format (`bench/boottest.c`) and the session+ restarts as usual (its confirmation included). At each boot's first frame lord-sessiond records the boot with its+ number in the test and, while boots are left, writes the file again and restarts 30 s later; the login screen+ shows the boot and the countdown with **Stop the test**, and a login there stops it too (`docs/SESSIONS.md`,+ "Boot time"). The test always ends: the count only goes down, a state older than 30 minutes is discarded, and+ lord-sessiond reads the file again right before restarting. The Boot time group shows the latest test's median+ and range per version.- **Guards and conditions** (`bench/lbcond.c`, read by lord-server, never by the helper): the hottestthermal zone (or the CPU's coretemp/k10temp/zenpower hwmon sensor) and the lowest passive andcritical trip points; the x86 thermal throttle counters; the Raspberry Pi firmware's `get_throttled`@@ -239,7 +278,7 @@ in an isolated headless session through System Information → Performance.tests stops when the throttle counters grow or the Pi says it is throttling now; in the sustained testthrottling is recorded with its time and temperature instead. The kind of disk under the scratch fileis recorded (NVMe, SD/eMMC, SSD, HDD, USB, virtual, or RAM in the live session). Unit tests on fake- sysfs trees (`tests/lordbench_test.c`, 260 checks): an x86 laptop on battery, a Raspberry Pi 5.+ sysfs trees (`tests/lordbench_test.c`): an x86 laptop on battery, a Raspberry Pi 5.- **The result** (`~/.local/state/lordos/lordbench.json`, the previous one kept as`lordbench-prev.json`; a refused run keeps the last result): LordBench's version, the mode, status andstop reason, LordOS and kernel versions, live or installed, threads, the quiet wait, conditions before@@ -255,25 +294,59 @@ in an isolated headless session through System Information → Performance.throttling, under-voltage, a sustained drop above 10 % and a busy start), every measurement with its"×N" and its change against the previous run, the conditions that differ from the previous run, theconditions, the boot times per version, and **Save to Documents** (the JSON). Nothing is sent.-- **Reference machines** (`apps/sysinfo/references.js`): only VM 116 so far (a Full run with a 30 s- sustained test, numbers below). The Raspberry Pi 5 8 GB and the modest x86 PC are added when measured.--VM 116, Full, LordBench 1 (2026-10-27): SHA-256 167 MB/s on one core and 977 MB/s on eight; matrix-product 3.4 and 19.7 GFLOP/s; xz 61 and 354 MB/s; QuickJS 58 and 336 runs/s; memory copy 20.2 GB/s,-triad 22.8 GB/s, latency 90 ns; llvmpipe: scene 794 fps, fill 395 Mpixel/s, upload 9,676 MB/s, 8 layers-22.6 fps; virtio disk: 219 MB/s write, 517 MB/s read, 5,619 random reads/s; sustained 19.8 GFLOP/s from-start to end. A Quick run took 33 s, a Full run with 30 s sustained 117 s.--The same Full run from System Information in the isolated headless session (3 minutes of sustained load;-its home is on tmpfs, so the storage test measured memory and says so, ×24 the reference's virtio disk):+- **Reference machines** (`apps/sysinfo/references.js`): VM 116 and the Raspberry Pi 5 16 GB, each a Full run+ copied from the `lordbench.json` it wrote (numbers below). The modest x86 PC is added when measured.++VM 116, Full with 30 s sustained, LordBench 1 (2026-10-27, 159 s): SHA-256 166 MB/s on one core and 984 MB/s on+eight; matrix product 3.3 and 19.9 GFLOP/s; xz 60 and 363 MB/s; QuickJS 57 and 336 runs/s; memory copy+20.0 GB/s, triad 22.8 GB/s, latency 91 ns; llvmpipe: scene 802 fps, fill 407 Mpixel/s, upload 9,457 MB/s,+8 layers 22.9 fps; virtio disk: 378 MB/s write, 517 MB/s read, 6,256 random reads/s; sustained 19.6 → 19.8+GFLOP/s; software video decoding H.264 1080p 399 fps, HEVC 1080p 385, VP9 1080p 215, AV1 1080p 201, H.264 4K+76, HEVC 4K 102; encoders H.264 106 fps and VP8 54 fps at 1080p. A Quick run took 33 s.++Raspberry Pi 5 16 GB, Full with 180 s sustained, LordBench 1 (2026-10-27, 339 s): SHA-256 933 MB/s on one core+and 3,693 MB/s on four (the CPU's SHA instructions); matrix product 2.26 and 5.99 GFLOP/s; xz 67 and 254 MB/s;+QuickJS 54 and 181 runs/s; memory copy 7.6 GB/s, triad 7.3 GB/s, latency 115 ns; V3D (hardware): scene 795 fps,+fill 2,455 Mpixel/s, upload 3,897 MB/s, 8 layers 115 fps; SD card: 66 MB/s write, 91 MB/s read, 2,692 random+reads/s; sustained 5.86 → 5.88 GFLOP/s over 3 minutes with the fan, 55.6 °C at most, no speed lost; software+video decoding H.264 1080p 258 fps, HEVC 1080p 246, VP9 1080p 204, AV1 1080p 159, H.264 4K 55, HEVC 4K 57;+encoders H.264 75 fps and VP8 55 fps. A Quick run took 34 s. On this kernel the firmware's `get_throttled` file and+a cpufreq cooling device are not exposed, so firmware throttling can't be seen during a run (the stop on+throttling does not fire on the Pi; the `rpi_volt` under-voltage alarm is read); the sustained curve and the+temperature are the evidence that it did not throttle.++Desktop impact:++| Machine | Phase | Frames shown | Build p50 | Build p99 | Late |+|---|---|---|---|---|---|+| VM 116, headless, one remote viewer, llvmpipe | alone | 59.6 fps | 5.4 ms | 13.3 ms | — |+| | under load | — | — | 22.9 ms | 12.5 % |+| Pi 5, 1920×1080 60 Hz monitor, GPU composition | alone | 59.4 fps | 10.9 ms | 13.0 ms | 1.0 % |+| | under load | 24.0 fps | 20.1 ms | 29.3 ms | 96.5 % |++On the Pi the desktop stays at the refresh rate alone, but under an all-core load at the lowest priority (which+still got 5.0 GFLOP/s done) it falls to 24 frames per second: a stability problem LordBench found, to be+investigated (the time to build a frame is already 11 ms of the 16.7 ms budget at rest, and the load competes for+the cores and the memory bandwidth the compositor's paint threads use). The first scene moved its window from JS+(`wm.move` every frame) and measured React instead of the compositor (12.8 fps on VM 116); it was replaced by the+drag's own path in C before these numbers.++Boot: the Pi 5 reaches the login screen on its monitor 5.99 s after the kernel starts (lord-sessiond's record;+systemd-analyze gives 2.1 s kernel + 4.2 s userspace). Boots where the monitor was connected late took 61 and+103 s, which is the wait for the monitor, not the boot. The N-boot test was checked by its unit tests+(`tests/lordbench_test.c`: the state file's format, parsing, ownership, staleness and countdown) only;+the measured Pi number is a single boot.++The same Full run from System Information in VM 116's isolated headless session (3 minutes of sustained load;+its home is on tmpfs, so the storage test measured memory and says so, ×24 the reference's virtio disk; this+screenshot predates the video and desktop parts):-Not built yet: the desktop-impact mode (the helper already takes the low-priority flag, `LB_GO_LOW`;-the scripted scene and the frame-time and input-latency measurement while it runs are missing), the-compositor workload (lord-server's own frame counters during a scripted window drag), the video-workload (clips decoded in `lord-media`, hardware and software, and the remote desktop's encoders),-rebooting N times for the boot time, repeating the helper-sandbox self-test inside `lord-bench` (`sec.helper-sandbox`), the Pi 5 and x86 PC references, and `lordos-sysreport bench`.+Not built yet: input latency in the desktop-impact mode; hardware video decoding (no test machine has VA-API, and+the Pi 5's HEVC decoder needs FFmpeg's `v4l2request`); the layout, paint and shaping CPU workloads; repeating the+helper-sandbox self-test inside `lord-bench` (`sec.helper-sandbox`); detecting the Pi's firmware throttling+during a run on kernels that don't expose it; the x86 PC reference; and `lordos-sysreport bench`.## 0.8.7 — Community hardware reportsdiff --git a/docs/MEDIA.md b/docs/MEDIA.mdindex 77db2a2..0cfc23c 100644--- a/docs/MEDIA.md+++ b/docs/MEDIA.md@@ -77,7 +77,9 @@ We took the way the apps of popular desktop systems work, never their logos or tthe background; images, edits and exports in the foreground). Workers exit on their own after20 s without work. A one-shot `MK_HWPROBE` helper lists, once per boot, which codecs VA-APIdecodes on the render nodes it gets (`lm_hwprobe.c`, for "Video in the browser": see- [VIDEO.md](VIDEO.md)).+ [VIDEO.md](VIDEO.md)). A one-shot `MK_VBENCH` helper (0.8.6, LordBench) gets no fds at all: it makes+ its test clips in memory and answers only fixed `MM_BENCH` records (`lm_vbench.c`, lord-server's side in+ `bench/lbvideo.c`; see [BENCHMARK.md](BENCHMARK.md)).- **It never receives a path.** lord-server validates each path with the same rules as `lord.fs`(home folder and the user's mounts), opens the file and passes it the fd.- Outputs are created as temporary files next to the destination. When they finish well they'rediff --git a/docs/PAPER-VALIDATION.md b/docs/PAPER-VALIDATION.mdindex 9d689e6..f315817 100644--- a/docs/PAPER-VALIDATION.md+++ b/docs/PAPER-VALIDATION.md@@ -106,15 +106,16 @@ memory from a process's RSS (§7.1) and points to versioned results (§11.5, `do| 7.2 | — | New in 0.8.5: remote desktop CPU reference (`REMOTE.md`, "Measurements (0.8.5, CPU reference)") | Added in the 0.8.5 edition (§7.2) || 7.3 | GPU benefits on real cards not measured | — | **Untested** || 7.4 | Pi 5: build 1 min 02 s, tests 23/0/0, NEON 2.0–2.3×, idle 36 MB, fan behaviour | Measured once on the Pi | Measured |+| 7.4 | — | New, 0.8.6 in development: with a 1920×1080 60 Hz monitor, login screen 5.99 s after the kernel starts; desktop 59.4 fps alone (p99 13.0 ms, 1 % late) and 24 fps under a low-priority all-core load (96.5 % late); 3 minutes sustained at 5.9 GFLOP/s, 55.6 °C; software video decoding per codec. LordBench on the Pi (`BENCHMARK.md`, "Built so far") | Measured with LordBench (one run each); the load result is an open problem || 7.5 | No measurements on real PCs | — | **Untested** |## §10–§11 Limits and verification| § | Claim | How | State ||---|---|---|---|-| 10.2 | Untested on real hardware: AMD/Nvidia GPUs, monitors, laptops, Bluetooth, printers, scanners, FIDO2, mail providers | System Information reports (0.8.7: community reports) | **Untested** |+| 10.2 | Untested on real hardware: AMD/Nvidia GPUs, monitors on PCs (one 1920×1080 monitor tested on the Pi 5), laptops, Bluetooth, printers, scanners, FIDO2, mail providers | System Information reports (0.8.7: community reports) | **Untested** || 10.2 | Secure Boot must be off | System Information shows Secure Boot | Holds |-| 11.2 | `make test` 23 passed, 1 skipped | Today 23 passed, 0 failed, 9–10 skipped (node or data missing on the VM) | Holds |+| 11.2 | `make test` 23 passed, 1 skipped | Today (2026-10-27, VM 116) 23 passed, 0 failed, 12 skipped (the node suites; they pass on a machine with node) | Holds || 11.2 | 30,953 parser checks with mutation fuzzing | Tests (`remote-fuzz`, mail, doc, imager fuzzers) | Holds; count to refresh || 11.4 | Port 5673 closed until enabled | Check `remoteClosed` (effective) | Holds |@@ -141,7 +142,7 @@ State in the 0.8.5 edition (`web/content/paper/paper.en.md`, checked 2026-10-26)| Gap | Covers | Plan ||---|---|---|| A denied connection, tried on the user's machine | §6.6 effective | An app with network access and a temporary rule (Checks) |-| Repeatable performance numbers | §7 | LordBench (0.8.6, in development: CPU, memory, GPU offscreen, storage, sustained load and the boot time per version are built, `BENCHMARK.md` "Built so far"; idle memory and CPU, frame times under load, video and app start are not) |+| Repeatable performance numbers | §7 | LordBench (0.8.6, in development: CPU, memory, GPU offscreen, storage, sustained load, software video decoding and encoders, the desktop's frame times alone and under load, the boot time per version and the N-boot test are built, with VM 116 and the Pi 5 as references, `BENCHMARK.md` "Built so far"; idle memory and CPU, input latency, hardware video decoding and app start are not) || Rendering, 3D and video on every GPU | §3.2, §7.2–7.3 | The visual test bench below || Every key, the mouse, touchpads, gamepads, and the Wayland protocols | §3.3–§3.4 | The visual test bench below || Real hardware | §10.2 | Reports from System Information (0.8.7) |diff --git a/docs/PAPER.md b/docs/PAPER.mdindex bd9395c..46a2785 100644--- a/docs/PAPER.md+++ b/docs/PAPER.md@@ -641,11 +641,11 @@ The Raspberry Pi 5 is the only supported board. Results on a real board (16 GB,**Fans.** On the Pi 5 in a test case, `lord-fand` kept the fan off at 50–53 °C during a 4-thread load (the aluminium case acts as a heatsink), drove it to 55 % (4,500 RPM) and full speed (7,400 RPM) with test curves, and restored the kernel's own settings after `SIGTERM` and `kill -9` (`docs/FANS.md`).-**Monitor and image.** Since 0.8.4.1 the Raspberry Pi 5 image shows the desktop on an HDMI monitor at the first boot (the display driver line in `config.txt` now comes after the firmware's auto-detection lines, and LordOS waits up to 30 s for the driver), sets the clock from the network, and ships Chromium and Firefox ESR. Since 0.8.4 the LordOS Pi kernel (`6.18.57-lordos.3-rpi-2712`) also destroys the connections of a blocked app. **Not measured yet on the board:** frame rates and GPU composition on a monitor.+**Monitor and image.** Since 0.8.4.1 the Raspberry Pi 5 image shows the desktop on an HDMI monitor at the first boot (the display driver line in `config.txt` now comes after the firmware's auto-detection lines, and LordOS waits up to 30 s for the driver), sets the clock from the network, and ships Chromium and Firefox ESR. Since 0.8.4 the LordOS Pi kernel (`6.18.57-lordos.3-rpi-2712`) also destroys the connections of a blocked app. **Measured on a monitor (LordBench, 0.8.6 in development):** the 0.8.5 image booted with a 1920×1080 60 Hz monitor on either HDMI port reaches the login screen 5.99 s after the kernel starts (systemd: 2.1 s kernel, 4.2 s userspace). With GPU composition (V3D) a window moved by the compositor keeps 59.4 frames per second, with a frame built in 10.9 ms (median) and 13.0 ms (99th percentile) and 1.0 % of frames late; under an all-core load at the lowest priority it falls to 24 frames per second with 96.5 % late, a problem LordBench found that is still to be fixed. In a 3-minute all-core load with the fan the board kept 5.9 GFLOP/s at 55.6 °C at most, and it decodes 1080p video in software at 258 (H.264), 246 (HEVC), 204 (VP9) and 159 (AV1) frames per second.### 7.5 Modern PCs-There are no measurements on real PCs in the repository yet. The ISO is tested on virtual machines (UEFI and BIOS); testing on a real AMD machine from the live USB is planned. LordBench (0.8.6) is designed to measure memory and CPU at idle, boot time, frame times, video and app start in a repeatable way, and community hardware reports (0.8.7) to collect them from real machines (`docs/BENCHMARK.md`). In development for 0.8.6 (unreleased; the latest release is 0.8.5-beta), its first part is built: a sandboxed `lord-bench` helper that measures the CPU, memory, the GPU offscreen, storage and a sustained load, stops near the temperature limit or when the processor throttles, and records the conditions of each run, shown in System Information → Performance as "×N" of reference machines; so far the only reference is a virtual machine, and the desktop-impact, compositor and video measurements are not built.+There are no measurements on real PCs in the repository yet. The ISO is tested on virtual machines (UEFI and BIOS); testing on a real AMD machine from the live USB is planned. LordBench (0.8.6) is designed to measure memory and CPU at idle, boot time, frame times, video and app start in a repeatable way, and community hardware reports (0.8.7) to collect them from real machines (`docs/BENCHMARK.md`). In development for 0.8.6 (unreleased; the latest release is 0.8.5-beta), its first part is built: a sandboxed `lord-bench` helper that measures the CPU, memory, the GPU offscreen, storage and a sustained load, stops near the temperature limit or when the processor throttles, and records the conditions of each run, shown in System Information → Performance as "×N" of reference machines; it also measures software video decoding and the remote desktop's encoders, the desktop's frame times alone and under a low-priority load, and boot time over several restarts. The references are a virtual machine and a Raspberry Pi 5 (§7.4); input latency, hardware video decoding and a real PC reference are not built yet.### Source files@@ -689,8 +689,8 @@ There are no measurements on real PCs in the repository yet. The ISO is tested o### 10.2 Known limitations-- Real hardware: AMD and Nvidia GPUs, real monitors, laptops (battery, backlight, lid), Bluetooth controllers, printers and scanners, FIDO2 keys and real mail providers are untested.-- The Raspberry Pi 5 is the only supported board, with LordOS's build of its kernel with Landlock; it hasn't been tested with a monitor, and its built image hasn't been booted yet.+- Real hardware: AMD and Nvidia GPUs, real monitors on PCs, laptops (battery, backlight, lid), Bluetooth controllers, printers and scanners, FIDO2 keys and real mail providers are untested.+- The Raspberry Pi 5 is the only supported board, with LordOS's build of its kernel with Landlock; its 0.8.5 image was booted and used on a 1920×1080 monitor on both HDMI ports; other monitors and resolutions are untested.- Linux apps are not sandboxed by default. X11 apps need Debian's `xwayland` package.- Firewall: no ask mode; domain rules don't see apps that resolve names with their own encrypted DNS.- Restrictions for Linux apps don't cover BlueZ over D-Bus, the system bus, the clipboard or apps started outside the app launcher; the `user@` union also holds the user's own services while a restricted app runs; a new PipeWire client has a window of a few milliseconds before the guard restricts it (§6.6).@@ -707,7 +707,7 @@ There are no measurements on real PCs in the repository yet. The ISO is tested o### 10.3 Next-Next, as planned in `docs/ROADMAP.md` and `docs/BENCHMARK.md`: **0.8.6, LordBench**, repeatable measurements of CPU, memory, GPU, the compositor, video and storage, and a Flathub section in the Store, which needs a design review first so Flatpak apps keep LordOS's app scopes, firewall and restrictions; **0.8.7, community hardware reports**, published from System Information with the user's consent; and a connection refused by the per-app firewall checked on the user's own computer. Xwayland and the Lord Classic theme, planned here for 1.0 in 0.8.0, shipped in 0.8.3. The Flatpak design review is written (`docs/FLATPAK.md`) and waits for the maintainer's approval before any code.+Next, as planned in `docs/ROADMAP.md` and `docs/BENCHMARK.md`: **0.8.6, LordBench**, repeatable measurements of CPU, memory, GPU, the compositor, video and storage; **0.8.7, community hardware reports**, published from System Information with the user's consent; and a connection refused by the per-app firewall checked on the user's own computer. Xwayland and the Lord Classic theme, planned here for 1.0 in 0.8.0, shipped in 0.8.3. Flatpak and Flathub are not planned for any release: a design review is kept in `docs/FLATPAK.md` for the future, but to keep the system stable it is not being built.After 1.0: a desktop virtualization app built on KVM and QEMU; an Android container with LineageOS and apps from LordOS's Store; the firewall's ask mode; accessibility; and a full demo video.diff --git a/docs/ROADMAP.md b/docs/ROADMAP.mdindex 7b9f9fe..a3b8bed 100644--- a/docs/ROADMAP.md+++ b/docs/ROADMAP.md@@ -706,8 +706,10 @@ the maintainer on 2026-10-27, item below).single score; results versioned.*In development (2026-10-27):* the `lord-bench` helper, CPU, memory, GPU, storage and sustained workloads,the thermal, throttle and battery guards, the boot history and System Information → Performance are built- (`BENCHMARK.md`, "Built so far"); desktop impact, the compositor and video workloads and the Pi 5 and x86 PC- references are left.+ (`BENCHMARK.md`, "Built so far"), and so are the video workloads (software decoding, the remote desktop's+ encoders), the desktop-impact mode (the compositor's frame times alone and under a low-priority load), the N-boot+ test and the Pi 5 reference. Left: input latency, hardware video decoding, the x86 PC reference,+ `lordos-sysreport bench`, and fixing what it found on the Pi 5 (the desktop falls to 24 fps under load).- [ ] **Community hardware reports (0.8.7)** — `BENCHMARK.md`. Share on GitHub with the`hardware-report` template (the user submits it, LordOS sends nothing), schema validation andlabels in a workflow, and a tested-hardware catalogue on lordos.org that the Compatibility paneldiff --git a/docs/SESSIONS.md b/docs/SESSIONS.mdindex ae76576..a0ad6a8 100644--- a/docs/SESSIONS.md+++ b/docs/SESSIONS.md@@ -209,6 +209,15 @@ started (`CLOCK_BOOTTIME`) with the LordOS version and build, and appends the sashows its own timer (`tools/boot/plymouth/lordos/lordos.script`). How to check and compare boots:[RESULTS.md](RESULTS.md), "Boot time: check it yourself".+**Boot time test (0.8.6, LordBench).** System Information → Performance can measure N boots in a row (2 to+10). The admin action `boot-test <n>` writes `/var/lib/lordos/boot-test` (root's, a fixed format:+`bench/boottest.c`) and the session restarts as usual. At each boot's first frame lord-sessiond records the+boot with `"test":k,"testOf":n` and, while boots are left, writes the file again and restarts 30 s later+(`boot_test_tick`). The login screen shows which boot it was and the countdown, with **Stop the test**; a login+there also stops it, and so does `boot-test-cancel`. Before restarting, lord-sessiond reads the file again and+restarts only if it still says what that boot wrote. A file older than 30 minutes (or from the future) is+discarded and `left` only goes down, so the test always ends; it is refused in the live session.+### Lock, switch user and log out**The login screen runs only when it is shown (0.8.5).** It used to stay running behind the sessiondiff --git a/docs/SETTINGS.md b/docs/SETTINGS.mdindex 1288202..89efdf0 100644--- a/docs/SETTINGS.md+++ b/docs/SETTINGS.md@@ -47,7 +47,8 @@ the time fields keep `direction: 'ltr'`.admin.c ─ display-brightness, power-profile, power-suspend, power-buttons, time-ntp, time-set,bt-unblock, rpi-case, video-optimize, hw-firmware-missing (the Store's suggestions,read-only), hw-memory-modules (System Information, read-only),- rpi-eeprom-status (read-only), rpi-eeprom-update+ rpi-eeprom-status (read-only), rpi-eeprom-update, boot-test, boot-test-cancel (LordBench's+ boot time test, docs/BENCHMARK.md)Cooling: lord.fan (ui/js_fan.c) ── /run/lordos/fand.sock ── lord-fand (root service, src/fan)```diff --git a/docs/WINDOWS.md b/docs/WINDOWS.mdindex b6ac5d9..dc7173f 100644--- a/docs/WINDOWS.md+++ b/docs/WINDOWS.md@@ -237,6 +237,11 @@ window side in `sdk/windows.js`.is going on, the SDK reads `lord.wm.pointer()` (`ui/js_wm.c`: the pointer and the drag's edges,no arguments, read only) every 90 ms and sets `snapPreview` when the zone changes; the theme drawsit under the moving window. Crossing into a zone costs one rebuild of what is below the window.+- **A scripted move (0.8.6, LordBench):** `wm.scriptMove(id, { rx, ry, periodMs })` asks lord-server to move+ the window along a figure of eight through this same path (`lord.wm.script`, `grab_script_begin` in+ `ui/grab.c`: the window painted once into a layer, one step per frame from the main loop, no button held+ and no JS per frame); pointer input or `wm.stopScript()` stops it. Only System Information's desktop+ scene uses it (`apps/sysinfo/scene.jsx`), to measure the compositor ([BENCHMARK.md](BENCHMARK.md)).- **On release** (`__lordWm('end')`) the SDK reads the pointer once more and snaps; the size frombefore the first snap is kept in `w.restore`. Dragging a snapped window away gives it that sizeback under the pointer, where it was grabbed. Resizing a snapped window keeps its new size.diff --git a/sdk/windows.js b/sdk/windows.jsindex 4a3be98..2b36802 100644--- a/sdk/windows.js+++ b/sdk/windows.js@@ -212,12 +212,13 @@ function watchSnap(id) {}, 90);}+const grabAreas = () => screen.displays.map((d) => workAreaOf(d)).map((a, i) => ({ x: screen.displays[i].x, w: screen.displays[i].w, y: a.y }));function beginGrab(id, edges) {const w = windows.get().find((x) => x.id === id);const f = frameNodes.get(id);if (!w || !f || w.maximized || w.fullscreen || typeof lord === 'undefined' || !lord.wm) return false;const [minW, minH] = registry.get(w.app)?.minSize || [160, 100];- const areas = screen.displays.map((d) => workAreaOf(d)).map((a, i) => ({ x: screen.displays[i].x, w: screen.displays[i].w, y: a.y }));+ const areas = grabAreas();if (!lord.wm.grab(f.node, edges, { inset: f.inset, minW, minH, minTop: areaOfWindow(w).y, areas })) return false;grab = { id, node: f.node, edges, f: { x: w.x, y: w.y, w: w.w, h: w.h } };if (!edges) watchSnap(id);@@ -381,6 +382,16 @@ export const wm = {frameRef,beginMove: (id) => beginGrab(id, 0),beginResize: (id, edges) => beginGrab(id, edges & 15),+ // LordBench's desktop scene (apps/sysinfo/scene.jsx): lord-server moves the window along a figure of+ // eight (rx × ry px, one turn every periodMs) through the drag's own path, one step per frame, until+ // stopScript() or pointer input. The store keeps the old place: the scene's window is closed after.+ scriptMove(id, { rx, ry, periodMs }) {+ const w = windows.get().find((x) => x.id === id);+ const f = frameNodes.get(id);+ if (!w || !f || w.maximized || w.fullscreen || typeof lord === 'undefined' || !lord.wm || typeof lord.wm.script !== 'function') return false;+ return !!lord.wm.script(f.node, { rx, ry, periodMs, inset: f.inset, minTop: areaOfWindow(w).y, areas: grabAreas() });+ },+ stopScript: () => { if (typeof lord !== 'undefined' && lord.wm) lord.wm.cancel(); },// Effective geometry (a maximized window takes the work area).frame: (w) => { if (!w.maximized) return w; const a = areaOfWindow(w); return { x: a.x, y: a.y, w: a.w, h: a.h }; },};diff --git a/server/Makefile b/server/Makefileindex 5e920bd..1313e7c 100644--- a/server/Makefile+++ b/server/Makefile@@ -499,7 +499,8 @@ build/lord-server: $(OBJ) build/obj/ui/stb.o $(QJS_OBJ) $(WL_OBJ)SESSIOND_OBJ := build/obj/remote/sessiond.o build/obj/remote/sess.o build/obj/remote/monitor.o build/obj/remote/conn.o \build/obj/remote/enc.o build/obj/remote/pages.o build/obj/sec/cgroup.o build/obj/remote/netsup.o build/obj/remote/cgsup.o \- build/obj/remote/rsec.o build/obj/remote/ipnet.o build/obj/remote/lockout.o build/obj/remote/rtcwire.o build/obj/remote/rtc.o+ build/obj/remote/rsec.o build/obj/remote/ipnet.o build/obj/remote/lockout.o build/obj/remote/rtcwire.o build/obj/remote/rtc.o \+ build/obj/bench/boottest.o# The remote desktop shows the screen only over WebRTC (docs/REMOTE.md, "Video (WebRTC)"): our own peer in# the bridge, on Debian's libsrtp2 and usrsctp (and OpenSSL's DTLS). lord-sessiond can't be built without# them (libsrtp2-dev, libusrsctp-dev).diff --git a/server/mk/lordbench.mk b/server/mk/lordbench.mkindex 48c6f29..4f8d0e7 100644--- a/server/mk/lordbench.mk+++ b/server/mk/lordbench.mk@@ -3,9 +3,10 @@# sustained load), and lord-server's side (lbrun.c: conditions, the quiet wait, thermal and throttle# guards, the result file; lord.sysinfo.bench in ui/js_hw.c). The helper links libc, QuickJS (one of# its workloads) and, with GPU=1, Mesa (GBM, EGL, GLESv2); nothing else.-LB_SRV_SRC := src/bench/lbrun.c src/bench/lbcond.c src/bench/lbproto.c src/bench/bench.c+LB_SRV_SRC := src/bench/lbrun.c src/bench/lbcond.c src/bench/lbproto.c src/bench/bench.c src/bench/lbframes.c src/bench/lbvideo.cLB_SRV_OBJ := $(LB_SRV_SRC:src/%.c=build/obj/%.o)-$(LB_SRV_OBJ): $(wildcard src/bench/*.h) build/gen/lord_version.h+$(LB_SRV_OBJ): $(wildcard src/bench/*.h) src/media/proto.h build/gen/lord_version.h+build/obj/main.o: src/bench/lbframes.hbuild/lord-server: $(LB_SRV_OBJ)build/obj/ui/js_hw.o: src/bench/lbrun.h@@ -29,14 +30,16 @@ build/lord-bench: $(LB_SRC) $(LB_GL_SRC) build/obj/ui/stb.o $(QJS_OBJ) build/gen# the workloads (short), the record checks, the thermal guard on fake sysfs trees and the boot historytest: build/lordbench-testbuild/lordbench-test: tests/lordbench_test.c src/bench/lbwork.c src/bench/lbproto.c src/bench/lbcond.c src/bench/lbrun.c src/bench/bench.c \- src/pkg/crypto.c src/pkg/xz.c src/hw/jbuf.c src/sec/json.c build/obj/ui/stb.o $(QJS_OBJ) build/gen/lb_corpus.h \+ src/bench/lbframes.c src/bench/lbvideo.c src/bench/boottest.c src/media/proto.c src/pkg/crypto.c src/pkg/xz.c src/hw/jbuf.c src/sec/json.c build/obj/ui/stb.o $(QJS_OBJ) build/gen/lb_corpus.h \build/gen/lord_version.h $(wildcard src/bench/*.h)@mkdir -p build$(CC) $(CPPFLAGS) $(CFLAGS) $(WARN) -std=c11 -o $@ tests/lordbench_test.c src/bench/lbwork.c src/bench/lbproto.c src/bench/lbcond.c \- src/bench/lbrun.c src/bench/bench.c src/pkg/crypto.c src/pkg/xz.c src/hw/jbuf.c src/sec/json.c build/obj/ui/stb.o $(QJS_OBJ) -lm -lpthread+ src/bench/lbrun.c src/bench/bench.c src/bench/lbframes.c src/bench/lbvideo.c src/bench/boottest.c src/media/proto.c src/pkg/crypto.c src/pkg/xz.c src/hw/jbuf.c src/sec/json.c build/obj/ui/stb.o $(QJS_OBJ) -lm -lpthread./$@ || { rm -f $@; exit 1; }-# from a terminal, without a session: build/lordbench-cli quick|full [sustained_s] (needs build/lord-bench)-build/lordbench-cli: tests/lordbench_cli.c src/bench/lbrun.c src/bench/lbcond.c src/bench/lbproto.c src/bench/bench.c src/hw/jbuf.c src/sec/json.c \+# from a terminal, without a session: build/lordbench-cli quick|full [sustained_s] (needs build/lord-bench, and build/lord-media+# for the video measurements; desktop mode needs a session: without one its frame results are skipped)+LB_CLI_SRC := tests/lordbench_cli.c src/bench/lbrun.c src/bench/lbcond.c src/bench/lbproto.c src/bench/bench.c src/bench/lbframes.c \+ src/bench/lbvideo.c src/bench/boottest.c src/media/proto.c src/hw/jbuf.c src/sec/json.c+build/lordbench-cli: $(LB_CLI_SRC) \build/gen/lord_version.h $(wildcard src/bench/*.h) build/lord-bench- $(CC) $(CPPFLAGS) $(CFLAGS) $(WARN) -std=c11 -o $@ tests/lordbench_cli.c src/bench/lbrun.c src/bench/lbcond.c src/bench/lbproto.c \- src/bench/bench.c src/hw/jbuf.c src/sec/json.c -lm -lpthread+ $(CC) $(CPPFLAGS) $(CFLAGS) $(WARN) -std=c11 -o $@ $(LB_CLI_SRC) -lm -lpthreaddiff --git a/server/mk/settings.mk b/server/mk/settings.mkindex 9e47cd0..a0d9be3 100644--- a/server/mk/settings.mk+++ b/server/mk/settings.mk@@ -2,7 +2,7 @@# Bluetooth (BlueZ over our own D-Bus client), battery and power, date and time, default apps.# Objects are added to lord-server as extra prerequisites ($^ in its link rule takes them).HW_SRC := src/hw/edid.c src/hw/modes.c src/hw/night.c src/hw/mimeapps.c src/hw/power.c src/hw/jbuf.c src/hw/display.c \- src/hw/uevent.c src/hw/sysbus.c src/hw/bt.c src/hw/ppd.c src/hw/hw.c src/hw/hw_admin.c src/hw/defaults.c src/hw/notifyd.c src/hw/hwscan.c src/hw/brframe.c src/ui/js_hw.c \+ src/hw/uevent.c src/hw/sysbus.c src/hw/bt.c src/hw/ppd.c src/hw/hw.c src/hw/hw_admin.c src/bench/boottest.c src/hw/defaults.c src/hw/notifyd.c src/hw/hwscan.c src/hw/brframe.c src/ui/js_hw.c \src/sysreport/sysreport.c src/sysreport/sysreport_out.c src/sysreport/ids.c src/sysreport/smbios.c src/sysreport/facts.c \src/ui/js_fan.c src/fan/fancurve.cHW_HDR := $(wildcard src/hw/*.h) $(wildcard src/sysreport/*.h) $(wildcard src/fan/*.h) src/ui/js_hw.h src/ui/js_fan.h src/kms.h src/vault/dbus.h@@ -12,9 +12,9 @@ build/lord-server: $(HW_OBJ)# pure parts: EDID, mode selection, gamma/temperature/sun math, mimeapps.list and globs2, power_supply,# and the admin actions' validatorstest: build/settings-hw-test-build/settings-hw-test: tests/settings_hw_test.c src/hw/edid.c src/hw/modes.c src/hw/night.c src/hw/mimeapps.c src/hw/power.c src/hw/hw_admin.c src/hw/hwscan.c src/sysreport/smbios.c src/hw/jbuf.c src/sec/json.c $(HW_HDR)+build/settings-hw-test: tests/settings_hw_test.c src/hw/edid.c src/hw/modes.c src/hw/night.c src/hw/mimeapps.c src/hw/power.c src/hw/hw_admin.c src/bench/boottest.c src/hw/hwscan.c src/sysreport/smbios.c src/hw/jbuf.c src/sec/json.c $(HW_HDR) src/bench/boottest.h@mkdir -p build- $(CC) $(CPPFLAGS) $(CFLAGS) $(WARN) -std=c11 -o $@ tests/settings_hw_test.c src/hw/edid.c src/hw/modes.c src/hw/night.c src/hw/mimeapps.c src/hw/power.c src/hw/hw_admin.c src/hw/hwscan.c src/sysreport/smbios.c src/hw/jbuf.c src/sec/json.c -lm+ $(CC) $(CPPFLAGS) $(CFLAGS) $(WARN) -std=c11 -o $@ tests/settings_hw_test.c src/hw/edid.c src/hw/modes.c src/hw/night.c src/hw/mimeapps.c src/hw/power.c src/hw/hw_admin.c src/bench/boottest.c src/hw/hwscan.c src/sysreport/smbios.c src/hw/jbuf.c src/sec/json.c -lm./$@ || { rm -f $@; exit 1; }# BlueZ parsing (GetManagedObjects, PropertiesChanged, Battery1, paths, state JSON) without a bustest: build/bt-testdiff --git a/server/src/bench/boottest.c b/server/src/bench/boottest.cnew file mode 100644index 0000000..866b008--- /dev/null+++ b/server/src/bench/boottest.c@@ -0,0 +1,84 @@+/* boottest.c — see boottest.h. */+#include "boottest.h"++#include <fcntl.h>+#include <stdio.h>+#include <stdlib.h>+#include <string.h>+#include <sys/stat.h>+#include <unistd.h>++static int valid(const BootTest *b) {+ return b->total >= BT_MIN && b->total <= BT_MAX && b->left >= 1 && b->left <= b->total && b->at > 0;+}++int bt_format(const BootTest *b, char *out, unsigned n) {+ if (!valid(b)) return -1;+ int k = snprintf(out, n, "lordos-boot-test 1\ntotal %d\nleft %d\nat %lld\n", b->total, b->left, b->at);+ return k > 0 && (unsigned)k < n ? 0 : -1;+}++/* "<key> <digits>\n" at *p; the number in *v */+static int field(const char **p, const char *key, long long max, long long *v) {+ size_t kl = strlen(key);+ if (strncmp(*p, key, kl) || (*p)[kl] != ' ') return -1;+ const char *d = *p + kl + 1;+ long long x = 0;+ int digits = 0;+ while (*d >= '0' && *d <= '9') {+ if (++digits > 12) return -1;+ x = x * 10 + (*d++ - '0');+ }+ if (!digits || *d != '\n' || x > max) return -1;+ *v = x;+ *p = d + 1;+ return 0;+}++int bt_parse(const char *text, BootTest *b) {+ static const char head[] = "lordos-boot-test 1\n";+ if (!text || strncmp(text, head, sizeof head - 1)) return -1;+ const char *p = text + sizeof head - 1;+ long long total, left, at;+ if (field(&p, "total", BT_MAX, &total) || field(&p, "left", BT_MAX, &left) || field(&p, "at", 999999999999LL, &at) || *p) return -1;+ BootTest t = { (int)total, (int)left, at };+ if (!valid(&t)) return -1;+ *b = t;+ return 0;+}++int bt_read(const char *path, BootTest *b) {+ int fd = open(path, O_RDONLY | O_CLOEXEC | O_NOFOLLOW);+ if (fd < 0) return -1;+ struct stat st;+ char buf[257];+ ssize_t n = -1;+ if (!fstat(fd, &st) && S_ISREG(st.st_mode) && st.st_uid == 0 && !(st.st_mode & 022) && st.st_size > 0 && st.st_size <= 256)+ n = read(fd, buf, sizeof buf - 1);+ close(fd);+ if (n <= 0) return -1;+ buf[n] = 0;+ return bt_parse(buf, b);+}++int bt_write(const char *path, const BootTest *b) {+ char text[128], tmp[256];+ if (bt_format(b, text, sizeof text) || snprintf(tmp, sizeof tmp, "%s.new", path) >= (int)sizeof tmp) return -1;+ unlink(tmp);+ int fd = open(tmp, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC | O_NOFOLLOW, 0644);+ if (fd < 0) return -1;+ size_t l = strlen(text);+ int ok = write(fd, text, l) == (ssize_t)l && fchmod(fd, 0644) == 0 && fsync(fd) == 0;+ ok = close(fd) == 0 && ok;+ if (!ok || rename(tmp, path)) { unlink(tmp); return -1; }+ return 0;+}++int bt_next(int have, const BootTest *b, long long now, int *k, BootTest *after) {+ if (!have) return BT_NONE;+ if (!valid(b) || now < b->at - 60 || now > b->at + BT_STALE_S) return BT_STALE;+ *k = b->total - b->left + 1;+ if (b->left <= 1) return BT_LAST;+ *after = (BootTest){ b->total, b->left - 1, now };+ return BT_AGAIN;+}diff --git a/server/src/bench/boottest.h b/server/src/bench/boottest.hnew file mode 100644index 0000000..bcd667f--- /dev/null+++ b/server/src/bench/boottest.h@@ -0,0 +1,45 @@+/* boottest.h — LordBench's boot time test (docs/BENCHMARK.md, "Boot"): with an administrator's consent,+ * the computer restarts N times in a row (2 to 10) and lord-sessiond records each boot's time to the first+ * frame, marked as part of the test, in /var/lib/lordos/boot-times.jsonl.+ *+ * The state is one small root-owned file, /var/lib/lordos/boot-test, written only by the admin helper's+ * closed actions `boot-test <n>` and `boot-test-cancel` (hw/hw_admin.c) and by lord-sessiond, always in this+ * fixed format, never with user text:+ *+ * lordos-boot-test 1+ * total <n>+ * left <boots still to measure, this one included>+ * at <unix time it was written>+ *+ * At each boot's first frame lord-sessiond asks bt_next() what to do: record this boot as number k of the+ * test and, if more are left, write the file again and restart BT_SETTLE_S seconds later. The test always+ * ends: `left` only goes down, a file older than BT_STALE_S (or from the future) is discarded, a login at+ * the login screen or `boot-test-cancel` removes it, and lord-sessiond checks the file is still there right+ * before restarting. Used by lord-sessiond (remote/sessiond.c), the admin helper and lord.sysinfo.bench. */+#ifndef LORD_BENCH_BOOTTEST_H+#define LORD_BENCH_BOOTTEST_H++#define BT_PATH "/var/lib/lordos/boot-test"+#define BT_MIN 2+#define BT_MAX 10+#define BT_SETTLE_S 30 /* from the first frame to the next restart: time to cancel */+#define BT_STALE_S 1800++typedef struct { int total, left; long long at; } BootTest;++/* the file's text; 0, or -1 if the values are out of range */+int bt_format(const BootTest *b, char *out, unsigned n);+/* strict parse of that text; 0, or -1 */+int bt_parse(const char *text, BootTest *b);+/* reads path: a regular root-owned file, not writable by group or others, at most 256 bytes; 0 or -1 */+int bt_read(const char *path, BootTest *b);+/* writes path whole (a temporary file, then rename), 0644; 0 or -1 */+int bt_write(const char *path, const BootTest *b);++enum { BT_NONE = 0, BT_STALE, BT_LAST, BT_AGAIN };+/* what a boot's first frame does with the state read (or none: have = 0) at time now: BT_NONE (no test),+ * BT_STALE (discard the file), BT_LAST (this is boot k, the last: remove the file) or BT_AGAIN (boot k:+ * write *after, restart later) */+int bt_next(int have, const BootTest *b, long long now, int *k, BootTest *after);++#endifdiff --git a/server/src/bench/lbframes.c b/server/src/bench/lbframes.cnew file mode 100644index 0000000..405fcaf--- /dev/null+++ b/server/src/bench/lbframes.c@@ -0,0 +1,80 @@+/* lbframes.c — see lbframes.h. */+#include "lbframes.h"++#include <pthread.h>+#include <stdatomic.h>+#include <stdlib.h>+#include <string.h>++#define MAXF 8192 /* about two minutes at 60 Hz; later frames are not kept */++static atomic_int on;+static pthread_mutex_t mu = PTHREAD_MUTEX_INITIALIZER;+static double work[MAXF];+static uint64_t shown[MAXF];+static int nwork, nshown;+static uint32_t period;++void lbf_frame(double work_ms) {+ if (!atomic_load_explicit(&on, memory_order_relaxed)) return;+ pthread_mutex_lock(&mu);+ if (nwork < MAXF && work_ms >= 0) work[nwork++] = work_ms;+ pthread_mutex_unlock(&mu);+}++void lbf_presented(uint64_t ns, uint32_t period_ns) {+ if (!atomic_load_explicit(&on, memory_order_relaxed)) return;+ pthread_mutex_lock(&mu);+ if (nshown < MAXF && (!nshown || ns > shown[nshown - 1])) shown[nshown++] = ns;+ if (period_ns) period = period_ns;+ pthread_mutex_unlock(&mu);+}++void lbf_begin(void) {+ pthread_mutex_lock(&mu);+ nwork = nshown = 0;+ period = 0;+ atomic_store(&on, 1);+ pthread_mutex_unlock(&mu);+}++static int cmp_d(const void *a, const void *b) { double x = *(const double *)a, y = *(const double *)b; return (x > y) - (x < y); }++/* the p-th percentile of sorted v[0..n) (nearest rank) */+static double pct(const double *v, int n, double p) {+ if (n <= 0) return 0;+ int k = (int)(p / 100.0 * n + 0.999999) - 1;+ return v[k < 0 ? 0 : k >= n ? n - 1 : k];+}++int lbf_end(LbFrameStats *st) {+ memset(st, 0, sizeof *st);+ static double w[MAXF];+ pthread_mutex_lock(&mu);+ atomic_store(&on, 0);+ int nw = nwork, ns = nshown;+ memcpy(w, work, (size_t)nw * sizeof *w);+ double budget = (period ? period : 16666667u) / 1e6;+ st->budget_ms = budget;+ st->frames = nw;+ st->shown = ns;+ int missed = 0;+ double gap = 0;+ for (int i = 1; i < ns; i++) {+ double d = (double)(shown[i] - shown[i - 1]) / 1e6;+ if (d > budget * 1.5) missed++;+ if (d > gap) gap = d;+ }+ if (ns >= 2) {+ st->span_s = (double)(shown[ns - 1] - shown[0]) / 1e9;+ st->fps = st->span_s > 0 ? (ns - 1) / st->span_s : 0;+ st->missed_pct = 100.0 * missed / (ns - 1);+ st->gap_max = gap;+ }+ pthread_mutex_unlock(&mu);+ qsort(w, (size_t)nw, sizeof *w, cmp_d);+ st->work_p50 = pct(w, nw, 50);+ st->work_p99 = pct(w, nw, 99);+ st->work_max = nw ? w[nw - 1] : 0;+ return ns >= 2 ? 0 : -1;+}diff --git a/server/src/bench/lbframes.h b/server/src/bench/lbframes.hnew file mode 100644index 0000000..285edb1--- /dev/null+++ b/server/src/bench/lbframes.h@@ -0,0 +1,30 @@+/* lbframes.h — LordBench's compositor frame recorder (docs/BENCHMARK.md, "Frame times against the refresh+ * budget"). While a recording is on, lord-server's main loop (main.c) reports the work of every frame it+ * builds (layout, paint and present, ms) and every frame the main display shows (the page flip's time, or+ * the end of the frame without a monitor); LordBench's thread (lbrun.c) starts and stops the recording+ * and gets the statistics. Off, each call is one atomic read. */+#ifndef LORD_BENCH_LBFRAMES_H+#define LORD_BENCH_LBFRAMES_H++#include <stdint.h>++typedef struct {+ int frames; /* frames built */+ int shown; /* frames shown on the main display */+ double span_s; /* from the first shown frame to the last */+ double fps; /* shown frames per second */+ double work_p50, work_p99, work_max;/* ms to build a frame */+ double budget_ms; /* the main display's refresh period */+ double missed_pct; /* intervals between shown frames longer than 1.5 periods, % of them */+ double gap_max; /* the longest interval, ms */+} LbFrameStats;++/* main.c */+void lbf_frame(double work_ms);+void lbf_presented(uint64_t ns, uint32_t period_ns);++/* lbrun.c: begin clears and starts; end stops and fills st (0, or -1 with fewer than 2 shown frames) */+void lbf_begin(void);+int lbf_end(LbFrameStats *st);++#endifdiff --git a/server/src/bench/lbmain.c b/server/src/bench/lbmain.cindex 002b7c3..e8ff141 100644--- a/server/src/bench/lbmain.c+++ b/server/src/bench/lbmain.c@@ -94,7 +94,7 @@ int main(int argc, char **argv) {struct iovec iov = { &go, sizeof go };struct msghdr mh = { .msg_iov = &iov, .msg_iovlen = 1, .msg_control = cbuf, .msg_controllen = sizeof cbuf };ssize_t r = recvmsg(SOCK, &mh, MSG_CMSG_CLOEXEC);- if (r != (ssize_t)sizeof go || go.magic != LB_MAGIC || (go.mode != LB_MODE_QUICK && go.mode != LB_MODE_FULL)) return 1;+ if (r != (ssize_t)sizeof go || go.magic != LB_MAGIC || (go.mode != LB_MODE_QUICK && go.mode != LB_MODE_FULL && go.mode != LB_MODE_LOAD)) return 1;int nfd = 0;for (struct cmsghdr *c = CMSG_FIRSTHDR(&mh); c; c = CMSG_NXTHDR(&mh, c))if (c->cmsg_level == SOL_SOCKET && c->cmsg_type == SCM_RIGHTS) {@@ -114,8 +114,12 @@ int main(int argc, char **argv) {syscall(SYS_ioprio_set, 1, 0, (3 << 13)); /* IOPRIO_CLASS_IDLE */}setenv("MESA_SHADER_CACHE_DISABLE", "true", 1); /* no cache folder: nothing to write */+ /* Mesa's loader names the GPU behind the render node it got through libdrm, which lists /dev/dri and, for a+ * GPU that isn't on PCI (the Raspberry Pi 5's v3d), reads its device tree node; without them "MESA-LOADER:+ * failed to retrieve device information" and no GPU tests (found on the Pi 5, 0.8.6). Read-only: a device+ * opened here gets no ioctls (Landlock's IOCTL_DEV, ABI 5 and later), only the fd lord-server passed does */static const char *const ro[] = { "/usr/lib", "/usr/lib64", "/lib", "/lib64", "/usr/share", "/etc/ld.so.cache",- "/sys/dev/char", "/sys/devices", NULL };+ "/sys/dev/char", "/sys/devices", "/sys/firmware/devicetree", "/dev/dri", NULL };static const int extra[] = { SYS_getcpu, SYS_kcmp, SYS_membarrier, SYS_sched_getparam, SYS_sched_getscheduler,#ifdef SYS_futex_waitvSYS_futex_waitv,@@ -126,6 +130,13 @@ int main(int argc, char **argv) {.mem_max_mb = 2048 };int mask = sandbox_apply_helper(&cfg);+ if (go.mode == LB_MODE_LOAD) { /* desktop impact: only the load, while lord-server records frames */+ Sus s = { 0, 0, 0 };+ if (go.sustained_s >= 5 && go.sustained_s <= 120) lb_sustained(threads, go.sustained_s, 1, on_sample, &s);+ send_msg(LB_MSG_DONE, 0, 0, mask < 0 ? 0 : mask);+ return 0;+ }+Ctx one = { 1, full ? 1.5 : 0.5, 0, 0 }, all = { threads, full ? 1.5 : 0.5, 0, 0 };int reps = 3;measure(LB_CPU_SHA1, reps, w_sha, &one);diff --git a/server/src/bench/lbproto.c b/server/src/bench/lbproto.cindex 0370d96..faececb 100644--- a/server/src/bench/lbproto.c+++ b/server/src/bench/lbproto.c@@ -16,18 +16,30 @@ static const struct { const char *name, *unit; } meas[LB_COUNT] = {[LB_DISK_SEQW] = { "disk.seqwrite", "MB/s" }, [LB_DISK_SEQR] = { "disk.seqread", "MB/s" },[LB_DISK_RAND] = { "disk.random4k", "IOPS" },[LB_SUS_START] = { "sustained.start", "GFLOP/s" }, [LB_SUS_END] = { "sustained.end", "GFLOP/s" },+ [LB_VID_H264_1080] = { "video.h264.1080", "fps" }, [LB_VID_HEVC_1080] = { "video.hevc.1080", "fps" },+ [LB_VID_VP9_1080] = { "video.vp9.1080", "fps" }, [LB_VID_AV1_1080] = { "video.av1.1080", "fps" },+ [LB_VID_H264_2160] = { "video.h264.2160", "fps" }, [LB_VID_HEVC_2160] = { "video.hevc.2160", "fps" },+ [LB_VENC_H264] = { "video.enc.h264", "fps" }, [LB_VENC_VP8] = { "video.enc.vp8", "fps" },+ [LB_COMP_FPS] = { "comp.fps", "fps" }, [LB_COMP_P50] = { "comp.p50", "ms" },+ [LB_COMP_P99] = { "comp.p99", "ms" }, [LB_COMP_MISSED] = { "comp.missed", "%" },+ [LB_DESK_FPS] = { "desk.fps", "fps" }, [LB_DESK_P50] = { "desk.p50", "ms" },+ [LB_DESK_P99] = { "desk.p99", "ms" }, [LB_DESK_MISSED] = { "desk.missed", "%" },+ [LB_DESK_WORK] = { "desk.work", "GFLOP/s" },};const char *lb_name(int id) { return id >= 0 && id < LB_COUNT ? meas[id].name : NULL; }const char *lb_unit(int id) { return id >= 0 && id < LB_COUNT ? meas[id].unit : NULL; }-int lb_lower_better(int id) { return id == LB_MEM_LAT; }+int lb_lower_better(int id) {+ return id == LB_MEM_LAT || id == LB_COMP_P50 || id == LB_COMP_P99 || id == LB_COMP_MISSED || id == LB_DESK_P50 ||+ id == LB_DESK_P99 || id == LB_DESK_MISSED;+}int lb_msg_valid(const LbMsg *m) {if (m->magic != LB_MAGIC || !isfinite(m->value) || !isfinite(m->aux)) return 0;switch (m->kind) {- case LB_MSG_STEP: return m->id < LB_COUNT;- case LB_MSG_RESULT: return m->id < LB_COUNT && m->value > 0 && m->value < 1e12 && m->aux >= 0 && m->aux < 1e12;- case LB_MSG_SKIP: return m->id < LB_COUNT && m->aux >= LB_SKIP_NODEV && m->aux <= LB_SKIP_MEMORY;+ case LB_MSG_STEP: return m->id <= LB_HELPER_LAST;+ case LB_MSG_RESULT: return m->id <= LB_HELPER_LAST && m->value > 0 && m->value < 1e12 && m->aux >= 0 && m->aux < 1e12;+ case LB_MSG_SKIP: return m->id <= LB_HELPER_LAST && m->aux >= LB_SKIP_NODEV && m->aux <= LB_SKIP_MEMORY;case LB_MSG_SAMPLE: return m->value >= 0 && m->value < 1e9 && m->aux >= 0 && m->aux < 86400;case LB_MSG_DONE: return m->aux >= 0 && m->aux < 65536;case LB_MSG_GPUINFO: return m->value == 0 || m->value == 1 || m->value == 2;diff --git a/server/src/bench/lbproto.h b/server/src/bench/lbproto.hindex df0637b..8327383 100644--- a/server/src/bench/lbproto.h+++ b/server/src/bench/lbproto.h@@ -14,7 +14,8 @@#define LB_VERSION 1 /* LordBench's version: results compare only with the same one *//* what to run */-enum { LB_MODE_QUICK = 1, LB_MODE_FULL = 2 };+enum { LB_MODE_QUICK = 1, LB_MODE_FULL = 2,+ LB_MODE_LOAD = 3 }; /* desktop impact: only the all-core load for sustained_s, a sample a second *//* LbGo.flags */enum {LB_GO_GPU = 1, /* an fd with the render node follows */@@ -50,8 +51,32 @@ enum {LB_DISK_RAND, /* storage, random 4 KiB reads, IOPS */LB_SUS_START, /* sustained: all-core matrix multiply, first 10 s, GFLOP/s */LB_SUS_END, /* sustained: last 10 s, GFLOP/s */+ /* measured by lord-media (bench/lbvideo.c, media/helper/lm_vbench.c), never by lord-bench */+ LB_VID_H264_1080, /* software decoding of a generated clip, frames/s */+ LB_VID_HEVC_1080,+ LB_VID_VP9_1080,+ LB_VID_AV1_1080,+ LB_VID_H264_2160,+ LB_VID_HEVC_2160,+ LB_VENC_H264, /* the remote desktop's encoders with its own settings, 1920×1080, frames/s */+ LB_VENC_VP8,+ /* measured by lord-server itself (bench/lbframes.c), desktop mode only */+ LB_COMP_FPS, /* the compositor, a scripted scene, nothing else running: frames shown per second */+ LB_COMP_P50, /* ms to build a frame, median */+ LB_COMP_P99, /* ms to build a frame, 99th percentile */+ LB_COMP_MISSED, /* intervals longer than 1.5 refresh periods, % */+ LB_DESK_FPS, /* the same scene with an all-core load at the lowest priority */+ LB_DESK_P50,+ LB_DESK_P99,+ LB_DESK_MISSED,+ LB_DESK_WORK, /* what the load got done meanwhile, GFLOP/s */LB_COUNT};+#define LB_HELPER_LAST LB_SUS_END /* lord-bench may only report ids up to this one */+#define LB_VID_FIRST LB_VID_H264_1080+#define LB_VID_LAST LB_VENC_VP8+#define LB_DESK_FIRST LB_COMP_FPS+#define LB_DESK_LAST LB_DESK_WORK/* LbMsg.kind */enum {@@ -62,7 +87,9 @@ enum {LB_MSG_DONE, /* the run ended; aux = the sandbox mask */LB_MSG_GPUINFO, /* value = 0 hardware, 1 virtual, 2 software (bench_gl_kind) */};-enum { LB_SKIP_NODEV = 1, LB_SKIP_FAILED, LB_SKIP_MODE, LB_SKIP_MEMORY };+enum { LB_SKIP_NODEV = 1, LB_SKIP_FAILED, LB_SKIP_MODE, LB_SKIP_MEMORY,+ LB_SKIP_NOCODEC, /* video: this system's FFmpeg has no encoder or decoder for it */+ LB_SKIP_NOFRAMES }; /* desktop: the compositor showed too few frames (another session in front) */typedef struct {uint32_t magic, kind, id, pad;@@ -70,9 +97,9 @@ typedef struct {} LbMsg;const char *lb_name(int id); /* "cpu.sha256.1", …; NULL out of range */-const char *lb_unit(int id); /* "MB/s", "GFLOP/s", "runs/s", "GB/s", "ns", "fps", "Mpx/s", "IOPS" */-int lb_lower_better(int id); /* 1 for latency */-/* 1 if a record from the helper is acceptable: magic, kind, id in range, finite values in range */+const char *lb_unit(int id); /* "MB/s", "GFLOP/s", "runs/s", "GB/s", "ns", "fps", "Mpx/s", "IOPS", "ms", "%" */+int lb_lower_better(int id); /* 1 for latency, frame times and missed frames */+/* 1 if a record from lord-bench is acceptable: magic, kind, an id lord-bench measures, finite values in range */int lb_msg_valid(const LbMsg *m);#endifdiff --git a/server/src/bench/lbrun.c b/server/src/bench/lbrun.cindex 767ce99..ab56372 100644--- a/server/src/bench/lbrun.c+++ b/server/src/bench/lbrun.c@@ -2,6 +2,9 @@#include "lbrun.h"#include "lbcond.h"#include "lbproto.h"+#include "lbframes.h"+#include "lbvideo.h"+#include "boottest.h"#include "bench.h"#include "../hw/jbuf.h"#include "lord_version.h"@@ -31,15 +34,18 @@ static const char *const st_name[] = { "idle", "waiting", "running", "done", "st#define QUIET_PCT 15.0#define QUIET_MAX_S 30 /* after this, the run starts anyway and is marked busy */#define MAX_SAMPLES 200+#define SCENE_WARMUP_MS 2500 /* desktop: the app opens its scene and it settles */+#define DESK_MEASURE_S 10 /* desktop: seconds of frames recorded, alone and under load */static pthread_mutex_t mu = PTHREAD_MUTEX_INITIALIZER;-static int state = ST_IDLE, step = -1, done_count;+static int state = ST_IDLE, step = -1, done_count, expected;+static const char *run_mode = "";static volatile int cancel_req;static pid_t child = -1;static char *result_json;typedef struct {- int full, sustained_s;+ int full, desktop, sustained_s;char *extra;} Job;@@ -100,6 +106,7 @@ typedef struct {double sample_t[MAX_SAMPLES], sample_v[MAX_SAMPLES], sample_temp[MAX_SAMPLES];int nsamples;double throttle_at, throttle_temp;+ double budget_ms, gap_max; /* desktop: the refresh period and the longest wait between frames */} Res;static void cond_json(HBuf *b, const LbCond *c) {@@ -126,7 +133,7 @@ static char *build_result(const Job *j, int st, const char *why, const Res *r, cstruct utsname u;if (uname(&u)) u.release[0] = u.machine[0] = 0;hb_printf(&b, "{\"lordbench\":%d,\"mode\":\"%s\",\"at\":%lld,\"seconds\":%.0f,\"status\":\"%s\",\"stopReason\":",- LB_VERSION, j->full ? "full" : "quick", (long long)time(NULL), secs, st_name[st]);+ LB_VERSION, j->desktop ? "desktop" : j->full ? "full" : "quick", (long long)time(NULL), secs, st_name[st]);hb_str(&b, why ? why : "");hb_printf(&b, ",\"lordos\":\"%s%s%s\",\"kernel\":", LORD_VERSION, LORD_CHANNEL[0] ? "-" : "", LORD_CHANNEL);hb_str(&b, u.release);@@ -151,12 +158,13 @@ static char *build_result(const Job *j, int st, const char *why, const Res *r, c}hb_printf(&b, "},\"skipped\":{");first = 1;- static const char *const why_skip[] = { "", "nodev", "failed", "mode", "memory" };+ static const char *const why_skip[] = { "", "nodev", "failed", "mode", "memory", "nocodec", "noframes" };for (int i = 0; i < LB_COUNT; i++) if (!r->have[i] && r->skip[i]) {hb_printf(&b, "%s\"%s\":\"%s\"", first ? "" : ",", lb_name(i), why_skip[r->skip[i]]);first = 0;}hb_printf(&b, "}");+ if (r->budget_ms > 0) hb_printf(&b, ",\"frames\":{\"budgetMs\":%.3f,\"gapMaxMs\":%.1f}", r->budget_ms, r->gap_max);if (r->nsamples) {hb_printf(&b, ",\"sustained\":{\"samples\":[");for (int i = 0; i < r->nsamples; i++)@@ -180,21 +188,23 @@ static int state_dir(char *out, size_t n) {else return -1;return 0;}-static void save_result(const char *json) {+static void save_result(const char *json, int desktop) {char dir[PATH_MAX], a[PATH_MAX + 32], b[PATH_MAX + 32];+ const char *name = desktop ? "lordbench-desktop" : "lordbench";if (!state_dir(dir, sizeof dir)) {- snprintf(a, sizeof a, "%s/lordbench.json", dir);- snprintf(b, sizeof b, "%s/lordbench-prev.json", dir);+ snprintf(a, sizeof a, "%s/%s.json", dir, name);+ snprintf(b, sizeof b, "%s/%s-prev.json", dir, name);rename(a, b);}saving = json;- bench_save("lordbench", write_saving);+ bench_save(name, write_saving);}char *lbrun_saved(int which) {+ static const char *const names[] = { "lordbench", "lordbench-prev", "lordbench-desktop", "lordbench-desktop-prev" };char dir[PATH_MAX], p[PATH_MAX + 32];- if (state_dir(dir, sizeof dir)) return NULL;- snprintf(p, sizeof p, "%s/%s.json", dir, which ? "lordbench-prev" : "lordbench");+ if (which < 0 || which > 3 || state_dir(dir, sizeof dir)) return NULL;+ snprintf(p, sizeof p, "%s/%s.json", dir, names[which]);int fd = open(p, O_RDONLY | O_CLOEXEC | O_NOFOLLOW);struct stat st;if (fd < 0) return NULL;@@ -215,23 +225,160 @@ static double cpu_busy(unsigned long long b0, unsigned long long t0, unsigned loreturn t1 > t0 ? 100.0 * (double)(b1 - b0) / (double)(t1 - t0) : 0;}+/* launches lord-bench with the job and the fds; its socket, or -1 */+static int spawn_helper(const char *path, const LbGo *go, const int *fds, int nfd, pid_t *pid) {+ int sv[2];+ if (socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sv)) return -1;+ posix_spawn_file_actions_t fa;+ posix_spawn_file_actions_init(&fa);+ posix_spawn_file_actions_adddup2(&fa, sv[1], 3);+ posix_spawnattr_t at;+ posix_spawnattr_init(&at);+ sigset_t none, all;+ sigemptyset(&none);+ sigfillset(&all);+ posix_spawnattr_setsigmask(&at, &none);+ posix_spawnattr_setsigdefault(&at, &all);+ posix_spawnattr_setflags(&at, POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF);+ char sessiond[32] = "LORDOS_SESSIOND=1";+ char *envp[] = { "LANG=C.UTF-8", getenv("LORDOS_SESSIOND") ? sessiond : NULL, NULL };+ char *argv[] = { "lord-bench", NULL };+ int e = posix_spawn(pid, path, &fa, &at, argv, envp);+ posix_spawn_file_actions_destroy(&fa);+ posix_spawnattr_destroy(&at);+ close(sv[1]);+ if (e) { close(sv[0]); return -1; }+ char cbuf[CMSG_SPACE(2 * sizeof(int))];+ memset(cbuf, 0, sizeof cbuf);+ struct iovec iov = { (void *)go, sizeof *go };+ struct msghdr mh = { .msg_iov = &iov, .msg_iovlen = 1 };+ if (nfd) {+ mh.msg_control = cbuf;+ mh.msg_controllen = CMSG_SPACE((size_t)nfd * sizeof(int));+ struct cmsghdr *cm = CMSG_FIRSTHDR(&mh);+ cm->cmsg_level = SOL_SOCKET;+ cm->cmsg_type = SCM_RIGHTS;+ cm->cmsg_len = CMSG_LEN((size_t)nfd * sizeof(int));+ memcpy(CMSG_DATA(cm), fds, (size_t)nfd * sizeof(int));+ }+ if (sendmsg(sv[0], &mh, MSG_NOSIGNAL) != (ssize_t)sizeof *go) {+ kill(*pid, SIGKILL);+ waitpid(*pid, NULL, 0);+ close(sv[0]);+ return -1;+ }+ return sv[0];+}++/* the guards, once a second: a reason to stop, or NULL. In the sustained test throttling is recorded */+typedef struct {+ LbCond c0;+ Res *r;+ int sustained;+ double next;+ char why[16];+} Guard;++static const char *guard(Guard *g) {+ if (bench_now_ms() < g->next) return NULL;+ g->next = bench_now_ms() + 1000;+ LbCond cn;+ lb_cond_read("", &cn);+ const char *s = lb_cond_stop(&g->c0, &cn, !g->sustained);+ Res *r = g->r;+ if (g->sustained && r->throttle_at < 0 &&+ ((g->c0.throttle_known && cn.throttle_events > g->c0.throttle_events) || (cn.rpi_throttled > 0 && (cn.rpi_throttled & (LB_RPI_THROTTLED | LB_RPI_CAPPED | LB_RPI_SOFTTEMP))))) {+ r->throttle_at = r->nsamples ? r->sample_t[r->nsamples - 1] : 0;+ r->throttle_temp = cn.temp_c;+ }+ if (!s || (g->sustained && !strcmp(s, "throttled"))) return NULL;+ snprintf(g->why, sizeof g->why, "%s", s);+ return g->why;+}++/* waits ms, with the guards and a cancel; 0, 1 cancelled, 2 a guard stopped it */+static int wait_guarded(Guard *g, double ms) {+ double end = bench_now_ms() + ms;+ while (bench_now_ms() < end) {+ if (cancel_req) return 1;+ if (guard(g)) return 2;+ struct timespec ts = { 0, 100 * 1000 * 1000 };+ nanosleep(&ts, NULL);+ }+ return 0;+}++static void put_result(Res *r, int id, double v, double spread) {+ pthread_mutex_lock(&mu);+ r->have[id] = 1;+ r->value[id] = v;+ r->spread[id] = spread;+ done_count++;+ pthread_mutex_unlock(&mu);+}++static void put_skip(Res *r, int id, int why) {+ pthread_mutex_lock(&mu);+ r->skip[id] = why;+ done_count++;+ pthread_mutex_unlock(&mu);+}++static void set_step(int id) { pthread_mutex_lock(&mu); step = id; pthread_mutex_unlock(&mu); }++/* the compositor's frames as four results from `first` (fps, p50, p99, missed); -1 with too few frames */+static int put_frames(Res *r, int first) {+ LbFrameStats fs;+ if (lbf_end(&fs) || fs.shown < 30) {+ for (int i = 0; i < 4; i++) put_skip(r, first + i, LB_SKIP_NOFRAMES);+ return -1;+ }+ put_result(r, first, fs.fps, 0);+ put_result(r, first + 1, fs.work_p50, 0);+ put_result(r, first + 2, fs.work_p99, 0);+ put_result(r, first + 3, fs.missed_pct, 0);+ pthread_mutex_lock(&mu);+ r->budget_ms = fs.budget_ms;+ if (fs.gap_max > r->gap_max) r->gap_max = fs.gap_max;+ pthread_mutex_unlock(&mu);+ return 0;+}++/* the video stage's records, from lbvideo.c */+typedef struct { Res *r; Guard *g; int stopped; } VidCtx;+static void on_video(void *ctx, int kind, int id, double value, double aux) {+ VidCtx *v = ctx;+ if (kind == LB_MSG_STEP) set_step(id);+ else if (kind == LB_MSG_RESULT) put_result(v->r, id, value, aux);+ else put_skip(v->r, id, (int)aux);+}+static int video_tick(void *ctx) {+ VidCtx *v = ctx;+ if (cancel_req) { v->stopped = 1; return 1; }+ if (guard(v->g)) { v->stopped = 2; return 1; }+ return 0;+}+static void *run(void *arg) {Job *j = arg;Res *r = calloc(1, sizeof *r);- LbCond c0, c1, cn;- char why_buf[16] = "";+ LbCond c0, c1;+ Guard g;+ memset(&g, 0, sizeof g);const char *why = NULL;int st = ST_FAILED, threads = (int)sysconf(_SC_NPROCESSORS_ONLN), sock = -1, gpu = -1, disk = -1, quiet = 0;unsigned storage_mb = 0;char scratch_dir[PATH_MAX] = "";const char *storage = "none";double busy_pct = 0, waited = 0, t_start = bench_now_ms();+ pid_t pid = -1;if (!r) goto finish;- for (int i = 0; i < LB_COUNT; i++) r->skip[i] = 0;r->gpu_kind = -1;r->throttle_at = -1;lb_cond_read("", &c0);c1 = c0;+ g.c0 = c0;+ g.r = r;if (lb_cond_battery_low(&c0)) { why = "battery"; goto finish; }/* a quiet system first: QUIET_SECS seconds in a row below QUIET_PCT, at most QUIET_MAX_S */@@ -253,84 +400,87 @@ static void *run(void *arg) {if (!lb_cpu_ticks("", &b1, &t1)) busy_pct = cpu_busy(wb, wt, b1, t1);if (cancel_req) { st = ST_CANCELLED; goto finish; }- /* the helper, with what lord-server opened for it */char path[PATH_MAX];if (helper_path(path, sizeof path)) { why = "helper"; goto finish; }++ if (j->desktop) {+ /* the compositor alone: the app animates its scene while the step is comp.* (performance.jsx) */+ pthread_mutex_lock(&mu);+ state = ST_RUNNING;+ step = LB_COMP_FPS;+ pthread_mutex_unlock(&mu);+ int w = wait_guarded(&g, SCENE_WARMUP_MS);+ if (!w) { lbf_begin(); w = wait_guarded(&g, DESK_MEASURE_S * 1000.0); }+ if (w) { lbf_end(&(LbFrameStats){ 0 }); st = w == 1 ? ST_CANCELLED : ST_STOPPED; why = w == 2 ? g.why : NULL; goto finish; }+ put_frames(r, LB_COMP_FPS);++ /* then the same scene with every core busy at the lowest priority */+ set_step(LB_DESK_FPS);+ LbGo go = { LB_MAGIC, LB_MODE_LOAD, LB_GO_LOW, (uint32_t)threads, 0, (uint32_t)(DESK_MEASURE_S + 4) };+ sock = spawn_helper(path, &go, NULL, 0, &pid);+ if (sock < 0) { why = "helper"; goto finish; }+ pthread_mutex_lock(&mu);+ child = pid;+ pthread_mutex_unlock(&mu);+ double work = 0;+ int nwork = 0, recording = 0, finished = 0;+ double deadline = bench_now_ms() + (DESK_MEASURE_S + 30) * 1000.0;+ while (!finished) {+ if (cancel_req) { st = ST_CANCELLED; break; }+ if (bench_now_ms() > deadline) { why = "timeout"; break; }+ const char *s = guard(&g);+ if (s) { why = s; st = ST_STOPPED; break; }+ struct pollfd pf = { sock, POLLIN, 0 };+ int pr = poll(&pf, 1, 250);+ if (pr < 0 && errno != EINTR) { why = "helper"; break; }+ if (pr <= 0) continue;+ LbMsg m;+ ssize_t n = recv(sock, &m, sizeof m, MSG_DONTWAIT);+ if (n == 0 || (n < 0 && errno != EAGAIN)) { why = "helper"; break; }+ if (n < 0) continue;+ if (n != (ssize_t)sizeof m || !lb_msg_valid(&m)) { why = "protocol"; break; }+ if (m.kind == LB_MSG_SAMPLE && m.aux >= 2) { /* the first two seconds warm the load up */+ if (!recording) { lbf_begin(); recording = 1; }+ else { work += m.value; nwork++; }+ } else if (m.kind == LB_MSG_DONE) { r->sandbox = (int)m.aux; finished = 1; }+ }+ if (finished) {+ int framed = put_frames(r, LB_DESK_FPS) == 0;+ if (framed && nwork) put_result(r, LB_DESK_WORK, work / nwork, 0);+ else put_skip(r, LB_DESK_WORK, framed ? LB_SKIP_FAILED : LB_SKIP_NOFRAMES);+ st = ST_DONE;+ } else if (recording) lbf_end(&(LbFrameStats){ 0 });+ goto stop;+ }++ /* the helper, with what lord-server opened for it */gpu = open_render_node();if (j->full) {disk = open_scratch(scratch_dir, sizeof scratch_dir, &storage_mb);storage = disk >= 0 ? lb_storage_kind("", scratch_dir) : "none";}- int sv[2];- if (socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sv)) goto finish;- posix_spawn_file_actions_t fa;- posix_spawn_file_actions_init(&fa);- posix_spawn_file_actions_adddup2(&fa, sv[1], 3);- posix_spawnattr_t at;- posix_spawnattr_init(&at);- sigset_t none, all;- sigemptyset(&none);- sigfillset(&all);- posix_spawnattr_setsigmask(&at, &none);- posix_spawnattr_setsigdefault(&at, &all);- posix_spawnattr_setflags(&at, POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF);- char sessiond[32] = "LORDOS_SESSIOND=1";- char *envp[] = { "LANG=C.UTF-8", getenv("LORDOS_SESSIOND") ? sessiond : NULL, NULL };- char *argv[] = { "lord-bench", NULL };- pid_t pid;- int e = posix_spawn(&pid, path, &fa, &at, argv, envp);- posix_spawn_file_actions_destroy(&fa);- posix_spawnattr_destroy(&at);- close(sv[1]);- if (e) { close(sv[0]); why = "helper"; goto finish; }- sock = sv[0];- pthread_mutex_lock(&mu);- child = pid;- state = ST_RUNNING;- pthread_mutex_unlock(&mu);-LbGo go = { LB_MAGIC, j->full ? LB_MODE_FULL : LB_MODE_QUICK, (gpu >= 0 ? LB_GO_GPU : 0) | (disk >= 0 ? LB_GO_STORAGE : 0),(uint32_t)threads, storage_mb, j->full ? (uint32_t)j->sustained_s : 0 };int fds[2], nfd = 0;if (gpu >= 0) fds[nfd++] = gpu;if (disk >= 0) fds[nfd++] = disk;- char cbuf[CMSG_SPACE(2 * sizeof(int))];- memset(cbuf, 0, sizeof cbuf);- struct iovec iov = { &go, sizeof go };- struct msghdr mh = { .msg_iov = &iov, .msg_iovlen = 1 };- if (nfd) {- mh.msg_control = cbuf;- mh.msg_controllen = CMSG_SPACE((size_t)nfd * sizeof(int));- struct cmsghdr *cm = CMSG_FIRSTHDR(&mh);- cm->cmsg_level = SOL_SOCKET;- cm->cmsg_type = SCM_RIGHTS;- cm->cmsg_len = CMSG_LEN((size_t)nfd * sizeof(int));- memcpy(CMSG_DATA(cm), fds, (size_t)nfd * sizeof(int));- }- if (sendmsg(sock, &mh, MSG_NOSIGNAL) != (ssize_t)sizeof go) { why = "helper"; goto stop; }+ sock = spawn_helper(path, &go, fds, nfd, &pid);if (gpu >= 0) { close(gpu); gpu = -1; }if (disk >= 0) { close(disk); disk = -1; }+ if (sock < 0) { why = "helper"; goto finish; }+ pthread_mutex_lock(&mu);+ child = pid;+ state = ST_RUNNING;+ pthread_mutex_unlock(&mu);/* the records, and the guards every second */- double deadline = bench_now_ms() + (j->full ? (600.0 + j->sustained_s) : 180.0) * 1000, next_guard = 0;- int sustained_phase = 0, finished = 0;+ double deadline = bench_now_ms() + (j->full ? (600.0 + j->sustained_s) : 180.0) * 1000;+ int finished = 0;while (!finished) {if (cancel_req) { st = ST_CANCELLED; goto stop; }if (bench_now_ms() > deadline) { why = "timeout"; goto stop; }- if (bench_now_ms() >= next_guard) {- next_guard = bench_now_ms() + 1000;- lb_cond_read("", &cn);- const char *s = lb_cond_stop(&c0, &cn, !sustained_phase);- if (s) {- if (sustained_phase && !strcmp(s, "throttled")) { /* recorded, not stopped */ }- else { snprintf(why_buf, sizeof why_buf, "%s", s); why = why_buf; st = ST_STOPPED; goto stop; }- }- if (sustained_phase && r->throttle_at < 0 &&- ((c0.throttle_known && cn.throttle_events > c0.throttle_events) || (cn.rpi_throttled > 0 && (cn.rpi_throttled & (LB_RPI_THROTTLED | LB_RPI_CAPPED | LB_RPI_SOFTTEMP))))) {- r->throttle_at = r->nsamples ? r->sample_t[r->nsamples - 1] : 0;- r->throttle_temp = cn.temp_c;- }- }+ const char *s = guard(&g);+ if (s) { why = s; st = ST_STOPPED; goto stop; }struct pollfd pf = { sock, POLLIN, 0 };int pr = poll(&pf, 1, 250);if (pr < 0 && errno != EINTR) { why = "helper"; goto stop; }@@ -340,12 +490,13 @@ static void *run(void *arg) {if (n == 0 || (n < 0 && errno != EAGAIN)) { why = "helper"; goto stop; }if (n < 0) continue;if (n != (ssize_t)sizeof m || !lb_msg_valid(&m)) { why = "protocol"; goto stop; }+ LbCond cn;if (m.kind == LB_MSG_SAMPLE) lb_cond_read("", &cn);pthread_mutex_lock(&mu);switch (m.kind) {case LB_MSG_STEP:step = (int)m.id;- if (m.id == LB_SUS_START) sustained_phase = 1;+ if (m.id == LB_SUS_START) g.sustained = 1;break;case LB_MSG_RESULT:r->have[m.id] = 1; r->value[m.id] = m.value; r->spread[m.id] = m.aux;@@ -368,13 +519,30 @@ static void *run(void *arg) {}pthread_mutex_unlock(&mu);}-stop:- if (st != ST_DONE && st != ST_CANCELLED && st != ST_STOPPED) st = ST_FAILED;kill(pid, SIGKILL);waitpid(pid, NULL, 0);pthread_mutex_lock(&mu);child = -1;pthread_mutex_unlock(&mu);+ pid = -1;++ /* video, in lord-media: the sustained test is over, so throttling stops a run again */+ g.sustained = 0;+ VidCtx vc = { r, &g, 0 };+ int vr = lbv_run(j->full, on_video, video_tick, &vc);+ if (vc.stopped == 1) st = ST_CANCELLED;+ else if (vc.stopped == 2) { st = ST_STOPPED; why = g.why; }+ else if (vr != 0)+ for (int id = LB_VID_FIRST; id <= LB_VID_LAST; id++) if (!r->have[id] && !r->skip[id]) put_skip(r, id, vr == -1 ? LB_SKIP_NODEV : LB_SKIP_FAILED);+stop:+ if (st != ST_DONE && st != ST_CANCELLED && st != ST_STOPPED) st = ST_FAILED;+ if (pid > 0) {+ kill(pid, SIGKILL);+ waitpid(pid, NULL, 0);+ }+ pthread_mutex_lock(&mu);+ child = -1;+ pthread_mutex_unlock(&mu);finish:if (sock >= 0) close(sock);if (gpu >= 0) close(gpu);@@ -387,7 +555,7 @@ finish:(bench_now_ms() - t_start) / 1000);int any = 0;for (int i = 0; i < LB_COUNT; i++) any |= r->have[i];- if (json && any && (st == ST_DONE || st == ST_STOPPED)) save_result(json); /* a refused run keeps the last result */+ if (json && any && (st == ST_DONE || st == ST_STOPPED)) save_result(json, j->desktop); /* a refused run keeps the last result */pthread_mutex_lock(&mu);free(result_json);result_json = json;@@ -401,8 +569,8 @@ finish:}int lbrun_start(const char *mode, int sustained_s, const char *extra) {- int full = mode && !strcmp(mode, "full");- if (!mode || (!full && strcmp(mode, "quick"))) return -1;+ int full = mode && !strcmp(mode, "full"), desktop = mode && !strcmp(mode, "desktop");+ if (!mode || (!full && !desktop && strcmp(mode, "quick"))) return -1;if (sustained_s && (sustained_s < 20 || sustained_s > 1800)) return -1;char path[PATH_MAX];if (helper_path(path, sizeof path)) return -1;@@ -411,6 +579,8 @@ int lbrun_start(const char *mode, int sustained_s, const char *extra) {state = ST_WAITING;step = -1;done_count = 0;+ expected = desktop ? LB_DESK_LAST - LB_DESK_FIRST + 1 : LB_VID_LAST + 1;+ run_mode = desktop ? "desktop" : full ? "full" : "quick";cancel_req = 0;free(result_json);result_json = NULL;@@ -418,6 +588,7 @@ int lbrun_start(const char *mode, int sustained_s, const char *extra) {Job *j = calloc(1, sizeof *j);if (!j) { set_state(ST_IDLE); return -1; }j->full = full;+ j->desktop = desktop;j->sustained_s = full ? sustained_s : 0;j->extra = extra ? strdup(extra) : NULL;pthread_t th;@@ -439,9 +610,9 @@ void lbrun_cancel(void) {char *lbrun_poll(void) {HBuf b = { 0 };pthread_mutex_lock(&mu);- hb_printf(&b, "{\"state\":\"%s\",\"step\":", st_name[state]);+ hb_printf(&b, "{\"state\":\"%s\",\"mode\":\"%s\",\"step\":", st_name[state], run_mode);hb_str(&b, step >= 0 ? lb_name(step) : "");- hb_printf(&b, ",\"progress\":%.3f", done_count / (double)LB_COUNT);+ hb_printf(&b, ",\"progress\":%.3f", expected ? done_count / (double)expected : 0);if (result_json && state != ST_WAITING && state != ST_RUNNING) hb_printf(&b, ",\"result\":%s", result_json);hb_printf(&b, "}");pthread_mutex_unlock(&mu);@@ -464,7 +635,7 @@ char *lbrun_boot_history(const char *path) {txt[n] = 0;/* versions in order of appearance; for each, the boots' seconds; the first boot of each version kept apart */enum { MAXV = 32, MAXB = 200 };- static struct { char v[40]; double s[MAXB]; int n; double first; } vs[MAXV];+ static struct { char v[40]; double s[MAXB]; int n; double first; double t[BT_MAX]; int nt, tof; long long tat; } vs[MAXV];int nv = 0;char last[40] = "";for (char *line = txt; line && *line; ) {@@ -475,13 +646,20 @@ char *lbrun_boot_history(const char *path) {ver += 11;size_t k = strspn(ver, "0123456789.-+~abcdefghijklmnopqrstuvwxyz");double s = atof(sec + 10);+ char *tk = strstr(line, "\"test\":"), *tof = strstr(line, "\"testOf\":"), *at = strstr(line, "\"at\":");+ int test = tk ? atoi(tk + 7) : 0, of = tof ? atoi(tof + 9) : 0;if (k && k < sizeof last && ver[k] == '"' && s > 0 && s < 3600) {char v[40];memcpy(v, ver, k);v[k] = 0;int i;for (i = 0; i < nv && strcmp(vs[i].v, v); i++) {}- if (i == nv && nv < MAXV) { snprintf(vs[nv].v, sizeof vs[nv].v, "%s", v); vs[nv].n = 0; vs[nv].first = -1; nv++; }+ if (i == nv && nv < MAXV) { snprintf(vs[nv].v, sizeof vs[nv].v, "%s", v); vs[nv].n = 0; vs[nv].first = -1; vs[nv].nt = 0; nv++; }+ /* a boot time test's boots (bench/boottest.h): the latest run, from its boot 1 */+ if (i < nv && test >= 1 && test <= BT_MAX && of >= BT_MIN && of <= BT_MAX) {+ if (test == 1) { vs[i].nt = 0; vs[i].tof = of; vs[i].tat = at ? atoll(at + 5) : 0; }+ if (vs[i].tof == of && vs[i].nt == test - 1) vs[i].t[vs[i].nt++] = s;+ }if (i < nv) {if (strcmp(last, v)) { if (vs[i].first < 0) vs[i].first = s; else if (vs[i].n < MAXB) vs[i].s[vs[i].n++] = s; }else if (vs[i].n < MAXB) vs[i].s[vs[i].n++] = s;@@ -505,6 +683,13 @@ char *lbrun_boot_history(const char *path) {hb_printf(&b, ",\"median\":%.2f,\"min\":%.2f,\"max\":%.2f", med, vs[i].s[0], vs[i].s[m - 1]);}if (vs[i].first >= 0) hb_printf(&b, ",\"first\":%.2f", vs[i].first);+ if (vs[i].nt) {+ int m = vs[i].nt;+ qsort(vs[i].t, (size_t)m, sizeof(double), cmp_d);+ double med = m % 2 ? vs[i].t[m / 2] : (vs[i].t[m / 2 - 1] + vs[i].t[m / 2]) / 2;+ hb_printf(&b, ",\"test\":{\"boots\":%d,\"of\":%d,\"at\":%lld,\"median\":%.2f,\"min\":%.2f,\"max\":%.2f}", m, vs[i].tof,+ vs[i].tat, med, vs[i].t[0], vs[i].t[m - 1]);+ }hb_printf(&b, "}");}hb_printf(&b, "]");diff --git a/server/src/bench/lbrun.h b/server/src/bench/lbrun.hindex 98c64b1..37f5ee4 100644--- a/server/src/bench/lbrun.h+++ b/server/src/bench/lbrun.h@@ -7,18 +7,24 @@#ifndef LORD_BENCH_LBRUN_H#define LORD_BENCH_LBRUN_H-/* mode: "quick" or "full"; sustained_s: Full's sustained test (0 = none, 20–1800); extra: JSON the- * caller adds as "session" (displays, composition), produced by lord-server itself. 0 started,- * -1 refused (another run, a bad argument, no helper). */+/* mode: "quick" or "full" (peak performance; then video in lord-media, lbvideo.c), or "desktop" (the+ * compositor's frame times while the app animates a scene, alone and then with lord-bench loading every core+ * at the lowest priority; lbframes.c). sustained_s: Full's sustained test (0 = none, 20–1800); extra: JSON+ * the caller adds as "session" (displays, composition), produced by lord-server itself. 0 started,+ * -1 refused (another run, a bad argument, no helper). Desktop results are kept apart, in+ * lordbench-desktop.json. */int lbrun_start(const char *mode, int sustained_s, const char *extra);void lbrun_cancel(void);-/* the state as JSON (malloc'd): {"state":"idle|waiting|running|done|stopped|failed|cancelled",+/* the state as JSON (malloc'd): {"state":"idle|waiting|running|done|stopped|failed|cancelled","mode",* "step":"<measurement>","progress":0..1,"result":{…} once finished} */char *lbrun_poll(void);-/* the saved results (malloc'd JSON text, NULL if none): which = 0 the last, 1 the previous */+/* the saved results (malloc'd JSON text, NULL if none): which = 0 the last peak run, 1 the previous one,+ * 2 the last desktop run, 3 the previous one */char *lbrun_saved(int which);/* every recorded boot's time to the first frame, grouped by LordOS version (malloc'd JSON array):- * [{"version","boots","median","min","max","first"}], the first boot after an update kept apart */+ * [{"version","boots","median","min","max","first","test"}], the first boot after an update kept apart;+ * "test": the latest boot time test's boots of that version (bench/boottest.h), {boots, of, at, median,+ * min, max} */char *lbrun_boot_history(const char *path);#endifdiff --git a/server/src/bench/lbvideo.c b/server/src/bench/lbvideo.cnew file mode 100644index 0000000..e30a968--- /dev/null+++ b/server/src/bench/lbvideo.c@@ -0,0 +1,103 @@+/* lbvideo.c — see lbvideo.h. */+#include "lbvideo.h"+#include "lbproto.h"+#include "bench.h"+#include "../media/proto.h"++#include <errno.h>+#include <limits.h>+#include <poll.h>+#include <signal.h>+#include <spawn.h>+#include <stdio.h>+#include <string.h>+#include <sys/socket.h>+#include <sys/stat.h>+#include <sys/wait.h>+#include <unistd.h>++static int media_path(char *out, size_t n) {+ char self[PATH_MAX];+ ssize_t k = readlink("/proc/self/exe", self, sizeof self - 1);+ if (k <= 0) return -1;+ self[k] = 0;+ char *slash = strrchr(self, '/');+ if (!slash) return -1;+ *slash = 0;+ if ((size_t)snprintf(out, n, "%s/lord-media", self) >= n) return -1;+ struct stat st;+ if (stat(out, &st) || !S_ISREG(st.st_mode) || !(st.st_mode & S_IXUSR)) return -1;+ if ((st.st_uid != 0 && st.st_uid != getuid()) || (st.st_mode & (S_IWGRP | S_IWOTH))) return -1;+ return 0;+}++int lbv_record_valid(unsigned id, long long kind, long long fps_milli, long long spread_milli, long long why) {+ if (id >= VB_COUNT) return 0;+ switch (kind) {+ case VBR_STEP: return 1;+ case VBR_RESULT: return fps_milli > 0 && fps_milli < 100000000LL && spread_milli >= 0 && spread_milli < 100000000LL;+ case VBR_SKIP: return why >= VBS_NOCODEC && why <= VBS_MODE;+ }+ return 0;+}++int lbv_run(int full, LbvOn on, int (*tick)(void *ctx), void *ctx) {+ char path[PATH_MAX];+ if (media_path(path, sizeof path)) return -1;+ int sv[2];+ if (socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sv)) return -1;+ posix_spawn_file_actions_t fa;+ posix_spawn_file_actions_init(&fa);+ posix_spawn_file_actions_adddup2(&fa, sv[1], 3);+ posix_spawnattr_t at;+ posix_spawnattr_init(&at);+ sigset_t none, all;+ sigemptyset(&none);+ sigfillset(&all);+ posix_spawnattr_setsigmask(&at, &none);+ posix_spawnattr_setsigdefault(&at, &all);+ posix_spawnattr_setflags(&at, POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF);+ char *envp[] = { "LANG=C.UTF-8", "SVT_LOG=1", NULL }; /* SVT-AV1 prints its settings otherwise */+ char *argv[] = { "lord-media", NULL };+ pid_t pid;+ int e = posix_spawn(&pid, path, &fa, &at, argv, envp);+ posix_spawn_file_actions_destroy(&fa);+ posix_spawnattr_destroy(&at);+ close(sv[1]);+ if (e) { close(sv[0]); return -1; }+ int sock = sv[0], rc = -4;+ int64_t v[6] = { MK_VBENCH, 0, 0, 0, 0, 0 };+ const char *params = full ? "full=1\n" : "full=0\n";+ if (mp_send(sock, MM_JOB, 0, v, params, strlen(params), NULL, 0)) { rc = -1; goto out; }+ static const int map[VB_COUNT] = { LB_VID_H264_1080, LB_VID_HEVC_1080, LB_VID_VP9_1080, LB_VID_AV1_1080,+ LB_VID_H264_2160, LB_VID_HEVC_2160, LB_VENC_H264, LB_VENC_VP8 };+ static const int skip_map[] = { 0, LB_SKIP_NOCODEC, LB_SKIP_FAILED, LB_SKIP_MODE };+ double deadline = bench_now_ms() + (full ? 600.0 : 120.0) * 1000;+ for (;;) {+ if (tick && tick(ctx)) { rc = -2; break; }+ if (bench_now_ms() > deadline) { rc = -4; break; }+ struct pollfd pf = { sock, POLLIN, 0 };+ int pr = poll(&pf, 1, 250);+ if (pr < 0 && errno != EINTR) { rc = -3; break; }+ if (pr <= 0) continue;+ static char payload[MP_PAYLOAD_MAX + 1];+ MediaMsg m;+ int fds[MP_MAX_FDS];+ int r = mp_recv(sock, &m, payload, sizeof payload, fds, 0);+ for (int i = 0; r > 0 && i < MP_MAX_FDS; i++) if (fds[i] >= 0) { close(fds[i]); r = -2; } /* no fds expected */+ if (r == -1) continue;+ if (r <= 0) { rc = -3; break; }+ if (m.type == MM_STATE && m.v[0] == MS_DONE) { rc = 0; break; }+ if (m.type == MM_LEVEL || m.type == MM_ERROR) continue;+ if (m.type != MM_BENCH || !lbv_record_valid(m.id, m.v[0], m.v[1], m.v[2], m.v[3])) { rc = -3; break; }+ int id = map[m.id];+ if (m.v[0] == VBR_STEP) on(ctx, LB_MSG_STEP, id, 0, 0);+ else if (m.v[0] == VBR_RESULT) on(ctx, LB_MSG_RESULT, id, m.v[1] / 1000.0, m.v[2] / 1000.0);+ else on(ctx, LB_MSG_SKIP, id, 0, skip_map[m.v[3]]);+ }+out:+ kill(pid, SIGKILL);+ waitpid(pid, NULL, 0);+ close(sock);+ return rc;+}diff --git a/server/src/bench/lbvideo.h b/server/src/bench/lbvideo.hnew file mode 100644index 0000000..0d5800c--- /dev/null+++ b/server/src/bench/lbvideo.h@@ -0,0 +1,17 @@+/* lbvideo.h — LordBench's video measurement from lord-server's side (docs/BENCHMARK.md, "Workloads"). It+ * launches lord-media (the only binary that links FFmpeg) from lord-server's folder, as media.c does, with+ * no fds and one MK_VBENCH job, and checks every MM_BENCH record before passing it on with LordBench's own+ * ids (lbproto.h, LB_VID_*). Blocking: lbrun.c calls it on its own thread. */+#ifndef LORD_BENCH_LBVIDEO_H+#define LORD_BENCH_LBVIDEO_H++/* kind: LB_MSG_STEP, LB_MSG_RESULT (value, aux = spread) or LB_MSG_SKIP (aux = LB_SKIP_*) */+typedef void (*LbvOn)(void *ctx, int kind, int id, double value, double aux);+/* tick is called about every 250 ms: nonzero stops (lord-media is killed). 0 when lord-media finished,+ * -1 if it could not start, -2 stopped by tick, -3 a bad record or it died, -4 timeout */+int lbv_run(int full, LbvOn on, int (*tick)(void *ctx), void *ctx);++/* 1 if an MM_BENCH record is acceptable: a known measurement and kind, a rate in range, a known reason */+int lbv_record_valid(unsigned id, long long kind, long long fps_milli, long long spread_milli, long long why);++#endifdiff --git a/server/src/hw/hw_admin.c b/server/src/hw/hw_admin.cindex 04f5c6e..447bed4 100644--- a/server/src/hw/hw_admin.c+++ b/server/src/hw/hw_admin.c@@ -2,6 +2,7 @@#include "hw_admin.h"#include "hwscan.h"#include "../sysreport/smbios.h"+#include "../bench/boottest.h"#include <ctype.h>#include <dirent.h>@@ -13,6 +14,7 @@#include <stdlib.h>#include <string.h>#include <sys/stat.h>+#include <time.h>#include <unistd.h>/* One argument line, trimmed, into out. 0 if it fits. */@@ -504,3 +506,29 @@ void hw_act_video(const AdminReq *r, const char *arg, size_t len) {}admin_say("OK", "%s", a); /* i18n-ok */}++/* ---- LordBench's boot time test (bench/boottest.h, docs/BENCHMARK.md "Boot") ---- */++/* boot-test <n>: n restarts in a row (BT_MIN..BT_MAX), each boot's time recorded by lord-sessiond. Only+ * writes the fixed-format state file; the restart itself is asked by the session as any other (Restart). */+void hw_act_boot_test(const AdminReq *r, const char *arg, size_t len) {+ (void)r;+ char v[4];+ if (arg_copy(arg, len, v, sizeof v) || !v[0] || strspn(v, "0123456789") != strlen(v)) { admin_err("admin.invalidArgument", NULL); return; }+ int n = atoi(v);+ if (n < BT_MIN || n > BT_MAX) { admin_err("admin.invalidArgument", NULL); return; }+ struct stat st;+ if (!stat("/run/live", &st)) { admin_err("bench.bootTestLive", NULL); return; } /* nothing survives a restart there */+ mkdir("/var/lib/lordos", 0755);+ BootTest b = { n, n, (long long)time(NULL) };+ if (bt_write(BT_PATH, &b)) { admin_err("bench.bootTestFailed", "errno", lerr_errno(errno), NULL); return; }+ admin_ok("bench.bootTestSet", "n", v, NULL);+}++/* boot-test-cancel: no more restarts (the boots already measured stay in the history) */+void hw_act_boot_test_cancel(const AdminReq *r, const char *arg, size_t len) {+ (void)r; (void)arg; (void)len;+ if (unlink(BT_PATH) && errno != ENOENT) { admin_err("bench.bootTestFailed", "errno", lerr_errno(errno), NULL); return; }+ admin_ok("bench.bootTestCancelled", NULL);+}+diff --git a/server/src/hw/hw_admin.h b/server/src/hw/hw_admin.hindex 1311e81..ce94de3 100644--- a/server/src/hw/hw_admin.h+++ b/server/src/hw/hw_admin.h@@ -34,6 +34,11 @@* Writes the browsers' video settings from fixed text:* /etc/chromium/policies/managed/lordos-video.json and* /etc/firefox-esr/lordos-video.js (docs/VIDEO.md) anyone+ * boot-test <n> LordBench's boot time test (bench/boottest.h): n restarts+ * in a row, 2..10; writes only the fixed-format state file+ * /var/lib/lordos/boot-test, which lord-sessiond follows at+ * each boot; refused in the live session admin+ * boot-test-cancel (no arguments) removes that file: no more restarts anyone*/#ifndef LORD_HW_ADMIN_H#define LORD_HW_ADMIN_H@@ -62,6 +67,8 @@ int hw_eeprom_parse(const char *out, HwEeprom *e);int hw_is_bcm2712(const char *compat, size_t n); /* device tree "compatible" (NUL-separated) */const char *hw_rpi_case_text(const char *id); /* fixed file text of a known case, NULL otherwise */void hw_act_video(const AdminReq *r, const char *arg, size_t len);+void hw_act_boot_test(const AdminReq *r, const char *arg, size_t len); /* LordBench, bench/boottest.h */+void hw_act_boot_test_cancel(const AdminReq *r, const char *arg, size_t len);/* The two files video-optimize writes, from its argument; 0 if the argument is valid. */int hw_video_files(const char *arg, char *chromium, size_t cn, char *firefox, size_t fn);#define HW_VIDEO_EXT_ID "kadhcpnkalbaminbojfmbmlgoheicmjo" /* assets/browser/video (manifest "key") */@@ -84,6 +91,8 @@ int hw_backlight_name_valid(const char *n);{ "hw-memory-modules", hw_act_memory_modules, A_ANYONE }, \{ "rpi-eeprom-status", hw_act_eeprom_status, A_ANYONE | A_FORK }, \{ "rpi-eeprom-update", hw_act_eeprom_update, A_FORK }, \- { "video-optimize", hw_act_video, A_ANYONE },+ { "video-optimize", hw_act_video, A_ANYONE }, \+ { "boot-test", hw_act_boot_test, 0 }, \+ { "boot-test-cancel", hw_act_boot_test_cancel, A_ANYONE },#endifdiff --git a/server/src/main.c b/server/src/main.cindex ab0d7db..eae1547 100644--- a/server/src/main.c+++ b/server/src/main.c@@ -55,6 +55,7 @@#include "monitor/netrec.h"#include "sec/codesig.h"#include "sec/netconn.h"+#include "bench/lbframes.h"#include <libgen.h>#include <limits.h>@@ -1144,6 +1145,7 @@ static void render_frame(Server *s);static void render(Server *s) {double t0 = now_ms();render_frame(s);+ lbf_frame(now_ms() - t0); /* LordBench's compositor measurement (bench/lbframes.c) */if (dstat.active) {double t1 = now_ms(), js = dstat.js - dstat.work_js;double work = (t1 - t0) + js;@@ -1455,6 +1457,11 @@ static void render_frame(Server *s) {if (light >= 60) { par_on = 0; canvas_parallel(NULL); }}wl_frame_done((unsigned)now_ms());+ if (s->headless) { /* no flip without a monitor: the frame is out now */+ struct timespec t;+ clock_gettime(CLOCK_MONOTONIC, &t);+ lbf_presented((uint64_t)t.tv_sec * 1000000000ull + (uint64_t)t.tv_nsec, (uint32_t)(1000000000u / (unsigned)hz));+ }/* No flip event will come (a modeset instead of a page flip: the first frame, or a driver* without page flip): the frame is on screen already, so its presentation feedback goes now.* Otherwise the apps' feedback would wait for some later flip. */@@ -1463,6 +1470,7 @@ static void render_frame(Server *s) {clock_gettime(CLOCK_MONOTONIC, &t);uint64_t ns = (uint64_t)t.tv_sec * 1000000000ull + (uint64_t)t.tv_nsec;wl_presented(ns, mo->kms.flip_seq, mo->kms.mode.vrefresh ? 1000000000u / mo->kms.mode.vrefresh : 16666667u);+ lbf_presented(ns, mo->kms.mode.vrefresh ? 1000000000u / mo->kms.mode.vrefresh : 16666667u);if (keylag_enabled) keylag_presented(ns);}frame_stats(s, now_ms() - t0, ui.layout_ms + ui.paint_ms);@@ -1778,6 +1786,8 @@ int main(int argc, char **argv) {dispatch_pointer(&s);if (gpu_active()) update_cursor(&s);}+ /* LordBench's scene moves its window one step per frame, as a drag does (ui/grab.c) */+ if (grab_scripted() && !any_flip_pending(&s)) grab_script_tick(now_ms());/* Timers del tema (React agenda su trabajo con setTimeout/setImmediate). */double delay = -1, tick0 = now_ms();for (int i = 0; i < 64; i++) {@@ -1902,6 +1912,7 @@ int main(int argc, char **argv) {if (flip_instant == 3 && !flip_told++) fprintf(stderr, "kms: page flips complete before vblank: pacing to %d Hz\n", mk->mode.vrefresh ? mk->mode.vrefresh : 60);}wl_presented(mk->flip_ns, mk->flip_seq, mk->mode.vrefresh ? 1000000000u / mk->mode.vrefresh : 16666667u);+ lbf_presented(mk->flip_ns, mk->mode.vrefresh ? 1000000000u / mk->mode.vrefresh : 16666667u);if (keylag_enabled) keylag_presented(mk->flip_ns);}}diff --git a/server/src/media/helper/lm.h b/server/src/media/helper/lm.hindex 5966728..bf2e81d 100644--- a/server/src/media/helper/lm.h+++ b/server/src/media/helper/lm.h@@ -101,5 +101,8 @@ void lm_camera(const char *params, int dev, int render); /* lm_cavoid lm_audiorec(const char *params, int out, int pulse); /* lm_rec.c */void lm_hwprobe(const int *render, int n_render); /* lm_hwprobe.c */void lm_stream(const char *params, int ring, int render); /* lm_stream.c */+/* the remote desktop's software encoder with its own settings (libx264, or libvpx for VP8), for LordBench */+AVCodecContext *lm_stream_sw_encoder(int vp8, int w, int h, int fps, unsigned kbps);+void lm_vbench(const char *params); /* lm_vbench.c */#endifdiff --git a/server/src/media/helper/lm_main.c b/server/src/media/helper/lm_main.cindex cb75074..d7be886 100644--- a/server/src/media/helper/lm_main.c+++ b/server/src/media/helper/lm_main.c@@ -92,6 +92,7 @@ int main(int argc, char **argv) {case MK_AUDIOREC: lm_audiorec(payload, fds[0], fds[1]); break;case MK_HWPROBE: lm_hwprobe(fds, MP_MAX_FDS); break;case MK_STREAM: lm_stream(payload, st_ring, st_render); break;+ case MK_VBENCH: lm_vbench(payload); break;default: LM_LOG("unknown kind %lld", (long long)m.v[0]); return 1;}return 0;diff --git a/server/src/media/helper/lm_stream.c b/server/src/media/helper/lm_stream.cindex d3d0101..81568ed 100644--- a/server/src/media/helper/lm_stream.c+++ b/server/src/media/helper/lm_stream.c@@ -154,6 +154,16 @@ static AVCodecContext *open_sw(Vid *e, const char *name, int fps) {return c;}+AVCodecContext *lm_stream_sw_encoder(int vp8, int w, int h, int fps, unsigned kbps) {+ Vid e;+ memset(&e, 0, sizeof e);+ e.codec = vp8 ? CODEC_VP8 : CODEC_H264;+ e.w = w & ~1;+ e.h = h & ~1;+ e.kbps = kbps;+ return open_sw(&e, vp8 ? "libvpx" : "libx264", fps);+}+static int vid_open(Vid *e, int codec, int w, int h, int fps, unsigned kbps, AVBufferRef *hw) {memset(e, 0, sizeof *e);e->codec = codec;diff --git a/server/src/media/helper/lm_vbench.c b/server/src/media/helper/lm_vbench.cnew file mode 100644index 0000000..c4d4bc6--- /dev/null+++ b/server/src/media/helper/lm_vbench.c@@ -0,0 +1,253 @@+/* lm_vbench.c — LordBench's video measurement (MK_VBENCH; docs/BENCHMARK.md, "Workloads").+ *+ * No files and no devices: the test clips are made here, in memory. A synthetic picture (gradients, moving+ * blocks and a little noise, the same every time) is encoded with this system's FFmpeg into H.264, HEVC,+ * VP9 and AV1 at streaming bit rates, and each clip is then decoded in software the way the player does+ * (lm_play.c: every core, frame and slice threads) over and over for at least a second, three times; the+ * result is the median of frames decoded per second. Then the remote desktop's own encoders (lm_stream.c, its settings) encode+ * 1920×1080 frames as fast as they can. An encoder or decoder this FFmpeg lacks is reported as skipped.+ * Quick measures only H.264 at 1080p and the H.264 encoder. Answers MM_BENCH records only (proto.h). */+#include "lm.h"++#include <libavutil/opt.h>+#include <stdlib.h>+#include <string.h>++typedef struct {+ int id; /* VB_* */+ enum AVCodecID codec;+ int w, h, frames;+ long kbps;+} Clip;++static void report(int id, int kind, double fps, double spread, int why) {+ int64_t v[6] = { kind, (int64_t)(fps * 1000), (int64_t)(spread * 1000), why, 0, 0 };+ mp_send(LM_SOCK, MM_BENCH, (uint32_t)id, v, NULL, 0, NULL, 0);+}++/* frame i of the synthetic picture */+static void synth(AVFrame *f, int i) {+ int w = f->width, h = f->height;+ for (int y = 0; y < h; y++) {+ uint8_t *row = f->data[0] + (size_t)y * f->linesize[0];+ for (int x = 0; x < w; x++) {+ unsigned n = (unsigned)(x * 73856093u ^ y * 19349663u ^ (unsigned)i * 83492791u);+ int v = ((x + 4 * i) * 255 / w + (y * 160) / h) / 2 + (int)((n >> 13) & 15);+ int bx = (x + 12 * i) / 96, by = (y + 5 * i) / 96;+ if (((bx ^ by) & 7) == 0) v = 235 - v / 3;+ row[x] = (uint8_t)(v < 16 ? 16 : v > 235 ? 235 : v);+ }+ }+ for (int p = 1; p < 3; p++)+ for (int y = 0; y < h / 2; y++) {+ uint8_t *row = f->data[p] + (size_t)y * f->linesize[p];+ for (int x = 0; x < w / 2; x++) row[x] = (uint8_t)(128 + ((p == 1 ? x + 2 * i : y - i) * 96 / (w / 2 + 1)) % 48 - 24);+ }+}++static AVFrame *new_frame(int w, int h) {+ AVFrame *f = av_frame_alloc();+ if (!f) return NULL;+ f->format = AV_PIX_FMT_YUV420P;+ f->width = w;+ f->height = h;+ if (av_frame_get_buffer(f, 0) < 0) av_frame_free(&f);+ return f;+}++/* an encoder for making the clip: the first of the names this FFmpeg has */+static AVCodecContext *clip_encoder(const Clip *c) {+ static const char *const h264[] = { "libx264", NULL }, *const hevc[] = { "libx265", NULL },+ *const vp9[] = { "libvpx-vp9", NULL }, *const av1[] = { "libsvtav1", "libaom-av1", "librav1e", NULL };+ const char *const *names = c->codec == AV_CODEC_ID_H264 ? h264 : c->codec == AV_CODEC_ID_HEVC ? hevc : c->codec == AV_CODEC_ID_VP9 ? vp9 : av1;+ for (int k = 0; names[k]; k++) {+ const AVCodec *codec = avcodec_find_encoder_by_name(names[k]);+ if (!codec) continue;+ AVCodecContext *e = avcodec_alloc_context3(codec);+ if (!e) return NULL;+ e->width = c->w;+ e->height = c->h;+ e->pix_fmt = AV_PIX_FMT_YUV420P;+ e->time_base = (AVRational){ 1, 30 };+ e->framerate = (AVRational){ 30, 1 };+ e->bit_rate = c->kbps * 1000;+ e->gop_size = 60;+ e->thread_count = 0;+ AVDictionary *o = NULL;+ if (!strcmp(names[k], "libx264")) av_dict_set(&o, "preset", "veryfast", 0);+ else if (!strcmp(names[k], "libx265")) { av_dict_set(&o, "preset", "ultrafast", 0); av_dict_set(&o, "x265-params", "log-level=error", 0); }+ else if (!strcmp(names[k], "libvpx-vp9")) { av_dict_set(&o, "deadline", "realtime", 0); av_dict_set(&o, "cpu-used", "8", 0); av_dict_set(&o, "row-mt", "1", 0); }+ else if (!strcmp(names[k], "libsvtav1")) av_dict_set(&o, "preset", "12", 0);+ else if (!strcmp(names[k], "libaom-av1")) { av_dict_set(&o, "cpu-used", "9", 0); av_dict_set(&o, "usage", "realtime", 0); }+ else if (!strcmp(names[k], "librav1e")) av_dict_set(&o, "speed", "10", 0);+ int r = avcodec_open2(e, codec, &o);+ av_dict_free(&o);+ if (r >= 0) return e;+ avcodec_free_context(&e);+ }+ return NULL;+}++typedef struct { AVPacket **p; int n, cap; } Pkts;++static int keep(Pkts *k, AVCodecContext *e) {+ for (;;) {+ AVPacket *p = av_packet_alloc();+ if (!p) return -1;+ int r = avcodec_receive_packet(e, p);+ if (r < 0) { av_packet_free(&p); return r == AVERROR(EAGAIN) || r == AVERROR_EOF ? 0 : -1; }+ if (k->n == k->cap) {+ int cap = k->cap ? k->cap * 2 : 64;+ AVPacket **q = realloc(k->p, (size_t)cap * sizeof *q);+ if (!q) { av_packet_free(&p); return -1; }+ k->p = q;+ k->cap = cap;+ }+ k->p[k->n++] = p;+ }+}++static void pkts_free(Pkts *k) {+ for (int i = 0; i < k->n; i++) av_packet_free(&k->p[i]);+ free(k->p);+ memset(k, 0, sizeof *k);+}++/* makes the clip; 0, or VBS_* */+static int make_clip(const Clip *c, Pkts *out, AVCodecParameters *par) {+ AVCodecContext *e = clip_encoder(c);+ if (!e) return VBS_NOCODEC;+ AVFrame *f = new_frame(c->w, c->h);+ int bad = !f;+ for (int i = 0; !bad && i < c->frames; i++) {+ if (av_frame_make_writable(f) < 0) { bad = 1; break; }+ synth(f, i);+ f->pts = i;+ bad = avcodec_send_frame(e, f) < 0 || keep(out, e) < 0;+ }+ if (!bad) bad = avcodec_send_frame(e, NULL) < 0 || keep(out, e) < 0;+ if (!bad) bad = avcodec_parameters_from_context(par, e) < 0;+ av_frame_free(&f);+ avcodec_free_context(&e);+ return bad || out->n == 0 ? VBS_FAILED : 0;+}++/* decodes the clip once as the player does: frames and ms, or -1 */+static int decode_once(const AVCodecParameters *par, const Pkts *k, int *nodec, double *ms_out) {+ const AVCodec *codec = avcodec_find_decoder(par->codec_id);+ if (!codec) { *nodec = 1; return -1; }+ AVCodecContext *d = avcodec_alloc_context3(codec);+ AVFrame *f = av_frame_alloc();+ int frames = -1;+ if (d && f && avcodec_parameters_to_context(d, par) >= 0) {+ d->thread_count = 0;+ d->thread_type = FF_THREAD_FRAME | FF_THREAD_SLICE;+ if (avcodec_open2(d, codec, NULL) >= 0) {+ int got = 0, bad = 0;+ double t0 = lm_now_ms();+ for (int i = 0; i <= k->n && !bad; i++) {+ if (avcodec_send_packet(d, i < k->n ? k->p[i] : NULL) < 0) { bad = 1; break; }+ int r;+ while ((r = avcodec_receive_frame(d, f)) >= 0) { got++; av_frame_unref(f); }+ if (r != AVERROR(EAGAIN) && r != AVERROR_EOF) bad = 1;+ }+ *ms_out = lm_now_ms() - t0;+ if (!bad && got > 0) frames = got;+ }+ }+ av_frame_free(&f);+ avcodec_free_context(&d);+ return frames;+}++/* decodes the clip again and again for at least DECODE_MS: frames per second, or -1 */+#define DECODE_MS 1000.0+static double decode_rate(const AVCodecParameters *par, const Pkts *k, int *nodec) {+ double total_ms = 0;+ long frames = 0;+ while (total_ms < DECODE_MS) {+ double ms = 0;+ int n = decode_once(par, k, nodec, &ms);+ if (n <= 0) return -1;+ frames += n;+ total_ms += ms;+ }+ return total_ms > 0 ? frames * 1000.0 / total_ms : -1;+}++static int cmp_d(const void *a, const void *b) { double x = *(const double *)a, y = *(const double *)b; return (x > y) - (x < y); }++static void measure_decode(const Clip *c) {+ report(c->id, VBR_STEP, 0, 0, 0);+ Pkts k = { 0 };+ AVCodecParameters *par = avcodec_parameters_alloc();+ int why = par ? make_clip(c, &k, par) : VBS_FAILED;+ double v[3];+ for (int r = 0; !why && r < 3; r++) {+ int nodec = 0;+ v[r] = decode_rate(par, &k, &nodec);+ if (v[r] <= 0) why = nodec ? VBS_NOCODEC : VBS_FAILED;+ }+ if (why) {+ LM_LOG("video measurement %d skipped (%s)", c->id, why == VBS_NOCODEC ? "no encoder or decoder" : "failed");+ report(c->id, VBR_SKIP, 0, 0, why);+ } else {+ qsort(v, 3, sizeof *v, cmp_d);+ report(c->id, VBR_RESULT, v[1], v[2] - v[0], 0);+ }+ pkts_free(&k);+ avcodec_parameters_free(&par);+}++/* the remote desktop's encoder (lm_stream.c) on 1920×1080 frames as fast as it goes, three times */+static void measure_encode(int id, int vp8) {+ report(id, VBR_STEP, 0, 0, 0);+ enum { NF = 8, PER = 60 };+ AVFrame *src[NF] = { 0 };+ int bad = 0;+ for (int i = 0; i < NF && !bad; i++) { src[i] = new_frame(1920, 1080); if (src[i]) synth(src[i], i * 3); else bad = 1; }+ double v[3];+ int why = bad ? VBS_FAILED : 0;+ for (int r = 0; !why && r < 3; r++) {+ AVCodecContext *e = lm_stream_sw_encoder(vp8, 1920, 1080, 30, 8000);+ AVPacket *p = av_packet_alloc();+ if (!e || !p) { why = e ? VBS_FAILED : VBS_NOCODEC; avcodec_free_context(&e); av_packet_free(&p); break; }+ double t0 = lm_now_ms();+ for (int i = 0; i < PER && !why; i++) {+ AVFrame *f = src[i % NF];+ f->pts = (int64_t)i * 33;+ if (avcodec_send_frame(e, f) < 0) why = VBS_FAILED;+ while (!why && avcodec_receive_packet(e, p) >= 0) av_packet_unref(p);+ }+ double ms = lm_now_ms() - t0;+ v[r] = ms > 0 ? PER * 1000.0 / ms : -1;+ if (v[r] <= 0) why = VBS_FAILED;+ av_packet_free(&p);+ avcodec_free_context(&e);+ }+ for (int i = 0; i < NF; i++) av_frame_free(&src[i]);+ if (why) report(id, VBR_SKIP, 0, 0, why);+ else {+ qsort(v, 3, sizeof *v, cmp_d);+ report(id, VBR_RESULT, v[1], v[2] - v[0], 0);+ }+}++void lm_vbench(const char *params) {+ int full = mp_param_int(params, "full", 0) == 1;+ static const Clip clips[] = {+ { VB_H264_1080, AV_CODEC_ID_H264, 1920, 1080, 60, 8000 },+ { VB_HEVC_1080, AV_CODEC_ID_HEVC, 1920, 1080, 60, 6000 },+ { VB_VP9_1080, AV_CODEC_ID_VP9, 1920, 1080, 60, 6000 },+ { VB_AV1_1080, AV_CODEC_ID_AV1, 1920, 1080, 60, 4000 },+ { VB_H264_2160, AV_CODEC_ID_H264, 3840, 2160, 30, 25000 },+ { VB_HEVC_2160, AV_CODEC_ID_HEVC, 3840, 2160, 30, 16000 },+ };+ for (size_t i = 0; i < sizeof clips / sizeof clips[0]; i++)+ if (full || clips[i].id == VB_H264_1080) measure_decode(&clips[i]);+ else report(clips[i].id, VBR_SKIP, 0, 0, VBS_MODE);+ measure_encode(VB_ENC_H264, 0);+ if (full) measure_encode(VB_ENC_VP8, 1);+ else report(VB_ENC_VP8, VBR_SKIP, 0, 0, VBS_MODE);+ mp_sendv(LM_SOCK, MM_STATE, 0, MS_DONE, 0, 0, 0);+}diff --git a/server/src/media/proto.h b/server/src/media/proto.hindex 642cc2d..0d6cbea 100644--- a/server/src/media/proto.h+++ b/server/src/media/proto.h@@ -35,6 +35,8 @@ enum {with JSON {"vaapi":bool,"vendor":"…","vp9":bool,"av1":bool,"h264":bool,"hevc":bool} */MK_STREAM, /* remote desktop live encoder (docs/REMOTE.md, "Video (WebRTC)"): fds = audio ring(or -1), render node (or -1); params codec=h264|vp8, width, height, fps, kbps */+ MK_VBENCH, /* LordBench's video measurement (lm_vbench.c, docs/BENCHMARK.md): no fds; params full=0|1.+ Clips generated in memory; answers MM_BENCH records, then MM_STATE MS_DONE */};/* Jobs of the MK_WORKER helper (MM_JOB with v[0] = MW_*). */@@ -83,8 +85,15 @@ enum {MM_AUDIO, /* there's new PCM in the audio ring (or a seek: discard_to/serial) */MM_PACKET, /* live encoder: id = 0 video, 1 audio; v[0] = total bytes, v[1] = offset of thischunk, v[2] = pts (ms for video, 48 kHz samples for audio), v[3] = 1 keyframe */+ MM_BENCH, /* MK_VBENCH: id = measurement (VB_*); v[0] = VBR_*; v[1] = frames/s ×1000, v[2] = spread ×1000,+ v[3] = why skipped (VBS_*) */};+/* MK_VBENCH's measurements, in order; lord-server maps them to its own ids (bench/lbvideo.c) */+enum { VB_H264_1080, VB_HEVC_1080, VB_VP9_1080, VB_AV1_1080, VB_H264_2160, VB_HEVC_2160, VB_ENC_H264, VB_ENC_VP8, VB_COUNT };+enum { VBR_STEP = 0, VBR_RESULT, VBR_SKIP };+enum { VBS_NOCODEC = 1, VBS_FAILED, VBS_MODE };+enum { MS_LOADING = 0, MS_PLAYING, MS_PAUSED, MS_ENDED, MS_RECORDING, MS_DONE, MS_FAILED };/* Sends a message (doesn't block: MSG_DONTWAIT). 0 on success, -1 error (EAGAIN included). */diff --git a/server/src/remote/sessiond.c b/server/src/remote/sessiond.cindex 291ff74..10cd075 100644--- a/server/src/remote/sessiond.c+++ b/server/src/remote/sessiond.c@@ -32,6 +32,7 @@#include "proto.h"#include "rsec.h"#include "lord_version.h" /* build/gen: version, channel and build (Makefile) */+#include "../bench/boottest.h"#include <ctype.h>#include <dirent.h>@@ -445,6 +446,11 @@ static void save_last_user(const char *user) {if (!ok || rename(SD_LAST_USER ".new", SD_LAST_USER)) unlink(SD_LAST_USER ".new");}+/* LordBench's boot time test (bench/boottest.h): after a test boot's first frame, when to restart (rd_now()+ * seconds, 0 = not pending) and which boot of how many this one was */+static double bt_reboot_at;+static int bt_k, bt_n;+static void greeter_reply_hello(void) {Str s = { 0 };sput(&s, "{\"t\":\"hello\",\"mode\":\"%s\",\"user\":\"%s\",\"last\":\"%s\",\"host\":\"", greeter_mode, greeter_user,@@ -456,7 +462,12 @@ static void greeter_reply_hello(void) {file_value("/etc/default/keyboard", "XKBLAYOUT", layouts, sizeof layouts);file_value("/etc/default/keyboard", "XKBVARIANT", variants, sizeof variants);file_value("/etc/default/locale", "LANG", lang, sizeof lang);- sput(&s, "\",\"layouts\":\"%s\",\"variants\":\"%s\",\"lang\":\"%s\",\"users\":[", layouts, variants, lang);+ sput(&s, "\",\"layouts\":\"%s\",\"variants\":\"%s\",\"lang\":\"%s\",", layouts, variants, lang);+ if (bt_reboot_at > 0) {+ double left = bt_reboot_at - rd_now();+ sput(&s, "\"bootTest\":{\"k\":%d,\"n\":%d,\"in\":%d},", bt_k, bt_n, left > 0 ? (int)(left + 0.5) : 0);+ }+ sput(&s, "\"users\":[");setpwent();int first = 1, count = 0;struct passwd *pw;@@ -663,7 +674,7 @@ static int splash_up(void) {* (js_sys.c, matched by bootId). */#define BOOT_TIMES SD_STATE_DIR "/boot-times.jsonl"#define BOOT_TIMES_MAX 200-static void record_boot_time(double secs, const char *what) {+static void record_boot_time(double secs, const char *what, int test_k, int test_n) {char id[40] = "";FILE *b = fopen("/proc/sys/kernel/random/boot_id", "re");if (b) { if (!fgets(id, sizeof id, b)) id[0] = 0; fclose(b); }@@ -673,9 +684,10 @@ static void record_boot_time(double secs, const char *what) {char rel[65];snprintf(rel, sizeof rel, "%s", u.release);for (char *q = rel; *q; q++) if (!isalnum((unsigned char)*q) && !strchr(".+~-_", *q)) *q = '_';- char line[400];- snprintf(line, sizeof line, "{\"bootId\":\"%s\",\"at\":%lld,\"seconds\":%.3f,\"shown\":\"%s\",\"version\":\"%s%s%s\",\"build\":\"%s\",\"kernel\":\"%s\"}\n",- id, (long long)time(NULL), secs, what, LORD_VERSION, LORD_CHANNEL[0] ? "-" : "", LORD_CHANNEL, LORD_BUILD, rel);+ char line[400], test[48] = "";+ if (test_k > 0) snprintf(test, sizeof test, ",\"test\":%d,\"testOf\":%d", test_k, test_n); /* a boot time test's boot */+ snprintf(line, sizeof line, "{\"bootId\":\"%s\",\"at\":%lld,\"seconds\":%.3f,\"shown\":\"%s\",\"version\":\"%s%s%s\",\"build\":\"%s\",\"kernel\":\"%s\"%s}\n",+ id, (long long)time(NULL), secs, what, LORD_VERSION, LORD_CHANNEL[0] ? "-" : "", LORD_CHANNEL, LORD_BUILD, rel, test);/* the older lines, at most BOOT_TIMES_MAX - 1, then this one; written whole and renamed */static char old[BOOT_TIMES_MAX * 400];size_t n = 0;@@ -715,7 +727,43 @@ static void first_frame(void) {const char *what = !has_monitor ? "none" : shown == 'u' ? "session" : "login"; /* autologin, login screen, no monitor */sd_log("first frame on the monitor %.3f s after the kernel started (LordOS %s%s%s, build %s, %s): the boot splash can go",secs, LORD_VERSION, LORD_CHANNEL[0] ? "-" : "", LORD_CHANNEL, LORD_BUILD, what);- record_boot_time(secs, what);+ /* LordBench's boot time test: this boot's number, and another restart if any are left */+ BootTest b, after;+ struct stat bst;+ int have = bt_read(BT_PATH, &b) == 0, k = 0;+ int act = bt_next(have, &b, (long long)time(NULL), &k, &after);+ if (!have && !lstat(BT_PATH, &bst)) { unlink(BT_PATH); sd_log("boot time test: %s is not valid; removed", BT_PATH); }+ if (act == BT_STALE) { unlink(BT_PATH); sd_log("boot time test: the state is too old; removed"); }+ else if (act == BT_LAST) { unlink(BT_PATH); sd_log("boot time test: boot %d of %d, the last one", k, b.total); }+ else if (act == BT_AGAIN) {+ if (bt_write(BT_PATH, &after)) { unlink(BT_PATH); sd_log("warning: boot time test: could not write %s; stopped", BT_PATH); }+ else {+ bt_reboot_at = rd_now() + BT_SETTLE_S;+ bt_k = k;+ bt_n = b.total;+ sd_log("boot time test: boot %d of %d; restarting in %d s (a login at the login screen cancels it)", k, b.total, BT_SETTLE_S);+ }+ }+ record_boot_time(secs, what, act == BT_LAST || act == BT_AGAIN ? k : 0, b.total);+}++/* the boot time test stops: no restart, the state file removed */+static void boot_test_cancel(const char *why) {+ if (bt_reboot_at <= 0) return;+ bt_reboot_at = 0;+ unlink(BT_PATH);+ sd_log("boot time test cancelled (%s) after boot %d of %d", why, bt_k, bt_n);+}++/* the restart, if nobody cancelled meanwhile and the file still says what this boot wrote */+static void boot_test_tick(void) {+ if (bt_reboot_at <= 0 || rd_now() < bt_reboot_at) return;+ bt_reboot_at = 0;+ BootTest c;+ if (bt_read(BT_PATH, &c) || c.total != bt_n || c.left != bt_n - bt_k) { sd_log("boot time test: cancelled meanwhile"); return; }+ char who[64];+ snprintf(who, sizeof who, "by the boot time test (boot %d of %d done)", bt_k, bt_n);+ power("reboot", who);}/* No card with KMS (0.8.1): before this, the boot ended on a silent black screen. The message goes@@ -860,8 +908,12 @@ static void from_shown(int type, const char *j) {char u[40] = "", pass[300] = "";jstr(j, "user", u, sizeof u);jstr(j, "pass", pass, sizeof pass);+ boot_test_cancel("a login at the login screen");if (!sd_valid_username(u) || start_worker(W_LOGIN, u, pass)) sd_mon_greeter("{\"t\":\"busy\"}");explicit_bzero(pass, sizeof pass);+ } else if (!strcmp(t, "bootTestCancel")) {+ boot_test_cancel("from the login screen");+ greeter_reply_hello();} else if (!strcmp(t, "power")) {char what[16] = "";jstr(j, "a", what, sizeof what);@@ -1375,6 +1427,7 @@ int main(int argc, char **argv) {if (shown == 'u' && worker_pid < 0 && pending == W_NONE) stop_greeters("a session is on the monitor");}if (rd_shared->lockout_dirty) save_lockout();+ boot_test_tick();deliver_notices();if (rd_shared->version != seen) { seen = rd_shared->version; write_status(); }else {diff --git a/server/src/ui/grab.c b/server/src/ui/grab.cindex 22568c0..00cb07b 100644--- a/server/src/ui/grab.c+++ b/server/src/ui/grab.c@@ -37,9 +37,12 @@ int grab_cursor(void) { return g.edges ? cursor_for_edges(g.edges) : CUR_MOVE; }static float dim_or(Dim d, float fallback) { return d.unit == UNIT_PX ? d.v : fallback; }-int grab_begin(int node, int edges, const GrabLimits *lim) {+/* LordBench's scripted move (grab_script_begin): the node follows a fixed path, one step per frame */+static struct { int on; double t0; float rx, ry, period; } sc;++static int setup(int node, int edges, const GrabLimits *lim) {Node *n = node_get(node);- if (!n || !ptr_buttons || !n->s.absolute) return -1;+ if (!n || !n->s.absolute) return -1;if (g.active) grab_cancel();memset(&g, 0, sizeof g);g.active = 1;@@ -58,6 +61,35 @@ int grab_begin(int node, int edges, const GrabLimits *lim) {return 0;}+int grab_begin(int node, int edges, const GrabLimits *lim) {+ if (!ptr_buttons) return -1;+ sc.on = 0;+ return setup(node, edges, lim);+}++int grab_script_begin(int node, const GrabLimits *lim, float rx, float ry, float period_ms) {+ if (rx < 0 || ry < 0 || period_ms < 500) return -1;+ if (setup(node, 0, lim)) return -1;+ sc.on = 1;+ sc.t0 = -1;+ sc.rx = rx;+ sc.ry = ry;+ sc.period = period_ms;+ ui.dirty = 1;+ return 0;+}++int grab_scripted(void) { return sc.on && g.active; }++/* a figure of eight that starts and ends where the window was: x = rx sin(k), y = ry sin(2k) / 2 */+void grab_script_tick(double now_ms) {+ if (!sc.on) return;+ if (!g.active) { sc.on = 0; return; }+ if (sc.t0 < 0) sc.t0 = now_ms;+ double k = 2 * M_PI * (now_ms - sc.t0) / sc.period;+ grab_motion(g.px0 + (float)(sc.rx * sin(k)), g.py0 + (float)(sc.ry * sin(2 * k) / 2));+}+static float clampf(float v, float lo, float hi) { return v < lo ? lo : v > hi ? hi : v; }void grab_motion(float px, float py) {@@ -105,6 +137,7 @@ void grab_motion(float px, float py) {int grab_finish(int *node, int *edges, float *dx, float *dy, float *dw, float *dh) {if (!g.active || ptr_buttons) return 0;+ if (sc.on) { grab_cancel(); return 0; } /* the person moved the pointer: the scene stops where it is */*node = g.node;*edges = g.edges;*dx = g.x - g.x0;@@ -117,6 +150,7 @@ int grab_finish(int *node, int *edges, float *dx, float *dy, float *dw, float *d}void grab_cancel(void) {+ sc.on = 0;if (!g.active) return;g.active = 0;paint_layer_end();diff --git a/server/src/ui/grab.h b/server/src/ui/grab.hindex 25cf50e..63c3a67 100644--- a/server/src/ui/grab.h+++ b/server/src/ui/grab.h@@ -34,6 +34,13 @@ void grab_motion(float x, float y); /* once per frame, with the accumula/* Finished (the button was released): 1 and the node's change relative to the start. */int grab_finish(int *node, int *edges, float *dx, float *dy, float *dw, float *dh);void grab_cancel(void);+/* LordBench's desktop scene (bench/lbframes.h, docs/BENCHMARK.md): the window's node moves along a+ * figure of eight (rx, ry px; one turn every period_ms) through the same path as a drag, one step per+ * frame, with no button held and no JS per frame. Pointer input or grab_cancel() stops it. 0 if it+ * started. main.c calls grab_script_tick() before deciding whether to draw. */+int grab_script_begin(int node, const GrabLimits *lim, float rx, float ry, float period_ms);+int grab_scripted(void);+void grab_script_tick(double now_ms);/* paint.c: layer of the moving window and of what is below. When resizing (resize = 1) the* window is repainted every frame, but what is below is still saved. */diff --git a/server/src/ui/js_hw.c b/server/src/ui/js_hw.cindex eec9328..0d753cb 100644--- a/server/src/ui/js_hw.c+++ b/server/src/ui/js_hw.c@@ -34,9 +34,13 @@* with a "This session" section (System Information's Report tab)* lord.sysinfo.bench.start(mode, sustainedS) / poll() / cancel() / saved(which) / boots()* LordBench (bench/lbrun.c, the lord-bench helper): mode- * 'quick' | 'full'; poll() → {state, step, progress, result};- * saved(0|1) the last or previous result; boots() the boot- * times per LordOS version (lord-sessiond's history)+ * 'quick' | 'full' (then video in lord-media) | 'desktop'+ * (the compositor's frame times, alone and under load);+ * poll() → {state, step, progress, result}; saved(0|1) the+ * last or previous peak result, saved(2|3) the desktop ones;+ * boots() the boot times per LordOS version (lord-sessiond's history);+ * bootTest() the boot time test's state or null (bench/boottest.h;+ * started and stopped with the boot-test admin actions)* lord.fan.status() / setProfile(p) / setCurve(pts) / force(v) / caseConfig() (js_fan.c, lord-fand)* lord.browserFrame.apply(on, which) Settings → Appearance → "Browsers: tabs in the title bar":* one preference in the user's Chromium/Firefox profiles@@ -58,6 +62,7 @@#include "../sysreport/sysreport.h"#include "../sysreport/facts.h"#include "../bench/lbrun.h"+#include "../bench/boottest.h"#include "../sec/broker.h"#include "lord_version.h" /* build/gen: the version for the report */#include "../hw/mimeapps.h"@@ -538,7 +543,7 @@ static JSValue f_bench_cancel(JSContext *c, JSValueConst t, int argc, JSValueConstatic JSValue f_bench_saved(JSContext *c, JSValueConst t, int argc, JSValueConst *argv) {(void)t;int which = argc > 0 ? arg_int(c, argv[0], 0) : 0;- if (which != 0 && which != 1) return JS_NULL;+ if (which < 0 || which > 3) return JS_NULL;JSValue v = json_or_null(c, lbrun_saved(which));if (JS_IsException(v)) { JS_FreeValue(c, JS_GetException(c)); return JS_NULL; }return v;@@ -549,12 +554,25 @@ static JSValue f_bench_boots(JSContext *c, JSValueConst t, int argc, JSValueConsreturn json_or_null(c, lbrun_boot_history("/var/lib/lordos/boot-times.jsonl"));}+/* the boot time test's state (bench/boottest.h): {total, left, at} while one is set, else null */+static JSValue f_bench_boot_test(JSContext *c, JSValueConst t, int argc, JSValueConst *argv) {+ (void)t; (void)argc; (void)argv;+ BootTest b;+ if (bt_read(BT_PATH, &b)) return JS_NULL;+ JSValue o = JS_NewObject(c);+ JS_SetPropertyStr(c, o, "total", JS_NewInt32(c, b.total));+ JS_SetPropertyStr(c, o, "left", JS_NewInt32(c, b.left));+ JS_SetPropertyStr(c, o, "at", JS_NewFloat64(c, (double)b.at));+ return o;+}+static const JSCFunctionListEntry bench_funcs[] = {JS_CFUNC_DEF("start", 2, f_bench_start),JS_CFUNC_DEF("poll", 0, f_bench_poll),JS_CFUNC_DEF("cancel", 0, f_bench_cancel),JS_CFUNC_DEF("saved", 1, f_bench_saved),JS_CFUNC_DEF("boots", 0, f_bench_boots),+ JS_CFUNC_DEF("bootTest", 0, f_bench_boot_test),};static const JSCFunctionListEntry sysinfo_funcs[] = {diff --git a/server/src/ui/js_wm.c b/server/src/ui/js_wm.cindex 7fa6fd8..9c35994 100644--- a/server/src/ui/js_wm.c+++ b/server/src/ui/js_wm.c@@ -3,7 +3,11 @@* lord.wm.grab(node, edges, { inset, minW, minH, maxW, maxH, minTop }) → bool* edges 0 = move; 1 top, 2 bottom, 4 left, 8 right (like xdg_toplevel.resize).* Only with a button held down; lord-server tracks it until it is released.- * lord.wm.cancel()+ * lord.wm.cancel() also stops a scripted move+ * lord.wm.script(node, { rx, ry, periodMs, inset, minTop, areas }) → bool+ * LordBench's desktop scene (docs/BENCHMARK.md): the node moves along a figure of eight, rx × ry px,+ * one turn every periodMs (500–60000), one step per frame through the drag's own path (grab.c),+ * with no button held; pointer input or cancel() stops it. No end notice: the scene's window closes.* lord.wm.pointer() → { x, y, active, edges }: the pointer now and the drag in progress (no* arguments, read only). The theme polls it while a window moves, for the snapping preview.* On release: __lordWm('end', { node, edges, dx, dy, dw, dh }) with the node's change.@@ -31,12 +35,7 @@ static double num(JSContext *c, JSValueConst o, const char *k, double def, doublreturn d < lo ? lo : d > hi ? hi : d;}-static JSValue f_grab(JSContext *c, JSValueConst t, int argc, JSValueConst *argv) {- (void)t;- int32_t node = 0, edges = 0;- if (argc < 2 || JS_ToInt32(c, &node, argv[0]) || JS_ToInt32(c, &edges, argv[1])) return JS_FALSE;- if (edges < 0 || edges > 15 || (edges & 3) == 3 || (edges & 12) == 12) return JS_FALSE;- JSValueConst o = argc > 2 ? argv[2] : JS_UNDEFINED;+static GrabLimits limits(JSContext *c, JSValueConst o) {GrabLimits lim = {.inset = (float)num(c, o, "inset", 0, 0, 64),.min_w = (float)num(c, o, "minW", 120, 32, 8192),@@ -57,9 +56,29 @@ static JSValue f_grab(JSContext *c, JSValueConst t, int argc, JSValueConst *argvJS_FreeValue(c, a);}JS_FreeValue(c, areas);+ return lim;+}++static JSValue f_grab(JSContext *c, JSValueConst t, int argc, JSValueConst *argv) {+ (void)t;+ int32_t node = 0, edges = 0;+ if (argc < 2 || JS_ToInt32(c, &node, argv[0]) || JS_ToInt32(c, &edges, argv[1])) return JS_FALSE;+ if (edges < 0 || edges > 15 || (edges & 3) == 3 || (edges & 12) == 12) return JS_FALSE;+ GrabLimits lim = limits(c, argc > 2 ? argv[2] : JS_UNDEFINED);return JS_NewBool(c, grab_begin(node, edges, &lim) == 0);}+/* LordBench's scene: lord.wm.script(node, { rx, ry, periodMs, inset, minTop, areas }) */+static JSValue f_script(JSContext *c, JSValueConst t, int argc, JSValueConst *argv) {+ (void)t;+ int32_t node = 0;+ if (argc < 2 || JS_ToInt32(c, &node, argv[0]) || node <= 0 || !JS_IsObject(argv[1])) return JS_FALSE;+ GrabLimits lim = limits(c, argv[1]);+ float rx = (float)num(c, argv[1], "rx", 0, 0, 4000), ry = (float)num(c, argv[1], "ry", 0, 0, 4000);+ float period = (float)num(c, argv[1], "periodMs", 6000, 500, 60000);+ return JS_NewBool(c, grab_script_begin(node, &lim, rx, ry, period) == 0);+}+static JSValue f_cancel(JSContext *c, JSValueConst t, int argc, JSValueConst *argv) {(void)c; (void)t; (void)argc; (void)argv;grab_cancel();@@ -117,6 +136,7 @@ static const JSCFunctionListEntry wm_funcs[] = {JS_CFUNC_DEF("grab", 3, f_grab),JS_CFUNC_DEF("cancel", 0, f_cancel),JS_CFUNC_DEF("pointer", 0, f_pointer),+ JS_CFUNC_DEF("script", 2, f_script),};void js_wm_register(JSContext *c, JSValue lord) {diff --git a/server/tests/lordbench_test.c b/server/tests/lordbench_test.cindex 360895e..b3d7af8 100644--- a/server/tests/lordbench_test.c+++ b/server/tests/lordbench_test.c@@ -1,11 +1,17 @@/* lordbench_test.c — LordBench without the helper process (docs/BENCHMARK.md, "0.8.6 — LordBench"): the- * records lord-server accepts from lord-bench, short runs of every CPU, memory and storage workload, the+ * records lord-server accepts from lord-bench and from lord-media's video measurement, the compositor's frame+ * statistics, short runs of every CPU, memory and storage workload, the* conditions read from fake sysfs trees (temperatures and trip points, throttle counters, the Pi's- * flags, batteries) with the thermal and battery guards, and the boot history per version. */+ * flags, batteries) with the thermal and battery guards, the boot history per version and the boot time+ * test's state file and its steps. */#include "../src/bench/lbproto.h"#include "../src/bench/lbwork.h"#include "../src/bench/lbcond.h"#include "../src/bench/lbrun.h"+#include "../src/bench/lbframes.h"+#include "../src/bench/lbvideo.h"+#include "../src/bench/boottest.h"+#include "../src/media/proto.h"#include <fcntl.h>#include <math.h>@@ -58,6 +64,58 @@ int main(void) {for (int k = 0; k < i; k++) CHECK(strcmp(lb_name(i), lb_name(k)), "unique %s", lb_name(i));}CHECK(!lb_name(LB_COUNT) && !lb_name(-1), "names out of range");+ /* lord-bench may not report what lord-media or lord-server measure */+ m = msg(LB_MSG_RESULT, LB_VID_H264_1080, 60, 1);+ CHECK(!lb_msg_valid(&m), "a video result from lord-bench");+ m = msg(LB_MSG_RESULT, LB_COMP_P99, 3, 0);+ CHECK(!lb_msg_valid(&m), "a frame time from lord-bench");+ m = msg(LB_MSG_STEP, LB_DESK_FPS, 0, 0);+ CHECK(!lb_msg_valid(&m), "a desktop step from lord-bench");+ m = msg(LB_MSG_SKIP, LB_SUS_END, 0, LB_SKIP_NOCODEC);+ CHECK(!lb_msg_valid(&m), "a video skip reason from lord-bench");+ CHECK(lb_lower_better(LB_COMP_P99) && lb_lower_better(LB_DESK_MISSED) && !lb_lower_better(LB_DESK_FPS) && !lb_lower_better(LB_VID_AV1_1080), "which are lower-better");+ CHECK(!strcmp(lb_name(LB_VENC_VP8), "video.enc.vp8") && !strcmp(lb_unit(LB_COMP_MISSED), "%"), "video and frame names");++ /* ---- lord-media's video records ---- */+ CHECK(lbv_record_valid(VB_HEVC_2160, VBR_RESULT, 24500, 300, 0), "a video result");+ CHECK(lbv_record_valid(VB_AV1_1080, VBR_SKIP, 0, 0, VBS_NOCODEC), "a video skip");+ CHECK(lbv_record_valid(VB_ENC_VP8, VBR_STEP, 0, 0, 0), "a video step");+ CHECK(!lbv_record_valid(VB_COUNT, VBR_RESULT, 1000, 0, 0), "a video id out of range");+ CHECK(!lbv_record_valid(VB_H264_1080, VBR_RESULT, 0, 0, 0), "a zero rate");+ CHECK(!lbv_record_valid(VB_H264_1080, VBR_RESULT, -5, 0, 0), "a negative rate");+ CHECK(!lbv_record_valid(VB_H264_1080, VBR_RESULT, 1000, -1, 0), "a negative spread");+ CHECK(!lbv_record_valid(VB_H264_1080, VBR_RESULT, 200000000LL, 0, 0), "an absurd rate");+ CHECK(!lbv_record_valid(VB_H264_1080, VBR_SKIP, 0, 0, 9), "an unknown video skip reason");+ CHECK(!lbv_record_valid(VB_H264_1080, 7, 0, 0, 0), "an unknown video record kind");++ /* ---- the compositor's frame recorder ---- */+ LbFrameStats fs;+ lbf_frame(5); /* not recording: ignored */+ lbf_presented(1000, 16666667);+ lbf_begin();+ uint64_t t = 1000000000ull;+ for (int i = 0; i < 100; i++) {+ lbf_frame(i == 99 ? 40.0 : 2.0 + (i % 3)); /* one slow frame */+ t += i == 50 || i == 70 ? 50000000ull : 16666667ull; /* two long waits */+ lbf_presented(t, 16666667);+ }+ CHECK(lbf_end(&fs) == 0, "frame stats");+ CHECK(fs.frames == 100 && fs.shown == 100, "frames %d shown %d", fs.frames, fs.shown);+ CHECK(fabs(fs.budget_ms - 16.667) < 0.01, "budget %f", fs.budget_ms);+ CHECK(fs.work_p50 == 3.0, "p50 %f", fs.work_p50);+ CHECK(fs.work_p99 == 4.0 && fs.work_max == 40.0, "p99 %f max %f", fs.work_p99, fs.work_max);+ CHECK(fabs(fs.missed_pct - 200.0 / 99) < 0.01, "missed %f", fs.missed_pct);+ CHECK(fabs(fs.gap_max - 50) < 0.01, "gap %f", fs.gap_max);+ CHECK(fs.fps > 50 && fs.fps < 60, "fps %f", fs.fps);+ lbf_frame(9); /* stopped: ignored */+ lbf_begin();+ lbf_presented(5, 0);+ CHECK(lbf_end(&fs) == -1 && fs.shown == 1 && fs.frames == 0, "one frame is not enough");+ lbf_begin();+ lbf_presented(100, 0);+ lbf_presented(50, 0); /* out of order: dropped */+ lbf_presented(200, 0);+ CHECK(lbf_end(&fs) == 0 && fs.shown == 2, "out-of-order times dropped");/* ---- workloads, short ---- */double v;@@ -171,7 +229,13 @@ int main(void) {"{\"bootId\":\"e\",\"at\":5,\"seconds\":18.000,\"shown\":\"greeter\",\"version\":\"0.8.5-beta\",\"build\":\"x\",\"kernel\":\"k\"}\n""{\"bootId\":\"f\",\"at\":6,\"seconds\":21.000,\"shown\":\"greeter\",\"version\":\"0.8.5-beta\",\"build\":\"x\",\"kernel\":\"k\"}\n""{\"bootId\":\"g\",\"at\":7,\"seconds\":19.000,\"shown\":\"greeter\",\"version\":\"0.8.5-beta\",\"build\":\"x\",\"kernel\":\"k\"}\n"- "{\"bootId\":\"h\",\"at\":8,\"seconds\":\"x\",\"version\":\"0.8.5\\\"evil\"}\n";+ "{\"bootId\":\"h\",\"at\":8,\"seconds\":\"x\",\"version\":\"0.8.5\\\"evil\"}\n"+ "{\"bootId\":\"i\",\"at\":9,\"seconds\":50.000,\"shown\":\"login\",\"version\":\"0.8.6-beta\",\"build\":\"x\",\"kernel\":\"k\"}\n"+ "{\"bootId\":\"j\",\"at\":10,\"seconds\":31.000,\"shown\":\"login\",\"version\":\"0.8.6-beta\",\"build\":\"x\",\"kernel\":\"k\",\"test\":1,\"testOf\":3}\n"+ "{\"bootId\":\"k\",\"at\":11,\"seconds\":30.000,\"shown\":\"login\",\"version\":\"0.8.6-beta\",\"build\":\"x\",\"kernel\":\"k\",\"test\":2,\"testOf\":3}\n"+ "{\"bootId\":\"l\",\"at\":12,\"seconds\":29.000,\"shown\":\"login\",\"version\":\"0.8.6-beta\",\"build\":\"x\",\"kernel\":\"k\",\"test\":1,\"testOf\":4}\n"+ "{\"bootId\":\"m\",\"at\":13,\"seconds\":33.000,\"shown\":\"login\",\"version\":\"0.8.6-beta\",\"build\":\"x\",\"kernel\":\"k\",\"test\":2,\"testOf\":4}\n"+ "{\"bootId\":\"n\",\"at\":14,\"seconds\":99.000,\"shown\":\"login\",\"version\":\"0.8.6-beta\",\"build\":\"x\",\"kernel\":\"k\",\"test\":4,\"testOf\":4}\n";CHECK(fd >= 0 && write(fd, lines, strlen(lines)) == (ssize_t)strlen(lines), "boot file");fchmod(fd, 0644);close(fd);@@ -179,12 +243,52 @@ int main(void) {CHECK(h && strstr(h, "{\"version\":\"0.8.4-beta\",\"boots\":2,\"median\":21.00,\"min\":20.00,\"max\":22.00,\"first\":30.00}"), "0.8.4: %s", h ? h : "null");CHECK(h && strstr(h, "{\"version\":\"0.8.5-beta\",\"boots\":3,\"median\":19.00,\"min\":18.00,\"max\":21.00,\"first\":40.00}"), "0.8.5: %s", h ? h : "null");CHECK(h && !strstr(h, "evil"), "a bad line is skipped");+ CHECK(h && strstr(h, "\"test\":{\"boots\":2,\"of\":4,\"at\":12,\"median\":31.00,\"min\":29.00,\"max\":33.00}"),+ "the latest boot time test, a boot out of order left out: %s", h ? h : "null");+ CHECK(h && !strstr(h, "0.8.5-beta\",\"boots\":3,\"median\":19.00,\"min\":18.00,\"max\":21.00,\"first\":40.00,\"test\""), "no test in 0.8.5");free(h);chmod(bt, 0666);CHECK(!(h = lbrun_boot_history(bt)), "a file others can write is refused");free(h);unlink(bt);+ /* ---- the boot time test's state (bench/boottest.c) ---- */+ BootTest b = { 5, 5, 1793000000LL }, bs, after;+ char text[128];+ CHECK(bt_format(&b, text, sizeof text) == 0 && !strcmp(text, "lordos-boot-test 1\ntotal 5\nleft 5\nat 1793000000\n"), "format: %s", text);+ CHECK(bt_parse(text, &bs) == 0 && bs.total == 5 && bs.left == 5 && bs.at == 1793000000LL, "parse");+ CHECK(bt_parse("lordos-boot-test 1\ntotal 11\nleft 5\nat 1\n", &bs), "more than BT_MAX refused");+ CHECK(bt_parse("lordos-boot-test 1\ntotal 1\nleft 1\nat 1\n", &bs), "fewer than BT_MIN refused");+ CHECK(bt_parse("lordos-boot-test 1\ntotal 3\nleft 4\nat 1\n", &bs), "left above total refused");+ CHECK(bt_parse("lordos-boot-test 1\ntotal 3\nleft 0\nat 1\n", &bs), "nothing left refused");+ CHECK(bt_parse("lordos-boot-test 1\ntotal 3\nleft 2\nat 1\nrm -rf /\n", &bs), "trailing text refused");+ CHECK(bt_parse("lordos-boot-test 1\ntotal 3\nleft 2\nat -1\n", &bs), "a negative time refused");+ CHECK(bt_parse("lordos-boot-test 1\ntotal 3\nleft 2\nat 1\n", &bs), "extra spaces refused");+ CHECK(bt_parse("lordos-boot-test 2\ntotal 3\nleft 2\nat 1\n", &bs), "another format version refused");+ CHECK(bt_parse("lordos-boot-test 1\ntotal 3\nleft 2\nat 99999999999999\n", &bs), "a huge number refused");+ BootTest bad = { 3, 0, 1 };+ CHECK(bt_format(&bad, text, sizeof text) == -1, "an invalid state isn't written");+ int k = 0;+ long long now = 1793000100LL;+ CHECK(bt_next(0, &b, now, &k, &after) == BT_NONE, "no file, no test");+ CHECK(bt_next(1, &b, now, &k, &after) == BT_AGAIN && k == 1 && after.left == 4 && after.total == 5 && after.at == now, "boot 1 of 5");+ BootTest last = { 5, 1, now - 100 };+ CHECK(bt_next(1, &last, now, &k, &after) == BT_LAST && k == 5, "boot 5 of 5 is the last");+ BootTest old = { 5, 3, now - BT_STALE_S - 1 }, future = { 5, 3, now + 3600 };+ CHECK(bt_next(1, &old, now, &k, &after) == BT_STALE, "an old state is discarded");+ CHECK(bt_next(1, &future, now, &k, &after) == BT_STALE, "a state from the future is discarded");+ /* the test always ends: from any valid state, at most BT_MAX boots */+ BootTest cur = { BT_MAX, BT_MAX, now };+ int boots = 0, act;+ while ((act = bt_next(1, &cur, now, &k, &after)) == BT_AGAIN && boots < 100) { cur = after; boots++; }+ CHECK(act == BT_LAST && boots == BT_MAX - 1 && k == BT_MAX, "%d restarts for %d boots", boots, BT_MAX);+ char bf[] = "/tmp/lordbench-boottest-XXXXXX";+ fd = mkstemp(bf);+ close(fd);+ CHECK(bt_write(bf, &b) == 0, "write");+ CHECK(getuid() == 0 ? bt_read(bf, &bs) == 0 : bt_read(bf, &bs) == -1, "read only a root-owned file");+ unlink(bf);+/* ---- the run's state without a helper ---- */char *p = lbrun_poll();CHECK(p && strstr(p, "\"state\":\"idle\""), "idle: %s", p ? p : "null");diff --git a/server/tests/sysinfo_perf_test.mjs b/server/tests/sysinfo_perf_test.mjsindex b72a624..b9ca7ef 100644--- a/server/tests/sysinfo_perf_test.mjs+++ b/server/tests/sysinfo_perf_test.mjs@@ -1,7 +1,7 @@// sysinfo_perf_test.mjs — LordBench's model (apps/sysinfo/perf.js, 0.8.6): ratios against the reference// machines, category means, the stability and compatibility verdicts, comparisons with the previous// result and the conditions that differ. Run by tests/run_suites.sh (needs node).-import { CATEGORIES, REFERENCES, ratio, categoryRatios, comparableReferences, stability, compatibilityVerdict, conditionDiffs, changes, sustainedSeries, refreshBudget, fileName } from '../../apps/sysinfo/perf.js';+import { CATEGORIES, DESKTOP_CATEGORIES, desktopVerdict, REFERENCES, ratio, categoryRatios, comparableReferences, stability, compatibilityVerdict, conditionDiffs, changes, sustainedSeries, refreshBudget, fileName } from '../../apps/sysinfo/perf.js';let n = 0, bad = 0;const eq = (what, got, want) => {@@ -21,9 +21,9 @@ const res = (over = {}) => ({});const ref = { lordbench: 1, results: { 'cpu.sha256.1': { value: 100 }, 'cpu.matmul.1': { value: 2 }, 'mem.latency': { value: 90 } } };-// every measurement lord-bench reports is in exactly one category+// every measurement of a peak run (lord-bench's and lord-media's) is in exactly one categoryconst ids = CATEGORIES.flatMap((c) => c.ids);-eq('20 measurements, no repeats', [ids.length, new Set(ids).size], [20, 20]);+eq('28 measurements, no repeats', [ids.length, new Set(ids).size], [28, 28]);eq('references have every measurement', REFERENCES.every((r) => ids.every((id) => r.results[id] && r.results[id].value > 0)), true);near('×2 SHA', ratio(res(), ref, 'cpu.sha256.1'), 2);@@ -66,5 +66,23 @@ const at = Date.UTC(2026, 9, 27, 12) / 1000;eq('file name', fileName(at, () => false), 'lordbench-2026-10-27.json');eq('file name taken', fileName(at, (x) => x === 'lordbench-2026-10-27.json'), 'lordbench-2026-10-27-2.json');+// the desktop run+const desk = (results, budgetMs = 1000 / 60) => ({ mode: 'desktop', frames: { budgetMs }, results });+const v = (value) => ({ value });+eq('no frames: unknown', desktopVerdict(desk({})).state, 'unknown');+eq('no budget: unknown', desktopVerdict({ results: { 'comp.p99': v(3) } }).state, 'unknown');+let dv = desktopVerdict(desk({ 'comp.p99': v(4), 'comp.missed': v(0), 'desk.p99': v(9), 'desk.missed': v(1.5) }));+eq('both fit', dv.state, 'pass');+eq('both fit: notes', dv.notes.map((x) => x.id), ['compFits', 'deskFits']);+dv = desktopVerdict(desk({ 'comp.p99': v(4), 'comp.missed': v(0), 'desk.p99': v(21), 'desk.missed': v(3) }));+eq('p99 over the budget under load', [dv.state, dv.notes.map((x) => x.id)], ['warn', ['compFits', 'deskOver']]);+dv = desktopVerdict(desk({ 'comp.p99': v(4), 'comp.missed': v(8), 'desk.p99': v(5), 'desk.missed': v(40) }));+eq('late frames', [dv.state, dv.notes.map((x) => x.id)], ['fail', ['compFits', 'compMissed', 'deskFits', 'deskMissedMany']]);+eq('a 144 Hz budget is tighter', desktopVerdict(desk({ 'comp.p99': v(9), 'comp.missed': v(0) }, 1000 / 144)).state, 'warn');+eq('every desktop id is a server measurement', DESKTOP_CATEGORIES.flatMap((c) => c.ids).every((id) => /^(comp|desk)\./.test(id)), true);+eq('video is a peak category', CATEGORIES.some((c) => c.id === 'video' && c.ids.length === 8), true);+const dch = changes(desk({ 'desk.p99': { value: 8, lowerBetter: true } }), desk({ 'desk.p99': { value: 10, lowerBetter: true } }));+near('a faster frame is better', dch['desk.p99'], 10 / 8 - 1);+console.log(`sysinfo-perf-test: ${n - bad} ok, ${bad} failed`);process.exit(bad ? 1 : 0);diff --git a/themes/greeter/index.jsx b/themes/greeter/index.jsxindex 938938e..c24316c 100644--- a/themes/greeter/index.jsx+++ b/themes/greeter/index.jsx@@ -6,8 +6,9 @@// password, opening the session, rebooting, powering off) is requested with lord.greeter.send() and the answer// arrives through __lordGreeter: this JS never sees /etc/shadow.//-// Requests: {t:'hello'} · {t:'login', user, pass} · {t:'power', a:'reboot'|'poweroff'}-// Notices: {t:'hello', mode, user, last, host, layouts, variants, lang, users:[{name, full, color, image, admin, open}]}+// Requests: {t:'hello'} · {t:'login', user, pass} · {t:'power', a:'reboot'|'poweroff'} · {t:'bootTestCancel'}+// Notices: {t:'hello', mode, user, last, host, layouts, variants, lang, users:[{name, full, color, image, admin, open}],+// bootTest?:{k, n, in}} (a boot time test restarts in `in` seconds; a login cancels it)// (last: the user whose session was last shown on the monitor)// {t:'mode', mode:'login'|'lock'|'switch', user} · {t:'ok'} · {t:'fail', wait} · {t:'error'} · {t:'busy'}import { render, screen, mainBox, onScreenChange } from '@lordos/runtime';@@ -154,7 +155,8 @@ function Greeter() {useEffect(() => {const on = (m) => {if (m.t === 'hello') {- setInfo((old) => ({ ...old, ...m }));+ // a boot time test restarts soon (LordBench, bench/boottest.h): when, by this screen's clock+ setInfo((old) => ({ ...old, ...m, bootTest: m.bootTest ? { ...m.bootTest, end: Date.now() + m.bootTest.in * 1000 } : null }));// system keyboard and language (/etc/default/keyboard and /etc/default/locale)const layouts = String(m.layouts || 'latam').split(',').filter(Boolean);const variants = String(m.variants || '').split(',');@@ -238,6 +240,16 @@ function Greeter() {letterSpacing: -Math.round(clockSize * 0.03) }}>{formatTime(now)}</Text></View>+ {/* LordBench's boot time test: which boot this was, the restart's countdown and a way to stop it */}+ {info.bootTest ? (+ <View style={{ position: 'absolute', left: Math.round(W / 2 - 230), top: 18, width: 460, padding: 12, gap: 8, borderRadius: 14,+ backgroundColor: 'rgba(30,22,40,0.88)', border: '1px solid rgba(255,255,255,0.18)', alignItems: 'center' }}>+ <Text style={{ fontSize: 13, color: '#fff', textAlign: 'center', lineHeight: 1.35 }}>+ {t('greeter.bootTest', { k: info.bootTest.k, n: info.bootTest.n, s: Math.max(0, Math.ceil((info.bootTest.end - now.getTime()) / 1000)) })}</Text>+ <Pill label={t('greeter.bootTestCancel')} onClick={() => send({ t: 'bootTestCancel' })} />+ </View>+ ) : null}+{/* selected user and password */}<View style={{ position: 'absolute', left: 0, top: Math.round(H * 0.6) - avatarSize, width: W, alignItems: 'center' }}>{user ? <Avatar user={user} size={avatarSize} /> : null}diff --git a/web/content/faq/faq.json b/web/content/faq/faq.jsonindex ec1b36e..e3c4603 100644--- a/web/content/faq/faq.json+++ b/web/content/faq/faq.json@@ -703,9 +703,9 @@"pt": "Posso medir quão rápido o LordOS roda no meu computador?"},"a": {- "en": "Coming in 0.8.6 (in development; the latest release is 0.8.5-beta): System Information gets a Performance tab with LordBench, a quick and a full test of the processor, memory, graphics, disk and sustained load, run in an isolated helper that stops near the temperature limit. Results are shown against reference machines measured the same way, with the conditions of each run, never as one score, and nothing is sent anywhere.",- "es": "Llega en la 0.8.6 (en desarrollo; la última versión es la 0.8.5-beta): Información del sistema suma una pestaña Rendimiento con LordBench, una prueba rápida y una completa del procesador, la memoria, los gráficos, el disco y la carga sostenida, que corre en un ayudante aislado y se detiene cerca del límite de temperatura. Los resultados se muestran frente a máquinas de referencia medidas de la misma forma, con las condiciones de cada prueba, nunca como un único puntaje, y no se envía nada a ningún lado.",- "pt": "Chega na 0.8.6 (em desenvolvimento; a última versão é a 0.8.5-beta): Informações do sistema ganha uma aba Desempenho com o LordBench, um teste rápido e um completo do processador, da memória, dos gráficos, do disco e da carga contínua, executado num auxiliar isolado que para perto do limite de temperatura. Os resultados aparecem frente a máquinas de referência medidas da mesma forma, com as condições de cada teste, nunca como uma única pontuação, e nada é enviado a lugar nenhum."+ "en": "Coming in 0.8.6 (in development; the latest release is 0.8.5-beta): System Information gets a Performance tab with LordBench, a quick and a full test of the processor, memory, graphics, video decoding, disk and sustained load, run in an isolated helper that stops near the temperature limit. Results are shown against reference machines measured the same way, with the conditions of each run, never as one score, and nothing is sent anywhere. A separate desktop test measures whether the desktop stays smooth while the computer is busy, and a boot test restarts it several times and keeps the median time to the login screen (a Raspberry Pi 5 with a monitor reaches it in about 6 seconds).",+ "es": "Llega en la 0.8.6 (en desarrollo; la última versión es la 0.8.5-beta): Información del sistema suma una pestaña Rendimiento con LordBench, una prueba rápida y una completa del procesador, la memoria, los gráficos, la decodificación de video, el disco y la carga sostenida, que corre en un ayudante aislado y se detiene cerca del límite de temperatura. Los resultados se muestran frente a máquinas de referencia medidas de la misma forma, con las condiciones de cada prueba, nunca como un único puntaje, y no se envía nada a ningún lado. Una prueba aparte mide si el escritorio sigue fluido mientras la computadora está ocupada, y una prueba de arranque la reinicia varias veces y se queda con la mediana del tiempo hasta la pantalla de inicio de sesión (una Raspberry Pi 5 con monitor llega en unos 6 segundos).",+ "pt": "Chega na 0.8.6 (em desenvolvimento; a última versão é a 0.8.5-beta): Informações do sistema ganha uma aba Desempenho com o LordBench, um teste rápido e um completo do processador, da memória, dos gráficos, da decodificação de vídeo, do disco e da carga contínua, executado num auxiliar isolado que para perto do limite de temperatura. Os resultados aparecem frente a máquinas de referência medidas da mesma forma, com as condições de cada teste, nunca como uma única pontuação, e nada é enviado a lugar nenhum. Um teste à parte mede se o desktop continua fluido enquanto o computador está ocupado, e um teste de boot o reinicia várias vezes e fica com a mediana do tempo até a tela de login (um Raspberry Pi 5 com monitor chega em cerca de 6 segundos)."}}]diff --git a/web/content/paper/paper.en.md b/web/content/paper/paper.en.mdindex c936a60..584ed5c 100644--- a/web/content/paper/paper.en.md+++ b/web/content/paper/paper.en.md@@ -484,11 +484,11 @@ The Raspberry Pi 5 is the only supported board. Results on a real board (16 GB,**Fans.** On the Pi 5 in a test case, `lord-fand` kept the fan off at 50–53 °C during a 4-thread load (the aluminium case acts as a heatsink), drove it to 55 % (4,500 RPM) and full speed (7,400 RPM) with test curves, and restored the kernel's own settings after `SIGTERM` and `kill -9` (`docs/FANS.md`).-**Monitor and image.** Since 0.8.4.1 the Raspberry Pi 5 image shows the desktop on an HDMI monitor at the first boot (the display driver line in `config.txt` now comes after the firmware's auto-detection lines, and LordOS waits up to 30 s for the driver), sets the clock from the network, and ships Chromium and Firefox ESR. Since 0.8.4 the LordOS Pi kernel (`6.18.57-lordos.3-rpi-2712`) also destroys the connections of a blocked app. **Not measured yet on the board:** frame rates and GPU composition on a monitor.+**Monitor and image.** Since 0.8.4.1 the Raspberry Pi 5 image shows the desktop on an HDMI monitor at the first boot (the display driver line in `config.txt` now comes after the firmware's auto-detection lines, and LordOS waits up to 30 s for the driver), sets the clock from the network, and ships Chromium and Firefox ESR. Since 0.8.4 the LordOS Pi kernel (`6.18.57-lordos.3-rpi-2712`) also destroys the connections of a blocked app. **Measured on a monitor (LordBench, 0.8.6 in development):** the 0.8.5 image booted with a 1920×1080 60 Hz monitor on either HDMI port reaches the login screen 5.99 s after the kernel starts (systemd: 2.1 s kernel, 4.2 s userspace). With GPU composition (V3D) a window moved by the compositor keeps 59.4 frames per second, with a frame built in 10.9 ms (median) and 13.0 ms (99th percentile) and 1.0 % of frames late; under an all-core load at the lowest priority it falls to 24 frames per second with 96.5 % late, a problem LordBench found that is still to be fixed. In a 3-minute all-core load with the fan the board kept 5.9 GFLOP/s at 55.6 °C at most, and it decodes 1080p video in software at 258 (H.264), 246 (HEVC), 204 (VP9) and 159 (AV1) frames per second.### 7.5 Modern PCs-There are no measurements on real PCs in the repository yet. The ISO is tested on virtual machines (UEFI and BIOS); testing on a real AMD machine from the live USB is planned. LordBench (0.8.6) is designed to measure memory and CPU at idle, boot time, frame times, video and app start in a repeatable way, and community hardware reports (0.8.7) to collect them from real machines (`docs/BENCHMARK.md`). In development for 0.8.6 (unreleased; the latest release is 0.8.5-beta), its first part is built: a sandboxed `lord-bench` helper that measures the CPU, memory, the GPU offscreen, storage and a sustained load, stops near the temperature limit or when the processor throttles, and records the conditions of each run, shown in System Information → Performance as "×N" of reference machines; so far the only reference is a virtual machine, and the desktop-impact, compositor and video measurements are not built.+There are no measurements on real PCs in the repository yet. The ISO is tested on virtual machines (UEFI and BIOS); testing on a real AMD machine from the live USB is planned. LordBench (0.8.6) is designed to measure memory and CPU at idle, boot time, frame times, video and app start in a repeatable way, and community hardware reports (0.8.7) to collect them from real machines (`docs/BENCHMARK.md`). In development for 0.8.6 (unreleased; the latest release is 0.8.5-beta), its first part is built: a sandboxed `lord-bench` helper that measures the CPU, memory, the GPU offscreen, storage and a sustained load, stops near the temperature limit or when the processor throttles, and records the conditions of each run, shown in System Information → Performance as "×N" of reference machines; it also measures software video decoding and the remote desktop's encoders, the desktop's frame times alone and under a low-priority load, and boot time over several restarts. The references are a virtual machine and a Raspberry Pi 5 (§7.4); input latency, hardware video decoding and a real PC reference are not built yet.### Source files@@ -532,8 +532,8 @@ There are no measurements on real PCs in the repository yet. The ISO is tested o### 10.2 Known limitations-- Real hardware: AMD and Nvidia GPUs, real monitors, laptops (battery, backlight, lid), Bluetooth controllers, printers and scanners, FIDO2 keys and real mail providers are untested.-- The Raspberry Pi 5 is the only supported board, with LordOS's build of its kernel with Landlock; it hasn't been tested with a monitor, and its built image hasn't been booted yet.+- Real hardware: AMD and Nvidia GPUs, real monitors on PCs, laptops (battery, backlight, lid), Bluetooth controllers, printers and scanners, FIDO2 keys and real mail providers are untested.+- The Raspberry Pi 5 is the only supported board, with LordOS's build of its kernel with Landlock; its 0.8.5 image was booted and used on a 1920×1080 monitor on both HDMI ports; other monitors and resolutions are untested.- Linux apps are not sandboxed by default. X11 apps need Debian's `xwayland` package.- Firewall: no ask mode; domain rules don't see apps that resolve names with their own encrypted DNS.- Restrictions for Linux apps don't cover BlueZ over D-Bus, the system bus, the clipboard or apps started outside the app launcher; the `user@` union also holds the user's own services while a restricted app runs; a new PipeWire client has a window of a few milliseconds before the guard restricts it (§6.6).diff --git a/web/content/paper/paper.es.md b/web/content/paper/paper.es.mdindex 7a295e2..50b0396 100644--- a/web/content/paper/paper.es.md+++ b/web/content/paper/paper.es.md@@ -484,11 +484,11 @@ La Raspberry Pi 5 es la única placa soportada. Resultados en una placa real (16**Ventiladores.** En la Pi 5 dentro de un gabinete de prueba, `lord-fand` mantuvo el ventilador apagado a 50–53 °C durante una carga de 4 hilos (el gabinete de aluminio funciona como disipador), lo llevó al 55 % (4.500 RPM) y a velocidad máxima (7.400 RPM) con curvas de prueba, y restauró la configuración propia del kernel después de `SIGTERM` y de `kill -9` (`docs/FANS.md`).-**Monitor e imagen.** Desde la 0.8.4.1 la imagen para Raspberry Pi 5 muestra el escritorio en un monitor HDMI en el primer arranque (la línea del driver de pantalla en `config.txt` ahora va después de las líneas de autodetección del firmware, y LordOS espera hasta 30 s al driver), pone la hora desde la red y trae Chromium y Firefox ESR. Desde la 0.8.4 el kernel de LordOS para la Pi (`6.18.57-lordos.3-rpi-2712`) además destruye las conexiones de una app bloqueada. **Todavía no medido en la placa:** los cuadros por segundo y la composición por GPU en un monitor.+**Monitor e imagen.** Desde la 0.8.4.1 la imagen para Raspberry Pi 5 muestra el escritorio en un monitor HDMI en el primer arranque (la línea del driver de pantalla en `config.txt` ahora va después de las líneas de autodetección del firmware, y LordOS espera hasta 30 s al driver), pone la hora desde la red y trae Chromium y Firefox ESR. Desde la 0.8.4 el kernel de LordOS para la Pi (`6.18.57-lordos.3-rpi-2712`) además destruye las conexiones de una app bloqueada. **Medido con monitor (LordBench, 0.8.6 en desarrollo):** la imagen 0.8.5 arrancada con un monitor de 1920×1080 a 60 Hz en cualquiera de los dos puertos HDMI llega a la pantalla de inicio de sesión 5,99 s después de que arranca el kernel (systemd: 2,1 s de kernel y 4,2 s del resto). Con composición por GPU (V3D), una ventana movida por el compositor se mantiene en 59,4 cuadros por segundo, con un cuadro armado en 10,9 ms (mediana) y 13,0 ms (percentil 99) y el 1,0 % de cuadros tarde; con una carga en todos los núcleos a la menor prioridad baja a 24 cuadros por segundo con el 96,5 % tarde, un problema que encontró LordBench y que falta resolver. En 3 minutos de carga en todos los núcleos con el ventilador la placa mantuvo 5,9 GFLOP/s con 55,6 °C como máximo, y decodifica video 1080p por software a 258 (H.264), 246 (HEVC), 204 (VP9) y 159 (AV1) cuadros por segundo.### 7.5 PC modernas-Todavía no hay mediciones en PC reales en el repositorio. La ISO se prueba en máquinas virtuales (UEFI y BIOS); está planeado probarla en una máquina AMD real desde el USB live. LordBench (0.8.6) está diseñado para medir de forma repetible la memoria y la CPU en reposo, el tiempo de arranque, los tiempos de cuadro, el video y el inicio de apps, y los informes de hardware de la comunidad (0.8.7), para recolectar esas mediciones de máquinas reales (`docs/BENCHMARK.md`). En desarrollo para la 0.8.6 (sin publicar; la última versión es la 0.8.5-beta), su primera parte ya está construida: un ayudante aislado, `lord-bench`, que mide la CPU, la memoria, la GPU fuera de pantalla, el almacenamiento y una carga sostenida, se detiene cerca del límite de temperatura o cuando el procesador baja la velocidad, y registra las condiciones de cada prueba, que Información del sistema → Rendimiento muestra como «×N» de máquinas de referencia; por ahora la única referencia es una máquina virtual, y las mediciones del impacto en el escritorio, del compositor y de video no están construidas.+Todavía no hay mediciones en PC reales en el repositorio. La ISO se prueba en máquinas virtuales (UEFI y BIOS); está planeado probarla en una máquina AMD real desde el USB live. LordBench (0.8.6) está diseñado para medir de forma repetible la memoria y la CPU en reposo, el tiempo de arranque, los tiempos de cuadro, el video y el inicio de apps, y los informes de hardware de la comunidad (0.8.7), para recolectar esas mediciones de máquinas reales (`docs/BENCHMARK.md`). En desarrollo para la 0.8.6 (sin publicar; la última versión es la 0.8.5-beta), su primera parte ya está construida: un ayudante aislado, `lord-bench`, que mide la CPU, la memoria, la GPU fuera de pantalla, el almacenamiento y una carga sostenida, se detiene cerca del límite de temperatura o cuando el procesador baja la velocidad, y registra las condiciones de cada prueba, que Información del sistema → Rendimiento muestra como «×N» de máquinas de referencia; también mide la decodificación de video por software y los codificadores del escritorio remoto, los tiempos de cuadro del escritorio solo y bajo una carga de baja prioridad, y el tiempo de arranque en varios reinicios. Las referencias son una máquina virtual y una Raspberry Pi 5 (§7.4); la latencia de entrada, la decodificación de video por hardware y una referencia de PC real todavía no están construidas.### Archivos fuente@@ -532,8 +532,8 @@ La 0.8.0 Beta fue el primer lanzamiento público (18 de octubre de 2026); la 0.7### 10.2 Limitaciones conocidas-- Hardware real: no se probaron GPU AMD y Nvidia, monitores reales, notebooks (batería, brillo, tapa), controladores Bluetooth, impresoras y escáneres, llaves FIDO2 ni proveedores de correo reales.-- La Raspberry Pi 5 es la única placa soportada, con la compilación de LordOS de su kernel con Landlock; no se probó con un monitor, y su imagen generada todavía no se arrancó.+- Hardware real: no se probaron GPU AMD y Nvidia, monitores reales en PC, notebooks (batería, brillo, tapa), controladores Bluetooth, impresoras y escáneres, llaves FIDO2 ni proveedores de correo reales.+- La Raspberry Pi 5 es la única placa soportada, con la compilación de LordOS de su kernel con Landlock; su imagen 0.8.5 se arrancó y se usó con un monitor de 1920×1080 en los dos puertos HDMI; otros monitores y resoluciones no se probaron.- Las apps de Linux no están aisladas de forma predeterminada. Las apps X11 necesitan el paquete `xwayland` de Debian.- Firewall: sin modo "preguntar"; las reglas por dominio no ven a las apps que resuelven nombres con su propio DNS cifrado.- Las restricciones para apps de Linux no cubren BlueZ por D-Bus, el bus del sistema, el portapapeles ni las apps iniciadas fuera del lanzador de apps; la unión de `user@` también sujeta a los servicios propios del usuario mientras corre una app restringida; un cliente nuevo de PipeWire tiene una ventana de pocos milisegundos antes de que la guardia lo restrinja (§6.6).diff --git a/web/content/paper/paper.pt.md b/web/content/paper/paper.pt.mdindex 196ace7..be3b444 100644--- a/web/content/paper/paper.pt.md+++ b/web/content/paper/paper.pt.md@@ -484,11 +484,11 @@ O Raspberry Pi 5 é a única placa suportada. Resultados numa placa real (16 GB,**Ventoinhas.** No Pi 5 num gabinete de teste, o `lord-fand` manteve a ventoinha desligada a 50–53 °C durante uma carga de 4 threads (o gabinete de alumínio funciona como dissipador), a levou a 55 % (4.500 RPM) e à velocidade máxima (7.400 RPM) com curvas de teste e restaurou as configurações do próprio kernel depois de `SIGTERM` e `kill -9` (`docs/FANS.md`).-**Monitor e imagem.** Desde a 0.8.4.1 a imagem do Raspberry Pi 5 mostra o desktop num monitor HDMI no primeiro boot (a linha do driver de vídeo no `config.txt` agora vem depois das linhas de autodetecção do firmware, e o LordOS espera até 30 s pelo driver), acerta o relógio pela rede e traz Chromium e Firefox ESR. Desde a 0.8.4 o kernel do LordOS para o Pi (`6.18.57-lordos.3-rpi-2712`) também destrói as conexões de um app bloqueado. **Ainda não medido na placa:** taxa de quadros e composição na GPU num monitor.+**Monitor e imagem.** Desde a 0.8.4.1 a imagem do Raspberry Pi 5 mostra o desktop num monitor HDMI no primeiro boot (a linha do driver de vídeo no `config.txt` agora vem depois das linhas de autodetecção do firmware, e o LordOS espera até 30 s pelo driver), acerta o relógio pela rede e traz Chromium e Firefox ESR. Desde a 0.8.4 o kernel do LordOS para o Pi (`6.18.57-lordos.3-rpi-2712`) também destrói as conexões de um app bloqueado. **Medido com monitor (LordBench, 0.8.6 em desenvolvimento):** a imagem 0.8.5 inicializada com um monitor de 1920×1080 a 60 Hz em qualquer uma das duas portas HDMI chega à tela de login 5,99 s depois que o kernel inicia (systemd: 2,1 s de kernel e 4,2 s do resto). Com composição na GPU (V3D), uma janela movida pelo compositor se mantém em 59,4 quadros por segundo, com um quadro montado em 10,9 ms (mediana) e 13,0 ms (percentil 99) e 1,0 % dos quadros atrasados; com uma carga em todos os núcleos na menor prioridade cai para 24 quadros por segundo com 96,5 % atrasados, um problema que o LordBench encontrou e que falta resolver. Em 3 minutos de carga em todos os núcleos com o ventilador a placa manteve 5,9 GFLOP/s com 55,6 °C no máximo, e decodifica vídeo 1080p por software a 258 (H.264), 246 (HEVC), 204 (VP9) e 159 (AV1) quadros por segundo.### 7.5 PCs modernos-Ainda não há medições em PCs reais no repositório. A ISO é testada em máquinas virtuais (UEFI e BIOS); está planejado testá-la numa máquina AMD real a partir do pendrive live. O LordBench (0.8.6) foi projetado para medir de forma repetível memória e CPU em repouso, tempo de boot, tempos de quadro, vídeo e abertura de apps, e os relatórios de hardware da comunidade (0.8.7), para coletar essas medições de máquinas reais (`docs/BENCHMARK.md`). Em desenvolvimento para a 0.8.6 (não publicada; a última versão é a 0.8.5-beta), sua primeira parte já está construída: um auxiliar isolado, `lord-bench`, que mede a CPU, a memória, a GPU fora da tela, o armazenamento e uma carga contínua, para perto do limite de temperatura ou quando o processador reduz a velocidade, e registra as condições de cada teste, que Informações do Sistema → Desempenho mostra como «×N» de máquinas de referência; por enquanto a única referência é uma máquina virtual, e as medições do impacto no desktop, do compositor e de vídeo não estão construídas.+Ainda não há medições em PCs reais no repositório. A ISO é testada em máquinas virtuais (UEFI e BIOS); está planejado testá-la numa máquina AMD real a partir do pendrive live. O LordBench (0.8.6) foi projetado para medir de forma repetível memória e CPU em repouso, tempo de boot, tempos de quadro, vídeo e abertura de apps, e os relatórios de hardware da comunidade (0.8.7), para coletar essas medições de máquinas reais (`docs/BENCHMARK.md`). Em desenvolvimento para a 0.8.6 (não publicada; a última versão é a 0.8.5-beta), sua primeira parte já está construída: um auxiliar isolado, `lord-bench`, que mede a CPU, a memória, a GPU fora da tela, o armazenamento e uma carga contínua, para perto do limite de temperatura ou quando o processador reduz a velocidade, e registra as condições de cada teste, que Informações do Sistema → Desempenho mostra como «×N» de máquinas de referência; também mede a decodificação de vídeo por software e os codificadores da área de trabalho remota, os tempos de quadro do desktop sozinho e sob uma carga de baixa prioridade, e o tempo de boot em várias reinicializações. As referências são uma máquina virtual e um Raspberry Pi 5 (§7.4); a latência de entrada, a decodificação de vídeo por hardware e uma referência de PC real ainda não estão construídas.### Arquivos-fonte@@ -532,8 +532,8 @@ A 0.8.0 Beta foi o primeiro lançamento público (18 de outubro de 2026); a 0.7.### 10.2 Limitações conhecidas-- Hardware real: GPUs AMD e Nvidia, monitores reais, notebooks (bateria, brilho da tela, tampa), controladoras Bluetooth, impressoras e scanners, chaves FIDO2 e provedores de e-mail reais não foram testados.-- O Raspberry Pi 5 é a única placa suportada, com o build do LordOS do seu kernel com Landlock; não foi testado com monitor, e a imagem gerada ainda não foi inicializada.+- Hardware real: GPUs AMD e Nvidia, monitores reais em PCs, notebooks (bateria, brilho da tela, tampa), controladoras Bluetooth, impressoras e scanners, chaves FIDO2 e provedores de e-mail reais não foram testados.+- O Raspberry Pi 5 é a única placa suportada, com o build do LordOS do seu kernel com Landlock; sua imagem 0.8.5 foi inicializada e usada com um monitor de 1920×1080 nas duas portas HDMI; outros monitores e resoluções não foram testados.- Os apps Linux não ficam em sandbox por padrão. Apps X11 precisam do pacote `xwayland` do Debian.- Firewall: sem modo "perguntar"; as regras por domínio não veem apps que resolvem nomes com o próprio DNS criptografado.- As restrições para apps Linux não cobrem o BlueZ via D-Bus, o barramento do sistema, a área de transferência nem apps iniciados fora do lançador de apps; a união do `user@` também sujeita os serviços do próprio usuário enquanto um app restrito roda; um cliente novo de PipeWire tem uma janela de poucos milissegundos antes de o guarda restringi-lo (§6.6).