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
Test Bench report in System Information → Checks: the bench saves its last report (~/.local/state/lordos/testbench.json, atomically); Checks shows the Wayland checklist, 3D renderer, presentation and latency, with Open Test Bench (launched like any Linux app); evaluateBench tested
Federico Pereira58c4f4f5c3c1
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 383c7b1..a52fba2 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -30,7 +30,9 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),own copy in the clipboard as the Wayland protocol says.- **Test Bench** (`lordos-testbench`): a test pattern window that checks the display server from theoutside: frame timing and when frames really reach the screen, every key of the keyboard, the- mouse and wheel, and the Wayland protocols the system offers.+ mouse and wheel, and the Wayland protocols the system offers. G draws a 3D scene and says whether a+ real graphics card or the processor renders it; V plays generated video at 24, 30 or 60 frames a second;+ L locks the pointer; its last report appears in System Information → Checks.- **Monitor → Network shows ping (ICMP), raw IP and packet sockets** (the last two can see or forgetraffic: the row says so, with the protocol or ethertype and the interface), under the app thatopened them, and the remotediff --git a/apps/sysinfo/checks.js b/apps/sysinfo/checks.jsindex 2990c5b..ec5e8ee 100644--- a/apps/sysinfo/checks.js+++ b/apps/sysinfo/checks.js@@ -122,3 +122,23 @@ export function evaluateProbe(result) {export const PENDING = ['netpermEffective'];// Before the probe has run.export const PROBE_CHECKS = ['appSandbox', 'helperSandbox', 'broker', 'appScope'];++// ---- the Test Bench's last report (lordos-testbench, ~/.local/state/lordos/testbench.json) ----+// The Wayland checklist (§3.4), the 3D renderer, whether frames are presented and input-to-screen latency.+export function evaluateBench(b) {+ if (!b || b.tool !== 'lordos-testbench' || !Array.isArray(b.checks)) return null;+ const out = [];+ const fails = b.checks.filter((c) => c && c.state === 'fail');+ const passes = b.checks.filter((c) => c && c.state === 'pass').length;+ out.push(row('wayland', '§3.4', 'effective', b.checks.length ? (fails.length ? 'fail' : 'pass') : 'unknown',+ fails.length ? 'benchFails' : 'benchPasses', { pass: passes, fail: fails.length, list: fails.map((c) => c.id).join(', ') }));+ const gl = b.gl || {};+ if (gl.renderer) out.push(row('renderer3d', '§7.3', 'effective', /SOFTWARE/.test(gl.kind || '') ? 'warn' : 'pass', 'benchRenderer', { renderer: gl.renderer, ms: Math.round((gl.drawMs || 0) * 100) / 100 }));+ else if (gl.error) out.push(row('renderer3d', '§7.3', 'effective', 'unknown', 'benchNo3d', { error: gl.error }));+ else out.push(row('renderer3d', '§7.3', 'effective', 'unknown', 'benchNo3dRun'));+ if (b.presentation) out.push(row('presented', '§7.2', 'measured', b.presented ? 'info' : 'warn', b.presented ? 'benchPresented' : 'benchNotPresented',+ { shown: b.presented || 0, discarded: b.discarded || 0, hz: Math.round((b.refreshHz || b.outputRefreshHz || 0) * 100) / 100, fps: Math.round((b.fps || 0) * 10) / 10 }));+ const lat = b.latency || {};+ if (lat.n) out.push(row('latency', '§7.2', 'measured', 'info', 'benchLatency', { ms: Math.round(lat.avgMs * 10) / 10, n: lat.n }));+ return out;+}diff --git a/apps/sysinfo/index.jsx b/apps/sysinfo/index.jsxindex c9826f8..4597cf9 100644--- a/apps/sysinfo/index.jsx+++ b/apps/sysinfo/index.jsx@@ -6,10 +6,10 @@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,+ fs, userDirs, clipboard, wm, admin, remote, codeStatus, launchApp,} from '@lordos/sdk';import { useMemo, useState } from 'react';-import { evaluate as evaluateChecks, evaluateProbe, PENDING as PENDING_CHECKS, PROBE_CHECKS } from './checks.js';+import { evaluate as evaluateChecks, evaluateProbe, evaluateBench, PENDING as PENDING_CHECKS, PROBE_CHECKS } from './checks.js';import { cardLayers, sessionLayers, compatibility, hardwareSections, throttleFlags, machineName, compositionReason, reportFileName, reportJson, parseMemoryLines } from './model.js';// The app's icon: a chip on the brand gradient.@@ -392,6 +392,38 @@ function useProbe() {return [st, run];}+// The Test Bench (a Wayland client of its own, lordos-testbench): its last report, read from the user's state+// folder, and a button that opens it from the launcher like any Linux app.+function useBenchReport(n) {+ return useMemo(() => {+ try { return JSON.parse(fs.read(`${fs.home()}/.local/state/lordos/testbench.json`)); } catch (e) { return null; }+ }, [n]);+}++function BenchGroup() {+ const t = useTheme();+ const { t: tr } = useLocale();+ const [n, setN] = useState(0);+ const b = useBenchReport(n);+ const rows = useMemo(() => evaluateBench(b), [b]);+ return (+ <View style={{ gap: spacing.s }}>+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: spacing.m }}>+ <View style={{ flex: 1, gap: 2 }}>+ <Text style={{ fontSize: typeScale.headline, fontWeight: 600, color: t.text, textAlign: 'start' }}>{tr('sysinfo.bench.title')}</Text>+ <Text style={{ fontSize: typeScale.callout, color: t.textDim, textAlign: 'start', lineHeight: 1.4 }}>{tr('sysinfo.bench.intro')}</Text>+ </View>+ <Button label={tr('sysinfo.bench.reload')} onClick={() => setN(n + 1)} />+ <Button primary label={tr('sysinfo.bench.open')} onClick={() => launchApp('desktop:lordos-testbench')} />+ </View>+ <GroupBox footer={b && b.at ? tr('sysinfo.probe.when', { time: new Date(b.at).toLocaleString() }) : null}>+ {rows ? rows.map((c) => <CheckRow key={c.id} c={c} />)+ : <CheckRow c={{ id: 'wayland', level: 'effective', state: 'pending', paper: '§3.4' }} />}+ </GroupBox>+ </View>+ );+}+function Checks({ r }) {const t = useTheme();const { t: tr } = useLocale();@@ -423,6 +455,7 @@ function Checks({ r }) {{(probeRows || PROBE_CHECKS.map((id) => ({ id, level: 'effective', state: 'pending' }))).map((c) => <CheckRow key={c.id} c={c} />)}</GroupBox></View>+ <BenchGroup /><GroupBox title={tr('sysinfo.checksPendingTitle')} footer={tr('sysinfo.checksPendingFooter')}>{PENDING_CHECKS.map((id) => <CheckRow key={id} c={{ id, level: 'effective', state: 'pending' }} />)}</GroupBox>diff --git a/assets/locales/en/sysinfo.json b/assets/locales/en/sysinfo.jsonindex 3cbdf23..b8e8d23 100644--- a/assets/locales/en/sysinfo.json+++ b/assets/locales/en/sysinfo.json@@ -1,5 +1,9 @@{"appFirewall": "per-app firewall",+ "bench.intro": "A test pattern window that checks the display server from the outside: every Wayland protocol, the 3D renderer, frame presentation and input-to-screen latency. Its last report is shown here.",+ "bench.open": "Open Test Bench",+ "bench.reload": "Reload",+ "bench.title": "Test Bench","bpfLsm": "BPF security module","bus.mmc": "SD card or eMMC","bus.nvme": "NVMe",@@ -17,11 +21,23 @@"check.gpu": "Composition on the GPU","check.helperSandbox": "Decoders are locked in","check.landlock": "App file isolation (Landlock)",+ "check.latency": "Input to screen","check.memory": "Display server memory","check.netperm": "Per-app firewall","check.netpermEffective": "A denied app can't connect",+ "check.presented": "Frames reach the screen","check.remoteClosed": "Remote desktop closed when off",+ "check.renderer3d": "3D renderer","check.serverUser": "Display server without root",+ "check.wayland": "Wayland protocols",+ "checkNote.benchFails": "{fail} failed: {list}",+ "checkNote.benchLatency": "{ms} ms on average ({n} inputs)",+ "checkNote.benchNo3d": "3D didn't start: {error}",+ "checkNote.benchNo3dRun": "Not run yet: press G in the Test Bench",+ "checkNote.benchNotPresented": "No frame was presented ({discarded} discarded): a session without a monitor presents none",+ "checkNote.benchPasses": "{pass} checks passed",+ "checkNote.benchPresented": "{shown} shown, {discarded} discarded at {hz} Hz, {fps} frames a second",+ "checkNote.benchRenderer": "{renderer}, {ms} ms a frame","checkNote.brokerOk": "{count} requests refused: a path outside its folder, the clipboard, the security key, mail","checkNote.cgroupsNotSession": "This lord-server isn't in a LordOS session's tree (started from a terminal?)","checkNote.cgroupsOk": {diff --git a/assets/locales/es/sysinfo.json b/assets/locales/es/sysinfo.jsonindex 0458d04..3faff60 100644--- a/assets/locales/es/sysinfo.json+++ b/assets/locales/es/sysinfo.json@@ -1,5 +1,9 @@{"appFirewall": "firewall por app",+ "bench.intro": "Una ventana con carta de ajuste que revisa el servidor gráfico desde afuera: cada protocolo Wayland, el renderer 3D, la presentación de cuadros y la latencia de entrada a pantalla. Acá se ve su último informe.",+ "bench.open": "Abrir el banco de pruebas",+ "bench.reload": "Recargar",+ "bench.title": "Banco de pruebas","bpfLsm": "módulo de seguridad BPF","bus.mmc": "Tarjeta SD o eMMC","bus.nvme": "NVMe",@@ -17,11 +21,23 @@"check.gpu": "Composición en la GPU","check.helperSandbox": "Los decodificadores quedan encerrados","check.landlock": "Aislamiento de archivos (Landlock)",+ "check.latency": "De la entrada a la pantalla","check.memory": "Memoria del servidor gráfico","check.netperm": "Firewall por app","check.netpermEffective": "Una app bloqueada no puede conectarse",+ "check.presented": "Los cuadros llegan a la pantalla","check.remoteClosed": "Escritorio remoto cerrado si está apagado",+ "check.renderer3d": "Renderer 3D","check.serverUser": "Servidor gráfico sin root",+ "check.wayland": "Protocolos Wayland",+ "checkNote.benchFails": "{fail} fallaron: {list}",+ "checkNote.benchLatency": "{ms} ms en promedio ({n} entradas)",+ "checkNote.benchNo3d": "El 3D no arrancó: {error}",+ "checkNote.benchNo3dRun": "Todavía no se probó: tocá G en el banco de pruebas",+ "checkNote.benchNotPresented": "Ningún cuadro se presentó ({discarded} descartados): una sesión sin monitor no presenta",+ "checkNote.benchPasses": "{pass} pruebas correctas",+ "checkNote.benchPresented": "{shown} mostrados, {discarded} descartados a {hz} Hz, {fps} cuadros por segundo",+ "checkNote.benchRenderer": "{renderer}, {ms} ms por cuadro","checkNote.brokerOk": "{count} pedidos negados: una ruta fuera de su carpeta, el portapapeles, la llave de seguridad, el correo","checkNote.cgroupsNotSession": "Este lord-server no está en el árbol de una sesión de LordOS (¿se abrió desde una terminal?)","checkNote.cgroupsOk": {diff --git a/assets/locales/pt/sysinfo.json b/assets/locales/pt/sysinfo.jsonindex 772b67e..9a97368 100644--- a/assets/locales/pt/sysinfo.json+++ b/assets/locales/pt/sysinfo.json@@ -1,5 +1,9 @@{"appFirewall": "firewall por app",+ "bench.intro": "Uma janela com padrão de teste que verifica o servidor gráfico por fora: cada protocolo Wayland, o renderizador 3D, a apresentação de quadros e a latência da entrada até a tela. Aqui aparece seu último relatório.",+ "bench.open": "Abrir o banco de testes",+ "bench.reload": "Recarregar",+ "bench.title": "Banco de testes","bpfLsm": "módulo de segurança BPF","bus.mmc": "Cartão SD ou eMMC","bus.nvme": "NVMe",@@ -17,11 +21,23 @@"check.gpu": "Composição na GPU","check.helperSandbox": "Os decodificadores ficam presos","check.landlock": "Isolamento de arquivos (Landlock)",+ "check.latency": "Da entrada à tela","check.memory": "Memória do servidor gráfico","check.netperm": "Firewall por app","check.netpermEffective": "Um app bloqueado não consegue se conectar",+ "check.presented": "Os quadros chegam à tela","check.remoteClosed": "Área de trabalho remota fechada quando desligada",+ "check.renderer3d": "Renderizador 3D","check.serverUser": "Servidor gráfico sem root",+ "check.wayland": "Protocolos Wayland",+ "checkNote.benchFails": "{fail} falharam: {list}",+ "checkNote.benchLatency": "{ms} ms em média ({n} entradas)",+ "checkNote.benchNo3d": "O 3D não iniciou: {error}",+ "checkNote.benchNo3dRun": "Ainda não testado: aperte G no banco de testes",+ "checkNote.benchNotPresented": "Nenhum quadro foi apresentado ({discarded} descartados): uma sessão sem monitor não apresenta",+ "checkNote.benchPasses": "{pass} testes corretos",+ "checkNote.benchPresented": "{shown} mostrados, {discarded} descartados a {hz} Hz, {fps} quadros por segundo",+ "checkNote.benchRenderer": "{renderer}, {ms} ms por quadro","checkNote.brokerOk": "{count} pedidos recusados: um caminho fora da pasta, a área de transferência, a chave de segurança, o e-mail","checkNote.cgroupsNotSession": "Este lord-server não está na árvore de uma sessão do LordOS (aberto por um terminal?)","checkNote.cgroupsOk": {diff --git a/docs/PAPER-VALIDATION.md b/docs/PAPER-VALIDATION.mdindex 3799e74..66b41cf 100644--- a/docs/PAPER-VALIDATION.md+++ b/docs/PAPER-VALIDATION.md@@ -190,8 +190,16 @@ keyboard test can't light them; the bench should list them as taken by the syste-**Still to build:** pointer confine, keys taken by system shortcuts, gamepads, a run with the real monitor and-GPU (presentation, latency, zero-copy), and attaching the report to System Information.+**Phase 4 (2026-10-26): the report in System Information.** The bench writes its last report to+`~/.local/state/lordos/testbench.json` (atomically, after its checklist and on exit); System Information →+Checks shows it (Wayland protocols, the 3D renderer, whether frames reach the screen, input-to-screen+latency; `evaluateBench` in `apps/sysinfo/checks.js`, tested) with **Open Test Bench**, which launches it like any+Linux app.++++**Still to build:** pointer confine, keys taken by system shortcuts, gamepads, and a run with the real monitor and+GPU (presentation, latency, zero-copy).### The plandiff --git a/docs/sysinfo-bench.png b/docs/sysinfo-bench.pngnew file mode 100644index 0000000..92acd40Binary files /dev/null and b/docs/sysinfo-bench.png differdiff --git a/server/src/testbench/testbench.c b/server/src/testbench/testbench.cindex f530152..2c12b87 100644--- a/server/src/testbench/testbench.c+++ b/server/src/testbench/testbench.c@@ -35,6 +35,7 @@#include <stdlib.h>#include <string.h>#include <sys/mman.h>+#include <sys/stat.h>#include <time.h>#include <unistd.h>#include <wayland-client.h>@@ -722,10 +723,10 @@ static const struct wp_presentation_listener pres_listener = { pres_clock };static void report(FILE *o) {double span = t_last - t_first, sum = 0, mx = 0;for (int i = 0; i < nint; i++) { sum += intervals[i]; if (intervals[i] > mx) mx = intervals[i]; }- fprintf(o, "{\"tool\":\"lordos-testbench\",\"v\":1,\"window\":[%d,%d],\"frames\":%lu,\"fps\":%.2f,\"frameMsAvg\":%.3f,\"frameMsMax\":%.3f,"+ fprintf(o, "{\"tool\":\"lordos-testbench\",\"v\":1,\"at\":%lld,\"window\":[%d,%d],\"frames\":%lu,\"fps\":%.2f,\"frameMsAvg\":%.3f,\"frameMsMax\":%.3f,""\"noFreeBuffer\":%lu,\"presentation\":%s,\"presented\":%lu,\"discarded\":%lu,\"refreshHz\":%.3f,\"vblankSkips\":%lu,\"zeroCopy\":%lu,""\"keyboard\":%s,\"pointer\":%s,\"repeat\":[%d,%d],\"globals\":[",- win_w, win_h, frames, span > 0 && frames > 1 ? (frames - 1) * 1000.0 / span : 0.0, nint ? sum / nint : 0, mx,+ (long long)time(NULL) * 1000, win_w, win_h, frames, span > 0 && frames > 1 ? (frames - 1) * 1000.0 / span : 0.0, nint ? sum / nint : 0, mx,no_buffer, presentation ? "true" : "false", presented, discarded, refresh_ns ? 1e9 / refresh_ns : 0, vblank_skips, zero_copy,keyboard ? "true" : "false", pointer ? "true" : "false", repeat_rate, repeat_delay);for (int i = 0; i < nglobals; i++) fprintf(o, "%s{\"interface\":\"%s\",\"version\":%u}", i ? "," : "", globals[i].iface, globals[i].version);@@ -741,6 +742,27 @@ static void report(FILE *o) {fprintf(o, "]}\n");}+/* The last report, for System Information's Checks: $XDG_STATE_HOME/lordos/testbench.json (or+ * ~/.local/state/lordos/testbench.json), written whole and renamed into place. */+static void save_report(void) {+ const char *st = getenv("XDG_STATE_HOME"), *home = getenv("HOME");+ char dir[512], tmp[600], path[600];+ if (st && st[0] == '/') snprintf(dir, sizeof dir, "%s/lordos", st);+ else if (home && home[0] == '/') snprintf(dir, sizeof dir, "%s/.local/state/lordos", home);+ else return;+ char parent[512];+ snprintf(parent, sizeof parent, "%s", dir);+ char *sl = strrchr(parent, '/');+ if (sl) { *sl = 0; mkdir(parent, 0700); }+ mkdir(dir, 0700);+ snprintf(tmp, sizeof tmp, "%s/.testbench.json.tmp", dir);+ snprintf(path, sizeof path, "%s/testbench.json", dir);+ FILE *f = fopen(tmp, "we");+ if (!f) return;+ report(f);+ if (fclose(f) == 0) rename(tmp, path); else unlink(tmp);+}+int main(int argc, char **argv) {double auto_s = 0;int auto_gl = 0;@@ -783,13 +805,15 @@ int main(int argc, char **argv) {if ((!ran && frames > 2) || rerun_checks) {ran = 1;rerun_checks = 0;- if (checks_run() < 0) break; /* the compositor ended the connection */+ if (checks_run() < 0) { save_report(); break; } /* the compositor ended the connection */+ save_report();if (auto_gl && subcomp && !gl3d_on()) gl3d_start(dpy, comp, subcomp, surf, card_x, card_y, card.w, card.h);}if (auto_s > 0 && frames && now_ms() - start > auto_s * 1000) break;}if (wl_display_get_error(dpy) && !checks_done) fprintf(stderr, "lordos-testbench: the connection ended (error %d)\n", wl_display_get_error(dpy));if (auto_s > 0) report(stdout);+ if (frames) save_report();for (int i = 0; i < 2; i++) buf_free(&bufs[i]);card_free(&card);wl_display_disconnect(dpy);diff --git a/server/tests/sysinfo_model_test.mjs b/server/tests/sysinfo_model_test.mjsindex 45878ee..b9efe7c 100644--- a/server/tests/sysinfo_model_test.mjs+++ b/server/tests/sysinfo_model_test.mjs@@ -1,7 +1,7 @@// sysinfo_model_test.mjs — System Information's model (apps/sysinfo/model.js, 0.8.5): the GPU layers,// the reasons for CPU composition, the Compatibility panel and the Hardware sections. Run by// tests/run_suites.sh (needs node).-import { evaluate, evaluateProbe, LIMITS } from '../../apps/sysinfo/checks.js';+import { evaluate, evaluateProbe, evaluateBench, LIMITS } from '../../apps/sysinfo/checks.js';import { compositionReason, cardLayers, sessionLayers, compatibility, hardwareSections, throttleFlags, machineName, reportFileName, reportJson, parseMemoryLines } from '../../apps/sysinfo/model.js';let n = 0, bad = 0;@@ -144,5 +144,15 @@ eq('no scope of its own', evaluateProbe({ ...okProbe, proc: { ...okProbe.proc, ceq('helper never ran', evaluateProbe({ ...okProbe, probe: { ...okProbe.probe, tries: [...tr_(KER), ...tr_(['ownData'], false), ...tr_(['helperRan'])] } }).find((r) => r.id === 'helperSandbox').state, 'unknown');eq('garbage does not throw', evaluateProbe({ probe: { tries: [null, 3, { id: 5 }] } }).map((r) => r.state), ['unknown', 'fail', 'fail', 'unknown']);+// ---- the Test Bench's report ----+const bench = { tool: 'lordos-testbench', at: 1, fps: 59.9, presentation: true, presented: 600, discarded: 0, refreshHz: 60,+ latency: { n: 4, avgMs: 21.25 }, gl: { renderer: 'AMD Radeon RX 580', kind: 'HARDWARE GPU', drawMs: 0.4 },+ checks: [{ id: 'a', state: 'pass' }, { id: 'b', state: 'pass' }, { id: 'c', state: 'info' }] };+eq('a good bench', st(evaluateBench(bench)), { wayland: 'pass', renderer3d: 'pass', presented: 'info', latency: 'info' });+eq('a failing check is named', evaluateBench({ ...bench, checks: [...bench.checks, { id: 'clipboard round trip', state: 'fail' }] })[0].vars.list, 'clipboard round trip');+eq('software renderer warns, headless presents nothing', st(evaluateBench({ ...bench, presented: 0, discarded: 9, gl: { renderer: 'llvmpipe', kind: 'SOFTWARE (CPU)' }, latency: {} })),+ { wayland: 'pass', renderer3d: 'warn', presented: 'warn' });+eq('not a bench report', [evaluateBench(null), evaluateBench({ tool: 'x' }), evaluateBench({ tool: 'lordos-testbench' })], [null, null, null]);+console.log(`sysinfo-model-test: ${n - bad} ok, ${bad} failed`);process.exit(bad ? 1 : 0);