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: the layout and paint workload (cpu.ui.1/.n, a fixed 1920x1080 scene through the real engine) and the shaping workload (cpu.shape.1/.n, five fixed paragraphs: Latin, Arabic with bidi, Devanagari, Thai, CJK), with Inter and subset Noto fonts built into lord-bench so it opens no files; the helper-sandbox self-test inside lord-bench (six tries that must fail, LB_MSG_SANDBOX, the Stability verdict and the CLI); engine results compared only within one LordOS version; VM 116 numbers; BENCHMARK, ROADMAP, ARCHITECTURE, THIRD_PARTY, CHANGELOG, paper (en/es/pt), FAQ
Federico Pereiraec9d0e8eb88f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 08a67bb..10bd272 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -22,7 +22,7 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),### Added- **LordBench, first part (in development for 0.8.6; `docs/BENCHMARK.md`, "Built so far"):** System Information has a- **Performance** tab with a Quick test (about half a minute) and a Full test (adds storage and three minutes of+ **Performance** tab with a Quick test (less than a minute) and a Full test (adds storage and three minutes ofsustained load). The work runs in **`lord-bench`**, a new sandboxed helper launched by lord-server like `lord-doc`and `lord-media` (its own folder only, no arguments, `sandbox_apply_helper` before any work, scope`lordos-bench.scope`, 2 GB cap), which gets only the GPU's render node and an unnamed scratch file opened by@@ -31,6 +31,26 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),- SHA-256 and a 256×256 matrix product;- the package engine's xz decoder on a fixed 2 MB text generated at build time;- QuickJS running a fixed script;+ - **LordOS's own interface work** (`bench/lbui.c`, the engine's real code linked into `lord-bench`): layout and+ paint of a fixed 1920×1080 scene built in C (529 nodes: a translucent top bar, a file manager with a 40-row+ list, a settings window with a wrapped paragraph and controls, a notification and the Dock with backdrop+ blur, shadows, a rotated badge, a half-transparent card), every node invalidated and the whole screen painted+ each frame, in frames per second (`cpu.ui.1`; `cpu.ui.n` is the same with the paint's row bands on up to 8+ threads, as lord-server's paint threads); and shaping fixed paragraphs in Latin, Arabic with embedded+ left-to-right text, Devanagari, Thai and Chinese with kana (`bench/lbtext.h`) as the engine's text layout does+ (bidi, script runs, each character's font, GSUB and GPOS, the visual order), in runs per second, one core+ and all (`cpu.shape.1/n`). The helper opens no files: the scene is fixed data and the fonts are built into the+ binary (`build/gen/lb_fonts.h`): LordOS's Inter and Debian 13's Noto Sans Arabic, Devanagari, Thai and CJK SC+ subset to exactly those paragraphs with every layout feature kept (`tools/gen-lbfonts.py`, committed in+ `server/src/bench/fonts` with their OFL licence; Inter pinned by its SHA-256 in `mk/lordbench.mk`, so a new+ Inter fails the build until the references are measured again); `build/shape-test` gives the same glyph+ positions with each subset as with the full system font, though the subsets shape about 12 % faster than the+ full fonts (fewer lookups), so the workload is comparable only with itself. These four numbers measure+ LordOS's engine with the machine: a reference value of one carries the LordOS version it was measured with and+ gives a "×N" only to a result of that version (`ENGINE_IDS` in `apps/sysinfo/perf.js`). The paint threads of+ `cpu.ui.n` start each run from a clean pool, and the shaping threads only read the shared script table (set+ before they start; ThreadSanitizer had found a race there). `lord-bench` grows from 1.48 to 2.42 MB of code;+ its sandbox, seccomp list and fds are unchanged;- memory copy and triad bandwidth and a 64 MB pointer-chase latency;- OpenGL ES 2 offscreen at 1920×1080 on the render node: the 3D scene, fill rate, texture upload and 8 layers;- (Full only) sequential write and read and random 4 KiB reads on up to 1 GB;@@ -41,10 +61,24 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),- stops within 2 °C of the passive trip point (10 °C of the critical one without one);- the peak tests also stop when the x86 throttle counters grow or the Raspberry Pi firmware reports throttling;- in the sustained test, throttling is recorded with its time and temperature instead.+ - **Helper-sandbox self-test** (`sec.helper-sandbox`, repeated inside `lord-bench`): right after+ `sandbox_apply_helper` and before any work, `lord-bench` tries six things that must fail, the Sandbox Probe's+ helper tries plus two: a unix socket, an internet socket, exec, fork, a new file (`O_TMPFILE` in `/tmp`) and+ reading `/etc/passwd`. None could change anything if it worked (exec is called with an invalid environment+ pointer, so an allowed one fails with `EFAULT` before anything is replaced; a socket or unnamed file is closed at+ once; a forked child only exits). Each try is a fixed record (`LB_MSG_SANDBOX`, checked by `lb_msg_valid`), the+ result lists them as `sandboxTries` (id, refused, errno), the Stability verdict fails a run where one got+ through or is missing (naming each try in the user's language, "run a program", …) and otherwise says that all+ six were refused; on a kernel without Landlock the two file tries only warn, since the sandbox mask already+ records that limit. `lordos-sysreport bench` checks the same six by name ("N of 6 tries refused", a+ `NOT REFUSED` line for each one that worked or is missing) and exits with 3 when one got through. On VM 116 all six+ were refused (`EPERM` from seccomp for the sockets, exec and fork; `EACCES` from Landlock for the files), and a+ trace of a run shows the CPU workloads open no file.- **Results:** shown as "×N" of each reference machine per category, never one score, with three verdicts:- performance;- compatibility, from the Compatibility tab;- - stability: stops, failed measurements, throttling, under-voltage, a sustained drop and a busy start.+ - stability: stops, failed measurements, throttling, under-voltage, a sustained drop, a busy start and the+ helper-sandbox self-test.Each result also shows the change against the previous run and the conditions that differ, every recordedcondition, the boot time per LordOS version and **Save to Documents**. Nothing is sent anywhere.@@ -75,7 +109,11 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),- **References:** VM 116 (8 vCPU Xeon Silver 4108, llvmpipe) and a **Raspberry Pi 5 16 GB** (SD card, V3D), each areal 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.+ decoding H.264 1080p 399 fps, AV1 1080p 201 fps, HEVC 4K 102 fps; H.264 encoder 106 fps. The interface+ workloads, from a later Full run (2026-10-28): layout and paint 37.0 fps on one core and 39.9 fps with the+ paint threads (a frame is about 28 ms, almost all of it paint: the layout of the 529 nodes takes 0.15 ms, and+ only big row-local fills, shadows and blits are split into bands); shaping 619 runs/s on one core and 3,595 on+ eight. A Quick run from a terminal now takes 46 s. The Pi 5 has not been measured with them yet (its reference lists them as not measured).- 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 scene795 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/swith the fan, 55.6 °C at most; software decoding H.264 1080p 258 fps, AV1 1080p 159 fps, H.264 4K 55 fps,@@ -96,7 +134,7 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),lord-server's own code (`bench/lbrun.c`): the same guards, helpers and result file, which System Information thenshows. `lordos-sysreport` is now installed in `/usr/lib/lordos/bin` with `/usr/bin/lordos-sysreport` and`lordos-fetch` as links (`tools/iso/mkdeb.sh`), because the helpers are only started from next to their own- binary. A quick run took 39 s on VM 116. On VM 116 (headless, with a remote viewer)+ binary. A quick run took 39 s on VM 116 (46 s with the interface workloads). 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 skernel + 4.2 s userspace).@@ -105,10 +143,12 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),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, boothistory, the frame recorder and its pointer latency, the synthetic pointer's thread and eventfd, the video- records, the boot test state file; 973 checks) and `tests/sysinfo_perf_test.mjs` (43 checks, with the desktop- verdict, the pointer latency notes and the video category).- - **Not built yet:** hardware video decoding, the layout/paint/shaping workloads, the helper-sandbox self-test- inside `lord-bench` and the x86 PC reference.+ records, the boot test state file, the interface scene with every style key known, each paragraph shaped with no+ missing glyph and the same twice, the sandbox self-test's records; 1,178 checks) and+ `tests/sysinfo_perf_test.mjs` (55 checks, with the desktop verdict, the pointer latency notes, the video+ category, the self-test in the stability verdict with and without Landlock, and the engine workloads compared+ only within one LordOS version).+ - **Not built yet:** hardware video decoding and the x86 PC reference.- **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 thediff --git a/THIRD_PARTY.md b/THIRD_PARTY.mdindex 58e1412..592ad28 100644--- a/THIRD_PARTY.md+++ b/THIRD_PARTY.md@@ -22,6 +22,7 @@ the components below, each under its own license.| Inter (`assets/fonts/Inter-*.ttf`) | UI text | SIL OFL 1.1 (`assets/fonts/Inter-LICENSE.txt`) || Plus Jakarta Sans 2.7.1 (`assets/fonts/PlusJakartaSans-ExtraBold.ttf`, `-Medium.ttf`) | the LordOS wordmark: live text in the UI (fontFamily `brand`) and outlined in `assets/brand/*.svg` | SIL OFL 1.1 (`assets/fonts/PlusJakartaSans-LICENSE.txt`) || JetBrains Mono (`assets/fonts/JetBrainsMono-*.ttf`) | terminal and code text | SIL OFL 1.1 (`assets/fonts/JetBrainsMono-LICENSE.txt`) |+| Noto Sans Arabic, Devanagari, Thai and CJK SC, subset (`server/src/bench/fonts/`) | built into `lord-bench` for LordBench's shaping workload (subset by `tools/gen-lbfonts.py`) | SIL OFL 1.1 (`server/src/bench/fonts/OFL.txt`) |## npm packages (bundled into the theme JavaScript at build time)diff --git a/apps/sysinfo/perf.js b/apps/sysinfo/perf.jsindex 896a57b..1dcd8e9 100644--- a/apps/sysinfo/perf.js+++ b/apps/sysinfo/perf.js@@ -7,7 +7,8 @@import { REFERENCES } from './references.js';export const CATEGORIES = [- { id: 'cpu', ids: ['cpu.sha256.1', 'cpu.sha256.n', 'cpu.matmul.1', 'cpu.matmul.n', 'cpu.xz.1', 'cpu.xz.n', 'cpu.js.1', 'cpu.js.n'] },+ { id: 'cpu', ids: ['cpu.sha256.1', 'cpu.sha256.n', 'cpu.matmul.1', 'cpu.matmul.n', 'cpu.xz.1', 'cpu.xz.n', 'cpu.js.1', 'cpu.js.n',+ 'cpu.ui.1', 'cpu.ui.n', 'cpu.shape.1', 'cpu.shape.n'] },{ id: 'memory', ids: ['mem.copy', 'mem.triad', 'mem.latency'] },{ id: 'gpu', ids: ['gpu.scene', 'gpu.fill', 'gpu.upload', 'gpu.layers'] },{ id: 'storage', ids: ['disk.seqwrite', 'disk.seqread', 'disk.random4k'] },@@ -20,17 +21,29 @@ export const DESKTOP_CATEGORIES = [{ id: 'compositor', ids: ['comp.fps', 'comp.p50', 'comp.p99', 'comp.missed', 'comp.in50', 'comp.in99'] },{ id: 'desktop', ids: ['desk.fps', 'desk.p50', 'desk.p99', 'desk.missed', 'desk.in50', 'desk.in99', 'desk.work'] },];+// the helper-sandbox self-test lord-bench makes after locking itself in (server/src/bench/lbproto.h, LB_SBX_*):+// every one of these must be refused+export const SANDBOX_TRIES = ['helperSocket', 'helperInet', 'helperExec', 'helperFork', 'helperNewFile', 'helperRead'];+// the tries only Landlock refuses, and its bit in the sandbox mask (server/src/sec/sandbox.h, SB_LANDLOCK_FS)+export const LANDLOCK_TRIES = ['helperNewFile', 'helperRead'];+const SB_LANDLOCK_FS = 2;export const MISSED_WARN = 5; // % of frames shown late before the verdict warnsexport const MISSED_FAIL = 25;export const INPUT_WARN_FRAMES = 3; // pointer-to-screen p99 above this many refresh periods warnsexport { REFERENCES };+// the measurements that time LordOS's own engine code (layout, paint, shaping) with the machine: a reference+// value of one carries the LordOS version it was measured with ("lordos"), and is used only for a result of that+// same version, so an engine change (or a new interface font) never shows up as a faster or slower machine+export const ENGINE_IDS = ['cpu.ui.1', 'cpu.ui.n', 'cpu.shape.1', 'cpu.shape.n'];+// ×N of the reference for one measurement (latency: the reference's time over ours); null if either-// is missing+// is missing, or if the reference value belongs to another LordOS version (ENGINE_IDS)export function ratio(res, ref, id) {const a = res && res.results && res.results[id], b = ref && ref.results && ref.results[id];if (!a || !b || !(a.value > 0) || !(b.value > 0)) return null;+ if (b.lordos != null && b.lordos !== res.lordos) return null;return a.lowerBetter ? b.value / a.value : a.value / b.value;}@@ -73,6 +86,21 @@ export function stability(res) {}if (res.sustained && res.sustained.throttleAtS != null) warn('sustainedThrottle', { s: res.sustained.throttleAtS, temp: res.sustained.throttleTempC });if (res.quiet && !res.quiet.quiet) warn('notQuiet', { pct: Math.round(res.quiet.busyPct) });+ // the helper's own sandbox (sec.helper-sandbox): a try that wasn't refused, or one missing, fails the run;+ // all refused is said too (info: it doesn't change the state). Results from before it was built have none.+ // On a kernel without Landlock (the sandbox mask has no SB_LANDLOCK_FS) the two tries only Landlock refuses+ // are expected to work: that is the kernel's limit, already in the mask, so it warns instead of failing.+ // The notes carry ids (vars.ids); the page translates each one (sysinfo.perf.sbx.<id>).+ if (Array.isArray(res.sandboxTries)) {+ const by = Object.fromEntries(res.sandboxTries.filter((t) => t && typeof t.id === 'string').map((t) => [t.id, t]));+ const leaks = SANDBOX_TRIES.filter((id) => !by[id] || by[id].denied !== true);+ const noLandlock = typeof res.sandbox === 'number' && !(res.sandbox & SB_LANDLOCK_FS);+ const partial = noLandlock ? leaks.filter((id) => LANDLOCK_TRIES.includes(id) && by[id]) : [];+ const real = leaks.filter((id) => !partial.includes(id));+ if (real.length) { state = 'fail'; notes.push({ id: 'sandboxLeaks', vars: { ids: real } }); }+ if (partial.length) warn('sandboxPartial', { ids: partial });+ if (!leaks.length) notes.push({ id: 'sandboxHeld', vars: { count: SANDBOX_TRIES.length }, info: true });+ }return { state, notes };}diff --git a/apps/sysinfo/performance.jsx b/apps/sysinfo/performance.jsxindex afc5a5a..d901218 100644--- a/apps/sysinfo/performance.jsx+++ b/apps/sysinfo/performance.jsx@@ -11,7 +11,7 @@ import {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, DESKTOP_CATEGORIES, categoryRatios, comparableReferences, stability, compatibilityVerdict, desktopVerdict, conditionDiffs, changes, sustainedSeries, fileName } from './perf.js';+import { CATEGORIES, DESKTOP_CATEGORIES, ratio, categoryRatios, comparableReferences, stability, compatibilityVerdict, desktopVerdict, conditionDiffs, changes, sustainedSeries, fileName } from './perf.js';import { startScene } from './scene.jsx';import { compatibility } from './model.js';@@ -71,15 +71,23 @@ function Verdict({ label, state, detail, states = 'verdictState' }) {);}+// the stability verdict's text: what went wrong (or that nothing did), then what was only checked (info notes:+// the helper sandbox held)+function stabilityText(stab, tr) {+ const vars = (v) => (Array.isArray(v.ids) ? { ...v, list: v.ids.map((id) => tr(`sysinfo.perf.sbx.${id}`)).join(', ') } : v);+ const say = (ns) => ns.map((n) => tr(`sysinfo.perf.note.${n.id}`, vars(n.vars))).join(' ');+ const warns = stab.notes.filter((n) => !n.info), infos = stab.notes.filter((n) => n.info);+ return [warns.length ? say(warns) : tr('sysinfo.perf.note.none'), say(infos)].filter(Boolean).join(' ');+}+function Measurement({ id, res, refs, change }) {const t = useTheme();const { t: tr } = useLocale();const m = res.results && res.results[id];const skipped = res.skipped && res.skipped[id];const vs = refs.map((r) => {- const a = m && r.results[id];- if (!a || !(m.value > 0)) return null;- const x = m.lowerBetter ? a.value / m.value : m.value / a.value;+ const x = ratio(res, r, id);+ if (x == null) return null;return tr('sysinfo.perf.timesRef', { x: formatNumber(x, 2), ref: tr(`sysinfo.perf.ref.${r.id}`) });}).filter(Boolean).join(' · ');const ch = change != null && Math.abs(change) >= 0.005@@ -230,7 +238,7 @@ function Result({ res, report }) {<Verdict label={tr('sysinfo.perf.v.desktop')} state={dv.state} states="deskState"detail={dv.notes.map((n) => tr(`sysinfo.perf.dnote.${n.id}`, Object.fromEntries(Object.entries(n.vars).map(([k, v]) => [k, formatNumber(v, 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')} />+ detail={stabilityText(stab, tr)} /></GroupBox>) : (<GroupBox title={tr('sysinfo.perf.verdicts')} footer={tr('sysinfo.perf.verdictsFooter')}>@@ -238,7 +246,7 @@ function Result({ res, report }) {<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')} />+ detail={stabilityText(stab, tr)} /></GroupBox>)}{(desktop ? DESKTOP_CATEGORIES : CATEGORIES).map((c) => (diff --git a/apps/sysinfo/references.js b/apps/sysinfo/references.jsindex 04e82d0..bd54944 100644--- a/apps/sysinfo/references.js+++ b/apps/sysinfo/references.js@@ -1,6 +1,7 @@// 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>.+// copied from the lordbench.json it wrote, with the machine described in sysinfo.perf.ref.<id>. A measurement+// added to LordBench after a reference's run is listed in its notMeasured until that machine is measured again.// Planned: a modest x86 PC; it is added when it has been measured.export const REFERENCES = [{@@ -22,6 +23,12 @@ export const REFERENCES = ['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 },+ // the layout, paint and shaping workloads, from a later Full run of the same machine (2026-10-28, no+ // sustained or storage part; its other measurements were within 4 % of the ones above). They time LordOS's+ // engine too, so each carries the LordOS version the run reported and is compared only with results of that+ // version (perf.js ENGINE_IDS): measure them again for every release+ 'cpu.ui.1': { value: 36.9702, lordos: '0.8.5-beta' }, 'cpu.ui.n': { value: 39.9302, lordos: '0.8.5-beta' },+ 'cpu.shape.1': { value: 618.791, lordos: '0.8.5-beta' }, 'cpu.shape.n': { value: 3595.11, lordos: '0.8.5-beta' },},},{@@ -45,5 +52,6 @@ export const REFERENCES = ['video.h264.2160': { value: 55.007 }, 'video.hevc.2160': { value: 57.213 },'video.enc.h264': { value: 75.332 }, 'video.enc.vp8': { value: 54.526 },},+ notMeasured: ['cpu.ui.1', 'cpu.ui.n', 'cpu.shape.1', 'cpu.shape.n'],},];diff --git a/assets/locales/en/sysinfo.json b/assets/locales/en/sysinfo.jsonindex a4f3bb2..87615d9 100644--- a/assets/locales/en/sysinfo.json+++ b/assets/locales/en/sysinfo.json@@ -321,7 +321,7 @@"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), 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.fullNote": "The quick test takes less than 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)",@@ -342,6 +342,10 @@"perf.m.cpu_matmul_n": "Matrix multiply, all cores","perf.m.cpu_sha256_1": "SHA-256, one core","perf.m.cpu_sha256_n": "SHA-256, all cores",+ "perf.m.cpu_shape_1": "Text shaping in five scripts, one core",+ "perf.m.cpu_shape_n": "Text shaping in five scripts, all cores",+ "perf.m.cpu_ui_1": "Interface layout and paint, one core",+ "perf.m.cpu_ui_n": "Interface layout and paint, paint threads","perf.m.cpu_xz_1": "Package decompression, one core","perf.m.cpu_xz_n": "Package decompression, all cores","perf.m.desk_fps": "Frames shown",@@ -383,6 +387,9 @@"perf.note.none": "Ran to the end with no throttling, no stops and no failed measurement.","perf.note.notQuiet": "The computer was busy before starting ({pct} % CPU): the numbers may be low.","perf.note.piThrottled": "The board reports throttling.",+ "perf.note.sandboxHeld": "The benchmark helper's sandbox refused all {count} things it must not do.",+ "perf.note.sandboxLeaks": "The benchmark helper's sandbox did not stop it from: {list}.",+ "perf.note.sandboxPartial": "Without Landlock in this kernel the benchmark helper could still: {list}. Its other limits held.","perf.note.stopped": "The run was stopped.","perf.note.stoppedThermal": "Stopped near the temperature limit.","perf.note.stoppedThrottled": "Stopped: the processor slowed down to cool.",@@ -402,6 +409,12 @@"perf.ref.vm": "the reference VM","perf.sample": "{s} s: {g} GFLOP/s, {temp} °C","perf.sampleNoTemp": "{s} s: {g} GFLOP/s",+ "perf.sbx.helperExec": "run a program",+ "perf.sbx.helperFork": "start a process",+ "perf.sbx.helperInet": "open a network connection",+ "perf.sbx.helperNewFile": "create a file",+ "perf.sbx.helperRead": "read a system file",+ "perf.sbx.helperSocket": "open a local socket","perf.sceneCard": "Card {n}","perf.sceneTitle": "Test window","perf.skip.failed": "failed",@@ -431,7 +444,7 @@"perf.verdictState.unknown": "No reference","perf.verdictState.warn": "With notes","perf.verdicts": "Verdicts",- "perf.verdictsFooter": "Three separate answers: how fast against similar machines, what works, and whether it stayed stable under load.",+ "perf.verdictsFooter": "Three separate answers: how fast against similar machines, what works, and whether it stayed stable under load. Interface layout, paint and text shaping time LordOS's own code too, so they are compared only with references measured with the same LordOS version.","perf.waiting": "Waiting for the computer to be quiet (up to 30 s)…","perf.why.battery": "on battery below 30 %","perf.why.helper": "the helper ended early",diff --git a/assets/locales/es/sysinfo.json b/assets/locales/es/sysinfo.jsonindex bbb0a48..5562c04 100644--- a/assets/locales/es/sysinfo.json+++ b/assets/locales/es/sysinfo.json@@ -321,7 +321,7 @@"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), 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.fullNote": "La prueba rápida dura menos de un 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)",@@ -342,6 +342,10 @@"perf.m.cpu_matmul_n": "Producto de matrices, todos los núcleos","perf.m.cpu_sha256_1": "SHA-256, un núcleo","perf.m.cpu_sha256_n": "SHA-256, todos los núcleos",+ "perf.m.cpu_shape_1": "Composición tipográfica en cinco escrituras, un núcleo",+ "perf.m.cpu_shape_n": "Composición tipográfica en cinco escrituras, todos los núcleos",+ "perf.m.cpu_ui_1": "Diseño y dibujo de la interfaz, un núcleo",+ "perf.m.cpu_ui_n": "Diseño y dibujo de la interfaz, hilos de dibujo","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",@@ -383,6 +387,9 @@"perf.note.none": "Llegó al final sin bajar la velocidad, sin detenerse y sin mediciones fallidas.","perf.note.notQuiet": "El equipo estaba ocupado antes de empezar ({pct} % de CPU): los números pueden ser bajos.","perf.note.piThrottled": "La placa informa que bajó la velocidad.",+ "perf.note.sandboxHeld": "El aislamiento del ayudante de la prueba rechazó las {count} cosas que no debe hacer.",+ "perf.note.sandboxLeaks": "El aislamiento del ayudante de la prueba no le impidió: {list}.",+ "perf.note.sandboxPartial": "Sin Landlock en este kernel, el ayudante de la prueba igual pudo: {list}. Sus demás límites se cumplieron.","perf.note.stopped": "La prueba se detuvo.","perf.note.stoppedThermal": "Se detuvo cerca del límite de temperatura.","perf.note.stoppedThrottled": "Se detuvo: el procesador bajó la velocidad para enfriarse.",@@ -402,6 +409,12 @@"perf.ref.vm": "la VM de referencia","perf.sample": "{s} s: {g} GFLOP/s, {temp} °C","perf.sampleNoTemp": "{s} s: {g} GFLOP/s",+ "perf.sbx.helperExec": "ejecutar un programa",+ "perf.sbx.helperFork": "iniciar un proceso",+ "perf.sbx.helperInet": "abrir una conexión de red",+ "perf.sbx.helperNewFile": "crear un archivo",+ "perf.sbx.helperRead": "leer un archivo del sistema",+ "perf.sbx.helperSocket": "abrir un socket local","perf.sceneCard": "Tarjeta {n}","perf.sceneTitle": "Ventana de prueba","perf.skip.failed": "falló",@@ -431,7 +444,7 @@"perf.verdictState.unknown": "Sin referencia","perf.verdictState.warn": "Con observaciones","perf.verdicts": "Veredictos",- "perf.verdictsFooter": "Tres respuestas separadas: qué tan rápido es frente a máquinas parecidas, qué funciona y si se mantuvo estable bajo carga.",+ "perf.verdictsFooter": "Tres respuestas separadas: qué tan rápido es frente a máquinas parecidas, qué funciona y si se mantuvo estable bajo carga. El diseño y dibujo de la interfaz y la composición tipográfica miden también el código de LordOS, así que solo se comparan con referencias medidas con la misma versión de LordOS.","perf.waiting": "Esperando a que el equipo esté en reposo (hasta 30 s)…","perf.why.battery": "con batería por debajo del 30 %","perf.why.helper": "el ayudante terminó antes de tiempo",diff --git a/assets/locales/pt/sysinfo.json b/assets/locales/pt/sysinfo.jsonindex d6f0268..532e536 100644--- a/assets/locales/pt/sysinfo.json+++ b/assets/locales/pt/sysinfo.json@@ -321,7 +321,7 @@"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), 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.fullNote": "O teste rápido leva menos de um 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)",@@ -342,6 +342,10 @@"perf.m.cpu_matmul_n": "Produto de matrizes, todos os núcleos","perf.m.cpu_sha256_1": "SHA-256, um núcleo","perf.m.cpu_sha256_n": "SHA-256, todos os núcleos",+ "perf.m.cpu_shape_1": "Composição tipográfica em cinco escritas, um núcleo",+ "perf.m.cpu_shape_n": "Composição tipográfica em cinco escritas, todos os núcleos",+ "perf.m.cpu_ui_1": "Layout e desenho da interface, um núcleo",+ "perf.m.cpu_ui_n": "Layout e desenho da interface, threads de desenho","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",@@ -383,6 +387,9 @@"perf.note.none": "Chegou ao fim sem reduzir a velocidade, sem parar e sem medições com falha.","perf.note.notQuiet": "O computador estava ocupado antes de começar ({pct} % de CPU): os números podem estar baixos.","perf.note.piThrottled": "A placa informa redução de velocidade.",+ "perf.note.sandboxHeld": "O isolamento do auxiliar do teste recusou as {count} coisas que não deve fazer.",+ "perf.note.sandboxLeaks": "O isolamento do auxiliar do teste não o impediu de: {list}.",+ "perf.note.sandboxPartial": "Sem Landlock neste kernel, o auxiliar do teste ainda pôde: {list}. Seus outros limites se mantiveram.","perf.note.stopped": "O teste foi interrompido.","perf.note.stoppedThermal": "Parou perto do limite de temperatura.","perf.note.stoppedThrottled": "Parou: o processador reduziu a velocidade para esfriar.",@@ -402,6 +409,12 @@"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.sbx.helperExec": "executar um programa",+ "perf.sbx.helperFork": "iniciar um processo",+ "perf.sbx.helperInet": "abrir uma conexão de rede",+ "perf.sbx.helperNewFile": "criar um arquivo",+ "perf.sbx.helperRead": "ler um arquivo do sistema",+ "perf.sbx.helperSocket": "abrir um socket local","perf.sceneCard": "Cartão {n}","perf.sceneTitle": "Janela de teste","perf.skip.failed": "falhou",@@ -431,7 +444,7 @@"perf.verdictState.unknown": "Sem referência","perf.verdictState.warn": "Com observações","perf.verdicts": "Veredictos",- "perf.verdictsFooter": "Três respostas separadas: quão rápido é frente a máquinas parecidas, o que funciona e se ficou estável sob carga.",+ "perf.verdictsFooter": "Três respostas separadas: quão rápido é frente a máquinas parecidas, o que funciona e se ficou estável sob carga. O layout e desenho da interface e a composição tipográfica medem também o código do LordOS, então só são comparados com referências medidas com a mesma versão do LordOS.","perf.waiting": "Esperando o computador ficar em repouso (até 30 s)…","perf.why.battery": "na bateria abaixo de 30 %","perf.why.helper": "o auxiliar terminou antes da hora",diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex c369be2..28489fe 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -100,6 +100,7 @@ Besides the kernel and libc, only these are allowed:| Monocypher 4.0.2 | XChaCha20-Poly1305, Argon2id/Argon2d, BLAKE2b, ChaCha20 for the Passwords vault and the KeePass importer (approved by the user; CC0/BSD-2, one C file). **Only `lord-vault` links it**; its official test vectors run in `make test` (`PASSWORDS.md`) | vendored || EFF word list, 10k common passwords | passphrase generator and the offline "breached" check (CC BY 3.0 US / MIT), embedded in `lord-vault` | `third_party/wordlists` || Inter, Plus Jakarta Sans, JetBrains Mono | interface, display and terminal fonts (OFL) | `assets/fonts` |+| Noto Sans Arabic, Devanagari, Thai and CJK SC, subset | LordBench's shaping workload (0.8.6, in development): Debian 13's fonts subset to its fixed paragraphs by `tools/gen-lbfonts.py` (fontTools, on the maintainer's machine only, not a build dependency) and built into `lord-bench` with Inter Regular, which opens no files (OFL; `BENCHMARK.md`) | `server/src/bench/fonts` |**Xwayland** (Debian's `xwayland` package, 0.8.3) is not linked by anything: it is a separateprogram that `lord-server` starts on demand for X11 apps (`WAYLAND.md`, "X11 apps (Xwayland)").diff --git a/docs/BENCHMARK.md b/docs/BENCHMARK.mdindex 38b5fe2..5cd4c2e 100644--- a/docs/BENCHMARK.md+++ b/docs/BENCHMARK.md@@ -103,7 +103,7 @@ the test:|---|---|---|---|| `sec.server-user` | §2.2 | `lord-server`'s uid ≠ 0 | — || `sec.app-sandbox` | §6.4 | `Seccomp: 2`, `NoNewPrivs: 1` on an isolated app | a probe app (a system package started like any isolated app) tries to read a file outside its grant, open a socket, `ptrace`, create a user namespace and reach another app's scope; every attempt must be refused |-| `sec.helper-sandbox` | §6.7 | — | a child of the probe app that takes `sandbox_apply_helper()` checks that a unix socket, `exec`, `fork` and the app's data folder fail (0.8.5; `lord-bench` is planned to repeat it after its own lock-in in 0.8.6) |+| `sec.helper-sandbox` | §6.7 | — | a child of the probe app that takes `sandbox_apply_helper()` checks that a unix socket, `exec`, `fork` and the app's data folder fail (0.8.5); `lord-bench` repeats it after its own lock-in on every LordBench run, with an internet socket, a new file and a system file too, shown in Performance's Stability verdict (0.8.6, in development) || `sec.landlock` | §6.4 | Landlock ABI ≥ 6 | covered by the probe app || `sec.netperm` | §6.6 | `lord-netperm` running, programs attached, devices and Bluetooth programs loaded | the probe app, denied the network by a temporary rule, fails to connect to a local listener || `sec.code` | §6.9 | manifest present | every loaded bundle verified in this session |@@ -215,14 +215,54 @@ development package.it 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.-- **Workloads** (`bench/lbwork.c`, `bench/lbgpu.c`), each repeated three times and reported as the+- **Workloads** (`bench/lbwork.c`, `bench/lbui.c`, `bench/lbgpu.c`), each repeated three times and reported as themedian with its spread (max − min), on one core and on all of them:- CPU: SHA-256 (`pkg/crypto.c`, with the CPU's SHA instructions when present); a 256×256double-precision matrix product; decompressing a fixed 2 MB text with the package engine's own xzdecoder (`pkg/xz.c`; the text is generated at build time by `bench/lbcorpus.c` and compressed with`xz -9`), instead of the deflate in the design above; QuickJS running a fixed script (strings, JSON,- sorting, objects, a regular expression), one runtime per thread. The layout, paint and shaping- workloads are not built.+ sorting, objects, a regular expression), one runtime per thread.+ - LordOS's own interface work (`bench/lbui.c`), with the engine's real code linked into `lord-bench`+ (`ui/node.c`, `style.c`, `layout.c`, `paint.c`, `text.c`, `canvas.c`, the shaper `otf.c`, `shape*.c`,+ `bidi.c`; the Wayland, terminal, media and GPU hooks of `paint.c` are stubs, as in `tests/engine_test.c`):+ - **Layout and paint** (`cpu.ui.1`, `cpu.ui.n`, frames per second): a fixed 1920×1080 scene built in C,+ 529 nodes: a translucent top bar with backdrop blur, a file manager (title bar, a 14-item sidebar, a+ toolbar, a 40-row list with ellipsized names), a settings window with a wrapped paragraph and ten rows of+ fields and switches, a notification with backdrop blur, a half-transparent card, a rotated badge and the+ Dock with backdrop blur and twelve shadowed icons, over wallpaper shapes. One frame invalidates every node,+ lays the tree out, computes the damage and paints the whole screen; the glyph, text and shadow caches stay+ warm, as on a running desktop (one frame before the clock starts fills them). `cpu.ui.1` is everything on+ one core; `cpu.ui.n` the same frames with the paint's row-local loops split in bands over up to 8 threads+ (`canvas_parallel`, the same pieces as lord-server's paint threads, `par.c`, without their real-time+ priority), so it measures what the compositor's own threads gain, not N independent copies: the engine+ keeps one tree per process.+ - **Shaping** (`cpu.shape.1`, `cpu.shape.n`, runs per second, summed over the threads): one run shapes five+ fixed paragraphs (`bench/lbtext.h`: Latin with kerning, ligatures and accents; Arabic with marks, `lam-alef`+ and embedded left-to-right words and numbers; Devanagari with conjuncts, reph and reordered vowel signs; Thai+ with stacked marks and SARA AM; Chinese with kana and full-width punctuation), each as the first step of the+ engine's text layout (`textlayout.c`): bidi levels, scripts with the common characters joining their+ neighbours, each character's font (Inter if it has the character, else its script's), each run of one+ font, script and direction through `shape_run` (GSUB, the Arabic, Indic and Thai shapers, GPOS), then the+ visual order of the paragraph as one line. Each thread has its own shaper and font tables.+ - **No files.** The scene is fixed data and the fonts are bytes inside the binary (`build/gen/lb_fonts.h`,+ made at build time by `bench/lbcorpus.c`): LordOS's Inter Regular (the scene draws every weight with it and+ uses only characters it covers, so the engine never looks for a fallback font), and Debian 13's Noto Sans Arabic,+ Devanagari, Thai and CJK SC subset to exactly the characters of those paragraphs and their decompositions,+ with every layout feature and lookup they reach (`tools/gen-lbfonts.py`, run by hand when a paragraph+ changes; the results are committed in `server/src/bench/fonts` with their OFL licence, so every build shapes+ with the same bytes; Inter is pinned by its SHA-256 in `mk/lordbench.mk`, `LB_INTER_SHA256`, and a new Inter+ fails the build until the references are measured again). With each subset `build/shape-test` gives the+ same glyph positions as with the full system font, but it is not the same work: the subsets shape about+ 12 % faster than the full fonts (fewer lookups, smaller coverage tables; VM 116, 587–631 against 514–560+ runs/s on one core), so the workload is comparable only with itself. Line breaking is not part of the run: the engine's Thai word breaker reads libthai's dictionary+ from a file. A trace of a run shows these workloads open nothing; the helper's sandbox, seccomp list and fds+ are unchanged. `lord-bench` grows from 1.48 to 2.42 MB of code (about 0.63 MB of fonts) and 0.46 MB of+ static data.+ - **They measure LordOS's engine together with the machine.** An optimisation of `paint.c`, `layout.c` or the+ shaper changes these four numbers on the same hardware. So a reference value of one of them carries the+ LordOS version it was measured with (`"lordos"` in `apps/sysinfo/references.js`; `ENGINE_IDS` in+ `perf.js`) and gives a "×N" only to a result of that same version; a release re-measures them on the+ reference machines.- Memory: copy and triad bandwidth on all cores (32 MB arrays in Quick, 128 MB in Full) and thelatency of a dependent pointer chase over 64 MB.- GPU: OpenGL ES 2 offscreen on the render node (GBM + EGL, a surfaceless context, a 1920×1080@@ -289,10 +329,29 @@ development package.throttling 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 fakesysfs trees (`tests/lordbench_test.c`): an x86 laptop on battery, a Raspberry Pi 5.+- **Helper-sandbox self-test** (`sec.helper-sandbox`, repeated inside `lord-bench`, `sandbox_tries` in+ `bench/lbmain.c`): right after `sandbox_apply_helper` and before any work, in every mode, `lord-bench` tries six+ things that must fail: the Sandbox Probe's helper tries (`app/probe.c`) with its own versions of the data-folder+ one, plus an internet socket and a system file. A unix socket (`helperSocket`), an internet socket+ (`helperInet`), `execve` of `/usr/bin/true` (`helperExec`), `fork` (`helperFork`), a new unnamed file in `/tmp`+ (`helperNewFile`, `O_TMPFILE`: lord-bench has no writable folder) and reading `/etc/passwd` (`helperRead`). None+ could change anything if it worked: exec is called with an invalid environment pointer, so an exec the sandbox+ let through fails with `EFAULT` before anything is replaced (and counts as not refused); a socket or the unnamed+ file is closed at once; a forked child only exits. Each try is one fixed record (`LB_MSG_SANDBOX`: the try, refused+ or not, its errno; `lb_msg_valid` checks all three), the result lists them as `sandboxTries`, the Stability+ verdict fails a run where one got through or is missing and otherwise adds "refused all 6" without changing the+ state (results from before have none); the tries are named to the user in their language ("run a program", …).+ On a kernel without Landlock (no `SB_LANDLOCK_FS` in the sandbox mask) the two file tries are expected to work:+ that is the kernel's limit, already recorded in the mask, so they make the verdict warn ("Without Landlock in+ this kernel the benchmark helper could still: …"), not fail. `lordos-sysreport bench` checks the same six by+ name: "helper sandbox: N of 6 tries refused", a `NOT REFUSED: <id>` line for each one that worked or is+ missing (and "allowed without Landlock" for the file tries on such a kernel). On VM 116 all six were refused:+ `EPERM` from seccomp for the sockets, exec and fork, `EACCES` from Landlock for the two files.- **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- and after, the disk kind, the GPU kind (hardware, virtual or software), the sandbox mask, this+ and after, the disk kind, the GPU kind (hardware, virtual or software), the sandbox mask and the+ helper-sandbox self-test's tries, thissession's composition and each active display's connector, mode, refresh, scale and rotation (nonames, vendors or identities), every measurement with its unit, what was skipped and why, and thesustained samples. `lord.sysinfo.bench.boots()` groups lord-sessiond's boot history by version@@ -301,11 +360,14 @@ development package.`server/tests/sysinfo_perf_test.mjs`): Quick and Full, progress by measurement, then the three verdicts(performance as "×N" per category against each reference measured with the same LordBench version;compatibility counted from the Compatibility tab; stability from the status, failed measurements,- throttling, under-voltage, a sustained drop above 10 % and a busy start), every measurement with its+ throttling, under-voltage, a sustained drop above 10 %, a busy start and the helper-sandbox self-test),+ 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`): 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.+ copied from the `lordbench.json` it wrote (numbers below). A measurement added after a machine's run is listed in+ its `notMeasured` until it is measured again: VM 116's layout, paint and shaping numbers come from a later Full+ run; the Pi 5 has none yet. 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 oneight; matrix product 3.3 and 19.9 GFLOP/s; xz 60 and 363 MB/s; QuickJS 57 and 336 runs/s; memory copy@@ -314,6 +376,18 @@ eight; matrix product 3.3 and 19.9 GFLOP/s; xz 60 and 363 MB/s; QuickJS 57 and 3GFLOP/s; software video decoding H.264 1080p 399 fps, HEVC 1080p 385, VP9 1080p 215, AV1 1080p 201, H.264 4K76, HEVC 4K 102; encoders H.264 106 fps and VP8 54 fps at 1080p. A Quick run took 33 s.+VM 116, the interface workloads, Full without sustained or storage, LordBench 1 (2026-10-28, 142 s; its other+measurements were within 4 % of the run above): layout and paint 37.0 fps on one core (spread 0.2) and 39.9 fps+with the paint threads (spread 1.3); shaping 619 runs/s on one core and 3,595 runs/s on eight (5.8×). A frame of+the scene takes about 28 ms, almost all of it paint (the layout of the 529 nodes with every node invalidated takes+0.15 ms): llvmpipe is not involved, and only the big row-local loops (fills, shadow masks, blits of 512×512 pixels+or more) are split into bands, so the paint threads gain about 8 %. Three Quick runs from a terminal gave+35.8–36.2 fps, 40.3–40.8 fps, 625–629 runs/s and 3,565–3,596 runs/s; a Quick run from a terminal now takes 46 s+(39 s before). After the review fixes (the shaping threads' shared script table set before they start, a clean+paint pool for each run; ThreadSanitizer finds nothing in `lb_ui` and `lb_shape` repeated) a fourth Quick run gave+36.4 fps, 40.6 fps, 631 runs/s and 3,607 runs/s, in 46 s, with all six sandbox tries refused. The reference values+carry the LordOS version that run reported (`0.8.5-beta`, this branch's `package.json`).+Raspberry Pi 5 16 GB, Full with 180 s sustained, LordBench 1 (2026-10-27, 339 s): SHA-256 933 MB/s on one coreand 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,@@ -446,12 +520,14 @@ then shows it). It is installed as `/usr/lib/lordos/bin/lordos-sysreport` with ``lordos-fetch` as links, because `lbrun` only starts the `lord-bench` and `lord-media` next to its own binary(`/proc/self/exe`; a group- or world-writable helper is refused, so a build tree made with umask 002 needs `chmodg-w`). Without a session the helpers get no cgroup scope, and the desktop test needs a session. One line per-measurement (or the JSON with `--json`); exit 0 when the run finished. On VM 116 a quick run took 39 s.+measurement (or the JSON with `--json`); exit 0 when the run finished, 1 when it didn't, and 3 when it finished+but the helper-sandbox self-test let a try through or one is missing (text output only; with `--json` the exit+code is 0 or 1 and the tries are in `sandboxTries`). On VM 116 a quick run took 46 s.Not built yet: 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; and the x86 PC reference.+`v4l2request`); detecting the Pi's firmware throttling during a run on kernels that don't expose it; measuring the+Pi 5 with the layout, paint and shaping workloads (its reference lists them as not measured); and the x86 PC+reference.## 0.8.7 — Community hardware reportsdiff --git a/docs/PAPER-VALIDATION.md b/docs/PAPER-VALIDATION.mdindex 57e90e7..805554d 100644--- a/docs/PAPER-VALIDATION.md+++ b/docs/PAPER-VALIDATION.md@@ -108,6 +108,7 @@ memory from a process's RSS (§7.1) and points to versioned results (§11.5, `do| 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 led to a fix (compositor CPU weight: 31–33 % → 7–8 % late without the monitor), to re-measure on the monitor || 7.5 | No measurements on real PCs | — | **Untested** |+| 7.5 | — | New, 0.8.6 in development: LordBench's interface workloads on VM 116 (layout and paint 37.0/39.9 fps, shaping 619/3,595 runs/s; compared only within the same LordOS version) and the helper-sandbox self-test (six tries, all refused on VM 116: seccomp `EPERM`, Landlock `EACCES`) (`BENCHMARK.md`, "Built so far") | Measured with LordBench (one Full and three Quick runs); not yet on the Pi 5 |## §10–§11 Limits and verification@@ -142,7 +143,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, software video decoding and encoders, the desktop's frame times and pointer-to-screen latency alone and under load (and the compositor's CPU weight and real-time priority they led to), the boot time per version, the N-boot test and `lordos-sysreport bench` are built, with VM 116 and the Pi 5 as references, `BENCHMARK.md` "Built so far"; idle memory and CPU, hardware video decoding 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 and pointer-to-screen latency alone and under load (and the compositor's CPU weight and real-time priority they led to), the boot time per version, the N-boot test, `lordos-sysreport bench`, the interface layout/paint and shaping workloads and the helper-sandbox self-test are built, with VM 116 and the Pi 5 as references, `BENCHMARK.md` "Built so far"; idle memory and CPU, 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 94eca21..e8e25ab 100644--- a/docs/PAPER.md+++ b/docs/PAPER.md@@ -645,7 +645,7 @@ The Raspberry Pi 5 is the only supported board. Results on a real board (16 GB,### 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; it also measures software video decoding and the remote desktop's encoders, the desktop's frame times and the time from a pointer move to the screen, alone and under a low-priority load, and boot time over several restarts; it also runs from a terminal (`lordos-sysreport bench`). The references are a virtual machine and a Raspberry Pi 5 (§7.4); hardware video decoding and a real PC reference are not built yet.+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 and the time from a pointer move to the screen, alone and under a low-priority load, and boot time over several restarts; it also runs from a terminal (`lordos-sysreport bench`). Also in development, it times LordOS's own interface work with the engine's real code (the layout and paint of a fixed full-HD desktop scene, and the shaping of paragraphs in Latin, Arabic, Devanagari, Thai and Chinese with fonts built into the helper, which opens no files; on the reference virtual machine 37 frames per second on one core and 40 with the paint threads, 619 shaping runs per second on one core and 3,595 on eight), compared with a reference only when it was measured with the same LordOS version, and `lord-bench` checks its own sandbox before any work: six things it must not be able to do (open a local socket or a network connection, run a program, start a process, create a file, read a system file) were all refused on that machine, and a run where one gets through is marked unstable. The references are a virtual machine and a Raspberry Pi 5 (§7.4); hardware video decoding and a real PC reference are not built yet.### Source filesdiff --git a/docs/ROADMAP.md b/docs/ROADMAP.mdindex 854bd6d..bd87b91 100644--- a/docs/ROADMAP.md+++ b/docs/ROADMAP.md@@ -708,8 +708,13 @@ the maintainer on 2026-10-27, item below).the thermal, throttle and battery guards, the boot history and System Information → Performance are built(`BENCHMARK.md`, "Built so far"), and so are the video workloads (software decoding, the remote desktop'sencoders), the desktop-impact mode (the compositor's frame times alone and under a low-priority load), the N-boot- test, the pointer-to-screen latency, `lordos-sysreport bench` and the Pi 5 reference. Left: hardware video- decoding, the x86 PC reference, and the rest of what it found on the Pi 5 (the desktop fell to 24 fps under load;+ test, the pointer-to-screen latency, `lordos-sysreport bench` and the Pi 5 reference. *(2026-10-28)* Also built:+ LordOS's own interface work as workloads (layout and paint of a fixed 1920×1080 scene with the engine's real+ code, one core and with the paint threads, and shaping fixed paragraphs in five scripts, with the fonts built+ into the helper; VM 116: 37.0 and 39.9 fps, 619 and 3,595 runs/s), and the helper-sandbox self-test inside+ `lord-bench` (six tries that must fail, checked by the Stability verdict and `lordos-sysreport bench`). Left:+ hardware video decoding, the x86 PC reference, measuring the Pi 5 with the interface workloads (its reference+ lists them as not measured), and the rest of what it found on the Pi 5 (the desktop fell to 24 fps under load;the compositor's CPU weight and its real-time priority fix it on VM 116; on the Pi 5 with its monitor they take itto 29–30 fps and the frame's own build time under load, 15–16 ms instead of 7, is what remains to find,`BENCHMARK.md` "The desktop under load").diff --git a/server/mk/lordbench.mk b/server/mk/lordbench.mkindex 76133a7..a518651 100644--- a/server/mk/lordbench.mk+++ b/server/mk/lordbench.mk@@ -2,7 +2,8 @@# that runs the workloads (CPU, memory, GPU offscreen on a render node fd, storage on a scratch fd,# 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.+# its workloads), the UI engine and the shaper (ENGINE_SRC: the layout, paint and shaping workloads,+# bench/lbui.c, with their fonts built in) 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 src/bench/lbframes.c src/bench/lbvideo.c src/bench/lbinput.cLB_SRV_OBJ := $(LB_SRV_SRC:src/%.c=build/obj/%.o)$(LB_SRV_OBJ): $(wildcard src/bench/*.h) src/media/proto.h build/gen/lord_version.h@@ -19,23 +20,44 @@ build/gen/lb_corpus.h: build/lbcorpus@mkdir -p build/gen./build/lbcorpus text | xz -9 -T1 --check=crc64 -c | ./build/lbcorpus header > [email protected] && mv [email protected] $@-LB_SRC := src/bench/lbmain.c src/bench/lbwork.c src/bench/lbproto.c src/bench/bench.c src/pkg/crypto.c src/pkg/xz.c \- src/sec/sandbox.c src/sec/cgroup.c+# the layout, paint and shaping workloads' fonts (bench/lbui.c), built into lord-bench: it opens no files.+# LordOS's Inter, and the Noto fonts subset to the paragraphs of src/bench/lbtext.h (tools/gen-lbfonts.py)+LB_FONTS := ../assets/fonts/Inter-Regular.ttf src/bench/fonts/NotoSansArabic-LB.ttf src/bench/fonts/NotoSansDevanagari-LB.ttf \+ src/bench/fonts/NotoSansThai-LB.ttf src/bench/fonts/NotoSansCJKsc-LB.otf+# Inter is pinned by its SHA-256: the workloads time the shaper and paint with these exact bytes, and the+# references (apps/sysinfo/references.js) were measured with them. A new Inter fails the build here until+# LB_INTER_SHA256 is updated and the references' interface numbers are measured again (docs/BENCHMARK.md).+LB_INTER_SHA256 := 40d692fce188e4471e2b3cba937be967878f631ad3ebbbdcd587687c7ebe0c82+build/gen/lb_fonts.h: build/lbcorpus $(LB_FONTS)+ @mkdir -p build/gen+ @h=$$( (sha256sum 2>/dev/null || shasum -a 256) < ../assets/fonts/Inter-Regular.ttf | cut -c1-64); \+ [ "$$h" = "$(LB_INTER_SHA256)" ] || { echo "lord-bench: assets/fonts/Inter-Regular.ttf changed ($$h): update LB_INTER_SHA256 in mk/lordbench.mk and measure the references' cpu.ui/cpu.shape again" >&2; exit 1; }+ { echo '/* generated from the fonts in mk/lordbench.mk (LB_FONTS) by src/bench/lbcorpus.c */' && \+ ./build/lbcorpus embed lb_font_inter < ../assets/fonts/Inter-Regular.ttf && \+ ./build/lbcorpus embed lb_font_arabic < src/bench/fonts/NotoSansArabic-LB.ttf && \+ ./build/lbcorpus embed lb_font_devanagari < src/bench/fonts/NotoSansDevanagari-LB.ttf && \+ ./build/lbcorpus embed lb_font_thai < src/bench/fonts/NotoSansThai-LB.ttf && \+ ./build/lbcorpus embed lb_font_cjk < src/bench/fonts/NotoSansCJKsc-LB.otf; } > [email protected] && mv [email protected] $@++LB_SRC := src/bench/lbmain.c src/bench/lbwork.c src/bench/lbui.c src/bench/lbproto.c src/bench/bench.c src/pkg/crypto.c src/pkg/xz.c \+ src/sec/sandbox.c src/sec/cgroup.c $(ENGINE_SRC)LB_GL_SRC := $(if $(filter 1,$(GPU)),src/bench/lbgpu.c src/bench/glscene.c)LB_GL_FLAGS := $(if $(filter 1,$(GPU)),-DLORD_GPU $(shell pkg-config --cflags gbm egl glesv2))LB_GL_LIBS := $(if $(filter 1,$(GPU)),$(shell pkg-config --libs gbm egl glesv2))all: build/lord-bench-build/lord-bench: $(LB_SRC) $(LB_GL_SRC) build/obj/ui/stb.o $(QJS_OBJ) build/gen/lb_corpus.h $(wildcard src/bench/*.h) src/sec/sandbox.h src/sec/cgroup.h+build/lord-bench: $(LB_SRC) $(LB_GL_SRC) build/obj/ui/stb.o $(QJS_OBJ) build/gen/lb_corpus.h build/gen/lb_fonts.h $(wildcard src/bench/*.h) src/sec/sandbox.h src/sec/cgroup.h $(HDR)$(CC) $(CPPFLAGS) $(CFLAGS) $(LB_GL_FLAGS) $(WARN) -std=c11 -o $@ $(LB_SRC) $(LB_GL_SRC) build/obj/ui/stb.o $(QJS_OBJ) $(LB_GL_LIBS) -lm -lpthread-# the workloads (short), the record checks, the thermal guard on fake sysfs trees and the boot history+# the workloads (short; the UI scene and every paragraph's glyphs too), the record checks (the sandbox+# self-test's included), the thermal guard on fake sysfs trees and the boot historytest: build/lordbench-test-build/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 \+build/lordbench-test: tests/lordbench_test.c src/bench/lbwork.c src/bench/lbui.c src/bench/lbproto.c src/bench/lbcond.c src/bench/lbrun.c src/bench/bench.c \src/bench/lbframes.c src/bench/lbinput.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)+ build/gen/lb_fonts.h build/gen/lord_version.h $(wildcard src/bench/*.h) $(ENGINE_SRC) $(HDR)@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/bench/lbframes.c src/bench/lbinput.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+ $(CC) $(CPPFLAGS) $(CFLAGS) $(WARN) -std=c11 -o $@ tests/lordbench_test.c src/bench/lbwork.c src/bench/lbui.c src/bench/lbproto.c src/bench/lbcond.c \+ src/bench/lbrun.c src/bench/bench.c src/bench/lbframes.c src/bench/lbinput.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 \+ $(ENGINE_SRC) 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, and build/lord-media# for the video measurements; desktop mode needs a session: without one its frame results are skipped)diff --git a/server/src/bench/fonts/NotoSansArabic-LB.ttf b/server/src/bench/fonts/NotoSansArabic-LB.ttfnew file mode 100644index 0000000..0908cbcBinary files /dev/null and b/server/src/bench/fonts/NotoSansArabic-LB.ttf differdiff --git a/server/src/bench/fonts/NotoSansCJKsc-LB.otf b/server/src/bench/fonts/NotoSansCJKsc-LB.otfnew file mode 100644index 0000000..da0edc7Binary files /dev/null and b/server/src/bench/fonts/NotoSansCJKsc-LB.otf differdiff --git a/server/src/bench/fonts/NotoSansDevanagari-LB.ttf b/server/src/bench/fonts/NotoSansDevanagari-LB.ttfnew file mode 100644index 0000000..de6c920Binary files /dev/null and b/server/src/bench/fonts/NotoSansDevanagari-LB.ttf differdiff --git a/server/src/bench/fonts/NotoSansThai-LB.ttf b/server/src/bench/fonts/NotoSansThai-LB.ttfnew file mode 100644index 0000000..1b2e998Binary files /dev/null and b/server/src/bench/fonts/NotoSansThai-LB.ttf differdiff --git a/server/src/bench/fonts/OFL.txt b/server/src/bench/fonts/OFL.txtnew file mode 100644index 0000000..f5fa0ea--- /dev/null+++ b/server/src/bench/fonts/OFL.txt@@ -0,0 +1,99 @@+Noto Sans Arabic: Copyright 2015-2020 Google LLC. All Rights Reserved.+Noto Sans Devanagari: Copyright 2015 Google Inc. All Rights Reserved.+Noto Sans Thai: Copyright 2016 Google Inc. All Rights Reserved.+Noto Sans CJK SC: Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'.++The files in this folder are subsets of those fonts (Debian 13: fonts-noto-core 20201225, fonts-noto-cjk+20240730), made by tools/gen-lbfonts.py for LordBench's shaping workload (docs/BENCHMARK.md). They keep the+original names, which use no Reserved Font Name.++This Font Software is licensed under the SIL Open Font License, Version 1.1.+This license is copied below, and is also available with a FAQ at:+http://scripts.sil.org/OFL++-----------------------------------------------------------+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007+-----------------------------------------------------------++PREAMBLE+The goals of the Open Font License (OFL) are to stimulate worldwide+development of collaborative font projects, to support the font creation+efforts of academic and linguistic communities, and to provide a free and+open framework in which fonts may be shared and improved in partnership+with others.++The OFL allows the licensed fonts to be used, studied, modified and+redistributed freely as long as they are not sold by themselves. The+fonts, including any derivative works, can be bundled, embedded,+redistributed and/or sold with any software provided that any reserved+names are not used by derivative works. The fonts and derivatives,+however, cannot be released under any other type of license. The+requirement for fonts to remain under this license does not apply+to any document created using the fonts or their derivatives.++DEFINITIONS+"Font Software" refers to the set of files released by the Copyright+Holder(s) under this license and clearly marked as such. This may+include source files, build scripts and documentation.++"Reserved Font Name" refers to any names specified as such after the+copyright statement(s).++"Original Version" refers to the collection of Font Software components as+distributed by the Copyright Holder(s).++"Modified Version" refers to any derivative made by adding to, deleting,+or substituting -- in part or in whole -- any of the components of the+Original Version, by changing formats or by porting the Font Software to a+new environment.++"Author" refers to any designer, engineer, programmer, technical+writer or other person who contributed to the Font Software.++PERMISSION AND CONDITIONS+Permission is hereby granted, free of charge, to any person obtaining+a copy of the Font Software, to use, study, copy, merge, embed, modify,+redistribute, and sell modified and unmodified copies of the Font+Software, subject to the following conditions:++1) Neither the Font Software nor any of its individual components,+in Original or Modified Versions, may be sold by itself.++2) Original or Modified Versions of the Font Software may be bundled,+redistributed and/or sold with any software, provided that each copy+contains the above copyright notice and this license. These can be+included either as stand-alone text files, human-readable headers or+in the appropriate machine-readable metadata fields within text or+binary files as long as those fields can be easily viewed by the user.++3) No Modified Version of the Font Software may use the Reserved Font+Name(s) unless explicit written permission is granted by the corresponding+Copyright Holder. This restriction only applies to the primary font name as+presented to the users.++4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font+Software shall not be used to promote, endorse or advertise any+Modified Version, except to acknowledge the contribution(s) of the+Copyright Holder(s) and the Author(s) or with their explicit written+permission.++5) The Font Software, modified or unmodified, in part or in whole,+must be distributed entirely under this license, and must not be+distributed under any other license. The requirement for fonts to+remain under this license does not apply to any document created+using the Font Software.++TERMINATION+This license becomes null and void if any of the above conditions are+not met.++DISCLAIMER+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM+OTHER DEALINGS IN THE FONT SOFTWARE.diff --git a/server/src/bench/lbcorpus.c b/server/src/bench/lbcorpus.cindex fbb6712..93f49cb 100644--- a/server/src/bench/lbcorpus.c+++ b/server/src/bench/lbcorpus.c@@ -1,7 +1,8 @@/* lbcorpus.c — a build tool for LordBench's xz workload (lbwork.c, lb_xz): `lbcorpus text` writes a* fixed text of LB_CORPUS_SIZE bytes (words drawn from a fixed list with a fixed seed, so every build* gets the same one), and `lbcorpus header` turns its xz-compressed form on standard input into- * build/gen/lb_corpus.h. Runs at build time only; nothing of it ships. */+ * build/gen/lb_corpus.h. `lbcorpus embed <name>` writes standard input as a C array <name> (the fonts+ * of build/gen/lb_fonts.h, lbui.c). Runs at build time only; nothing of it ships. */#include <stdint.h>#include <stdio.h>#include <string.h>@@ -54,6 +55,16 @@ int main(int argc, char **argv) {printf("\n};\n");return n ? 0 : 1;}- fprintf(stderr, "usage: lbcorpus text | header < corpus.xz\n");+ if (argc == 3 && !strcmp(argv[1], "embed")) {+ for (const char *c = argv[2]; *c; c++)+ if (!((*c >= 'a' && *c <= 'z') || (*c >= '0' && *c <= '9') || *c == '_')) return 2;+ printf("static const unsigned char %s[] = {", argv[2]);+ int c;+ size_t n = 0;+ while ((c = getchar()) != EOF) printf("%s%d,", n++ % 24 ? "" : "\n", c);+ printf("\n};\n");+ return n ? 0 : 1;+ }+ fprintf(stderr, "usage: lbcorpus text | header < corpus.xz | embed <name> < file\n");return 2;}diff --git a/server/src/bench/lbmain.c b/server/src/bench/lbmain.cindex e8ff141..df7b21d 100644--- a/server/src/bench/lbmain.c+++ b/server/src/bench/lbmain.c@@ -5,16 +5,19 @@* most two fds lord-server opened: the GPU's render node and a scratch file for the storage test. Then,* before any work, it locks itself in with sandbox_apply_helper (sec/sandbox.c, the same as* lord-doc's and lord-media's): no network, no exec, no new files, read-only system libraries for Mesa,- * DRM ioctls only on the fd it was given. It answers only with fixed-size LbMsg records (lbproto.h);- * lord-server checks each one, watches temperatures and throttling, and kills it to stop. */+ * DRM ioctls only on the fd it was given. Right after that it checks its own lock-in (the helper-sandbox+ * self-test, sandbox_tries: things that must fail). It answers only with fixed-size LbMsg records+ * (lbproto.h); lord-server checks each one, watches temperatures and throttling, and kills it to stop. */#include "lbproto.h"#include "lbwork.h"+#include "lbui.h"#ifdef LORD_GPU#include "lbgpu.h"#endif#include "../sec/sandbox.h"#include <errno.h>+#include <fcntl.h>#include <signal.h>#include <stdio.h>#include <stdlib.h>@@ -23,6 +26,7 @@#include <sys/resource.h>#include <sys/socket.h>#include <sys/syscall.h>+#include <sys/wait.h>#include <unistd.h>#define SOCK 3@@ -51,6 +55,8 @@ static double w_sha(void *c) { Ctx *x = c; return lb_sha256(x->threads, x->secstatic double w_mat(void *c) { Ctx *x = c; return lb_matmul(x->threads, x->secs); }static double w_xz(void *c) { Ctx *x = c; return lb_xz(x->threads, x->secs); }static double w_js(void *c) { Ctx *x = c; return lb_js(x->threads, x->secs); }+static double w_ui(void *c) { Ctx *x = c; return lb_ui(x->threads, x->secs); }+static double w_shape(void *c) { Ctx *x = c; return lb_shape(x->threads, x->secs); }static double w_copy(void *c) { Ctx *x = c; return lb_mem_copy(x->threads, x->mb, x->secs); }static double w_triad(void *c) { Ctx *x = c; return lb_mem_triad(x->threads, x->mb, x->secs); }static double w_lat(void *c) { Ctx *x = c; return lb_mem_latency(x->mb, x->hops); }@@ -69,6 +75,39 @@ static void on_sample(double gflops, double t_s, void *ctx) {send_msg(LB_MSG_SAMPLE, 0, gflops, t_s);}+/* ---- the helper-sandbox self-test (lbproto.h, LB_SBX_*): each try must fail; none changes anything ---- */++static void sbx_put(int id, int refused, int err) { send_msg(LB_MSG_SANDBOX, id, refused, refused && err > 0 && err < 4096 ? err : 0); }+static void sbx_fd(int id, int fd) {+ int e = errno;+ sbx_put(id, fd < 0, e);+ if (fd >= 0) close(fd); /* it worked: an unnamed file or an unconnected socket, gone */+}++static void sandbox_tries(void) {+ errno = 0;+ sbx_fd(LB_SBX_SOCKET, socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0));+ errno = 0;+ sbx_fd(LB_SBX_INET, socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0));+ /* an invalid environment pointer: an exec the sandbox let through fails with EFAULT before anything is+ * replaced, so EFAULT means it was not refused */+ static char *const argv[] = { (char *)"/usr/bin/true", NULL };+ errno = 0;+ long r = syscall(SYS_execve, "/usr/bin/true", argv, (char *const *)1);+ int e = errno;+ sbx_put(LB_SBX_EXEC, r < 0 && e != EFAULT, e);+ errno = 0;+ pid_t pid = fork();+ e = errno;+ if (pid == 0) _exit(0);+ if (pid > 0) waitpid(pid, NULL, 0);+ sbx_put(LB_SBX_FORK, pid < 0, e);+ errno = 0;+ sbx_fd(LB_SBX_NEWFILE, open("/tmp", O_TMPFILE | O_WRONLY | O_CLOEXEC, 0600));+ errno = 0;+ sbx_fd(LB_SBX_READ, open("/etc/passwd", O_RDONLY | O_CLOEXEC));+}+static void skip_all(int from, int to, int why) {for (int id = from; id <= to; id++) send_msg(LB_MSG_SKIP, id, 0, why);}@@ -129,6 +168,7 @@ int main(int argc, char **argv) {.allow_ioctl_classes = gpu_fd >= 0 ? SANDBOX_IOCTL_DRM | SANDBOX_IOCTL_DMABUF : 0,.mem_max_mb = 2048 };int mask = sandbox_apply_helper(&cfg);+ sandbox_tries();if (go.mode == LB_MODE_LOAD) { /* desktop impact: only the load, while lord-server records frames */Sus s = { 0, 0, 0 };@@ -147,6 +187,10 @@ int main(int argc, char **argv) {measure(LB_CPU_XZN, reps, w_xz, &all);measure(LB_CPU_JS1, reps, w_js, &one);measure(LB_CPU_JSN, reps, w_js, &all);+ measure(LB_CPU_UI1, reps, w_ui, &one);+ measure(LB_CPU_UIN, reps, w_ui, &all);+ measure(LB_CPU_SHAPE1, reps, w_shape, &one);+ measure(LB_CPU_SHAPEN, reps, w_shape, &all);Ctx mem = { threads, full ? 1.5 : 0.5, full ? 128 : 32, 0 };measure(LB_MEM_COPY, reps, w_copy, &mem);measure(LB_MEM_TRIAD, reps, w_triad, &mem);diff --git a/server/src/bench/lbproto.c b/server/src/bench/lbproto.cindex a05984c..9b7babf 100644--- a/server/src/bench/lbproto.c+++ b/server/src/bench/lbproto.c@@ -9,6 +9,8 @@ static const struct { const char *name, *unit; } meas[LB_COUNT] = {[LB_CPU_MAT1] = { "cpu.matmul.1", "GFLOP/s" }, [LB_CPU_MATN] = { "cpu.matmul.n", "GFLOP/s" },[LB_CPU_XZ1] = { "cpu.xz.1", "MB/s" }, [LB_CPU_XZN] = { "cpu.xz.n", "MB/s" },[LB_CPU_JS1] = { "cpu.js.1", "runs/s" }, [LB_CPU_JSN] = { "cpu.js.n", "runs/s" },+ [LB_CPU_UI1] = { "cpu.ui.1", "fps" }, [LB_CPU_UIN] = { "cpu.ui.n", "fps" },+ [LB_CPU_SHAPE1] = { "cpu.shape.1", "runs/s" }, [LB_CPU_SHAPEN] = { "cpu.shape.n", "runs/s" },[LB_MEM_COPY] = { "mem.copy", "GB/s" }, [LB_MEM_TRIAD] = { "mem.triad", "GB/s" },[LB_MEM_LAT] = { "mem.latency", "ns" },[LB_GPU_SCENE] = { "gpu.scene", "fps" }, [LB_GPU_FILL] = { "gpu.fill", "Mpx/s" },@@ -29,7 +31,13 @@ static const struct { const char *name, *unit; } meas[LB_COUNT] = {[LB_DESK_WORK] = { "desk.work", "GFLOP/s" },};+static const char *const sbx[LB_SBX_COUNT] = {+ [LB_SBX_SOCKET] = "helperSocket", [LB_SBX_INET] = "helperInet", [LB_SBX_EXEC] = "helperExec",+ [LB_SBX_FORK] = "helperFork", [LB_SBX_NEWFILE] = "helperNewFile", [LB_SBX_READ] = "helperRead",+};+const char *lb_name(int id) { return id >= 0 && id < LB_COUNT ? meas[id].name : NULL; }+const char *lb_sbx_name(int id) { return id >= 0 && id < LB_SBX_COUNT ? sbx[id] : 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 || id == LB_COMP_P50 || id == LB_COMP_P99 || id == LB_COMP_MISSED || id == LB_COMP_IN50 ||@@ -46,6 +54,7 @@ int lb_msg_valid(const LbMsg *m) {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;+ case LB_MSG_SANDBOX: return m->id < LB_SBX_COUNT && (m->value == 0 || m->value == 1) && m->aux >= 0 && m->aux < 4096 && m->aux == (double)(int)m->aux;}return 0;}diff --git a/server/src/bench/lbproto.h b/server/src/bench/lbproto.hindex b7a53be..c418a6a 100644--- a/server/src/bench/lbproto.h+++ b/server/src/bench/lbproto.h@@ -39,6 +39,10 @@ enum {LB_CPU_XZN, /* the same on all cores, MB/s */LB_CPU_JS1, /* QuickJS running a fixed script, one core, runs/s */LB_CPU_JSN, /* the same on all cores, runs/s */+ LB_CPU_UI1, /* the UI engine's layout and paint of a fixed 1920×1080 scene, one core, frames/s (lbui.h) */+ LB_CPU_UIN, /* the same with the paint's row bands on up to 8 threads (as lord-server's paint threads), frames/s */+ LB_CPU_SHAPE1, /* shaping fixed paragraphs in five scripts (lbtext.h), one core, runs/s */+ LB_CPU_SHAPEN, /* the same on all cores, runs/s */LB_MEM_COPY, /* memory bandwidth, copy, GB/s */LB_MEM_TRIAD, /* memory bandwidth, triad, GB/s */LB_MEM_LAT, /* memory latency, a pointer chase over 64 MB, ns */@@ -90,6 +94,23 @@ enum {LB_MSG_SAMPLE, /* sustained: value = GFLOP/s of the last interval, aux = seconds since start */LB_MSG_DONE, /* the run ended; aux = the sandbox mask */LB_MSG_GPUINFO, /* value = 0 hardware, 1 virtual, 2 software (bench_gl_kind) */+ LB_MSG_SANDBOX, /* id: an LB_SBX_* try, value 1 refused (0 it worked), aux = its errno */+};++/* The helper-sandbox self-test (sec.helper-sandbox; the same tries as the Sandbox Probe's helper child,+ * app/probe.c), made by lord-bench right after sandbox_apply_helper and before any work. Every one must+ * fail, and none could change anything if it didn't: a socket or a file that opened is closed at once+ * (the file is unnamed, O_TMPFILE), exec is called with an invalid environment pointer (an exec the+ * sandbox allows fails with EFAULT before anything is replaced), and a fork that worked would only+ * _exit(0) in the child. */+enum {+ LB_SBX_SOCKET = 0, /* socket(AF_UNIX): no new sockets (a unix one could reach the session bus) */+ LB_SBX_INET, /* socket(AF_INET): no network */+ LB_SBX_EXEC, /* execve("/usr/bin/true"): no programs */+ LB_SBX_FORK, /* fork(): threads only */+ LB_SBX_NEWFILE, /* O_TMPFILE in /tmp: no writable folder */+ LB_SBX_READ, /* /etc/passwd: no files outside its read-only system folders */+ LB_SBX_COUNT};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 */@@ -101,9 +122,11 @@ typedef struct {} LbMsg;const char *lb_name(int id); /* "cpu.sha256.1", …; NULL out of range */+const char *lb_sbx_name(int id); /* "helperSocket", …; NULL out of 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 */+/* 1 if a record from lord-bench is acceptable: magic, kind, an id lord-bench measures (or a sandbox try),+ * 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 89286e0..268ae13 100644--- a/server/src/bench/lbrun.c+++ b/server/src/bench/lbrun.c@@ -107,8 +107,15 @@ typedef struct {int nsamples;double throttle_at, throttle_temp;double budget_ms, gap_max; /* desktop: the refresh period and the longest wait between frames */+ int sbx_have[LB_SBX_COUNT], sbx_refused[LB_SBX_COUNT], sbx_errno[LB_SBX_COUNT]; /* the helper-sandbox self-test */} Res;+static void put_sandbox(Res *r, const LbMsg *m) {+ r->sbx_have[m->id] = 1;+ r->sbx_refused[m->id] = m->value == 1;+ r->sbx_errno[m->id] = (int)m->aux;+}+static void cond_json(HBuf *b, const LbCond *c) {hb_printf(b, "{");if (c->temp_c > -270) hb_printf(b, "\"tempC\":%.1f,", c->temp_c);@@ -148,6 +155,14 @@ static char *build_result(const Job *j, int st, const char *why, const Res *r, chb_printf(&b, ",\"storage\":{\"kind\":\"%s\",\"mb\":%u}", storage, storage_mb);hb_printf(&b, ",\"gpuKind\":\"%s\"", r->gpu_kind == 0 ? "hardware" : r->gpu_kind == 1 ? "virtual" : r->gpu_kind == 2 ? "software" : "");hb_printf(&b, ",\"sandbox\":%d", r->sandbox);+ int any_sbx = 0;+ for (int i = 0; i < LB_SBX_COUNT; i++) any_sbx |= r->sbx_have[i];+ if (any_sbx) { /* what lord-bench tried after locking itself in: each one must be denied */+ hb_printf(&b, ",\"sandboxTries\":[");+ for (int i = 0, k = 0; i < LB_SBX_COUNT; i++) if (r->sbx_have[i])+ hb_printf(&b, "%s{\"id\":\"%s\",\"denied\":%s,\"errno\":%d}", k++ ? "," : "", lb_sbx_name(i), r->sbx_refused[i] ? "true" : "false", r->sbx_errno[i]);+ hb_printf(&b, "]");+ }if (j->extra) hb_printf(&b, ",\"session\":%s", j->extra);hb_printf(&b, ",\"results\":{");int first = 1;@@ -447,7 +462,8 @@ static void *run(void *arg) {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; }+ } else if (m.kind == LB_MSG_SANDBOX) put_sandbox(r, &m);+ 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;@@ -520,6 +536,7 @@ static void *run(void *arg) {}break;case LB_MSG_GPUINFO: r->gpu_kind = (int)m.value; break;+ case LB_MSG_SANDBOX: put_sandbox(r, &m); break;case LB_MSG_DONE: r->sandbox = (int)m.aux; finished = 1; st = ST_DONE; break;}pthread_mutex_unlock(&mu);diff --git a/server/src/bench/lbtext.h b/server/src/bench/lbtext.hnew file mode 100644index 0000000..714a747--- /dev/null+++ b/server/src/bench/lbtext.h@@ -0,0 +1,20 @@+/* lbtext.h — the fixed paragraphs of LordBench's shaping workload (lbui.c, lb_shape): one per script, each+ * with what makes that script's shaping work (Latin kerning and ligatures, Arabic joining with bidi and+ * embedded left-to-right text, Devanagari conjuncts and reordered vowel signs, Thai stacked marks, Han+ * with kana). The fonts in src/bench/fonts are subset to exactly these characters by+ * tools/gen-lbfonts.py, which reads this file: change a paragraph and run it again. Plain UTF-8 literals,+ * one per line, no escapes; they are data, not interface text (i18n-ok). */+#ifndef LORD_BENCH_LBTEXT_H+#define LORD_BENCH_LBTEXT_H++enum { LB_PARA_LATIN, LB_PARA_ARABIC, LB_PARA_DEVANAGARI, LB_PARA_THAI, LB_PARA_CJK, LB_PARA_COUNT };++static const char *const lb_paragraphs[LB_PARA_COUNT] = {+ "LordOS draws its own desktop: a compositor written in C, a React interface on its own engine, and text shaped with OpenType kerning, ligatures and marks. Waffles, office files, fjords and affine fluffy flights test fi, fl, ff and ffi; quotes, dashes and accents too: café, naïve, São Paulo, Ångström, Kraków, Dvořák, Ærø. AVATAR, Type, Wave, You. Version 0.8.6, 1920×1080 at 60 Hz, 2026-10-28.", /* i18n-ok: benchmark data */+ "يرسم LordOS سطح المكتب بنفسه: مُركِّب نوافذ مكتوب بلغة C وواجهة React على محرّكه الخاص. الإصدار 0.8.6 يقيس المعالج والذاكرة والرسوميات، ويعرض النتائج بالأرقام 1920×1080 و60 هرتز. «النص العربي» يتّصل حرفاً بحرف، مع التشكيل والأرقام ١٢٣٤ (بين قوسين) وكلمات مثل لا وللّه والسلام.", /* i18n-ok: benchmark data */+ "LordOS अपना डेस्कटॉप स्वयं बनाता है: C में लिखा गया कंपोज़िटर और अपने इंजन पर चलने वाला इंटरफ़ेस। संयुक्ताक्षर जैसे क्ष, त्र, ज्ञ, श्र, द्ध, ह्म और र्क, मात्राएँ जैसे कि, की, कु, कृ, कें और कौं, सभी सही क्रम में दिखने चाहिए। संस्करण ०.८.६ प्रोसेसर, स्मृति और ग्राफ़िक्स को मापता है।", /* i18n-ok: benchmark data */+ "LordOS วาดเดสก์ท็อปของตัวเอง ด้วยคอมโพสิเตอร์ที่เขียนด้วยภาษา C และอินเทอร์เฟซบนเอนจินของตัวเอง ข้อความภาษาไทยมีวรรณยุกต์และสระซ้อนกัน เช่น ที่นี่ น้ำ ผู้ใหญ่ กำลัง ปี่ ญี่ปุ่น ฐาน ฎีกา และเลข ๐.๘.๖ ซึ่งต้องวางตำแหน่งให้ถูกต้อง", /* i18n-ok: benchmark data */+ "LordOS 自己绘制桌面:用 C 语言编写的合成器,以及运行在自有引擎上的界面。版本 0.8.6 会测量处理器、内存和图形性能,并以数字显示结果。日本語のテキスト:ひらがな、カタカナ、漢字が混ざった文章も正しく表示されます。「括弧」と句読点。", /* i18n-ok: benchmark data */+};++#endifdiff --git a/server/src/bench/lbui.c b/server/src/bench/lbui.cnew file mode 100644index 0000000..fb780f4--- /dev/null+++ b/server/src/bench/lbui.c@@ -0,0 +1,528 @@+/* lbui.c — see lbui.h. */+#include "lbui.h"+#include "lbtext.h"+#include "lbwork.h"+#include "bench.h"+#include "lb_fonts.h"+#include "../ui/ui.h"+#include "../ui/bidi.h"+#include "../ui/shape.h"+#include "../ui/unicode.h"++#include <math.h>+#include <pthread.h>+#include <stdatomic.h>+#include <stdint.h>+#include <stdio.h>+#include <stdlib.h>+#include <string.h>++/* ---- what paint.c reaches outside the UI engine: lord-bench has no terminals, Wayland windows, media or+ * GPU path (the same stubs as tests/engine_test.c) ---- */+void term_paint(Canvas *c, int id, float x, float y, float w, float h, float op) { (void)c; (void)id; (void)x; (void)y; (void)w; (void)h; (void)op; }+void wl_paint(Canvas *c, int id, int node, float x, float y, float w, float h, float op) { (void)c; (void)id; (void)node; (void)x; (void)y; (void)w; (void)h; (void)op; }+void wl_paint_holes(int on) { (void)on; }+void wl_paint_kept(void) {}+void wl_paint_keep(void) {}+void wl_paint_begin(void) {}+void wl_paint_popups(Canvas *c) { (void)c; }+void media_paint(Canvas *c, int id, int node, float x, float y, float w, float h, float r, float op) { (void)c; (void)id; (void)node; (void)x; (void)y; (void)w; (void)h; (void)r; (void)op; }+int media_cover_node(float x0, float y0, float x1, float y1) { (void)x0; (void)y0; (void)x1; (void)y1; return 0; }+int gpu_active(void) { return 0; }++/* ---- the scene ---- */++static Node *root;+static int unknown_styles, ready;++static Node *view(Node *parent) {+ Node *n = node_new(NODE_VIEW);+ if (n && parent) node_append(parent, n);+ return n;+}+static void sn(Node *n, const char *k, double v) { if (style_set_number(&n->s, k, v)) unknown_styles++; }+static void ss(Node *n, const char *k, const char *v) { if (style_set_string(&n->s, k, v)) unknown_styles++; }+static void pad(Node *n, double v) { sn(n, "paddingLeft", v); sn(n, "paddingRight", v); sn(n, "paddingTop", v); sn(n, "paddingBottom", v); }+static Node *text(Node *parent, const char *s, double size, uint32_t color) {+ Node *t = node_new(NODE_TEXT), *r = node_new(NODE_RAW);+ node_set_text(r, s);+ node_append(t, r);+ node_append(parent, t);+ sn(t, "fontSize", size);+ sn(t, "color", color);+ return t;+}+static Node *box(Node *parent, double w, double h, double radius, uint32_t color) {+ Node *b = view(parent);+ sn(b, "width", w); sn(b, "height", h); sn(b, "borderRadius", radius); sn(b, "backgroundColor", color);+ return b;+}+static Node *window(Node *parent, double x, double y, double w, double h, uint32_t bg) {+ Node *n = view(parent);+ ss(n, "position", "absolute");+ sn(n, "left", x); sn(n, "top", y); sn(n, "width", w); sn(n, "height", h);+ sn(n, "backgroundColor", bg); sn(n, "borderRadius", 12);+ sn(n, "shadowColor", 0x59000000); sn(n, "shadowBlur", 28); sn(n, "shadowOffsetY", 10);+ ss(n, "overflow", "hidden");+ return n;+}++/* A desktop as LordOS draws it: a translucent top bar, a file manager with a sidebar and a 40-row list, a+ * settings window with a wrapped paragraph and controls, a notification and the Dock, both blurring what is+ * behind them, a rotated badge and a half-transparent card. Fixed data only, and text only in characters Inter+ * covers: anything else would make the engine look for a fallback font, by path (textlayout.c). Every weight is+ * drawn with the one built-in Inter Regular (text_init_mem). */+static void build_scene(void) {+ static const char *const words[] = { "Quarterly", "report", "holiday", "photos", "final", "version", "backup", "draft",+ "invoice", "scan", "notes", "presentation", "budget", "summary" };+ static const char *const places[] = { "Home", "Desktop", "Documents", "Downloads", "Music", "Pictures", "Videos",+ "Trash", "This computer", "Network", "USB disk", "Recent", "Starred", "Shared" };+ static const char *const menu[] = { "LordOS", "Files", "Edit", "View", "Go", "Window", "Help" };+ static const char *const labels[] = { "Wallpaper", "Accent colour", "Appearance", "Text size", "Night light", "Animations",+ "Notifications", "Sounds", "Hot corners", "Dock size" };+ static const uint32_t icon_colors[] = { 0xff0a84ff, 0xff30d158, 0xffff9f0a, 0xffff453a, 0xffbf5af2, 0xff64d2ff,+ 0xffffd60a, 0xffac8e68, 0xff5e5ce6, 0xffff375f, 0xff66d4cf, 0xff8e8e93 };+ ui_reset();+ unknown_styles = 0;+ root = view(NULL);+ ui.root = root;+ sn(root, "width", LB_UI_W); sn(root, "height", LB_UI_H);+ sn(root, "backgroundColor", 0xff2b3a4a);+ /* wallpaper shapes, so the blurs have something to blur */+ for (int i = 0; i < 6; i++) {+ Node *b = box(root, 520 - i * 40, 520 - i * 40, 260 - i * 20, icon_colors[i] & 0x80ffffff);+ ss(b, "position", "absolute");+ sn(b, "left", 80 + i * 300); sn(b, "top", 120 + (i % 3) * 260);+ }++ /* top bar */+ Node *bar = view(root);+ ss(bar, "position", "absolute");+ sn(bar, "left", 0); sn(bar, "top", 0); sn(bar, "width", LB_UI_W); sn(bar, "height", 30);+ sn(bar, "backgroundColor", 0x99202020); sn(bar, "backdropBlur", 20);+ ss(bar, "flexDirection", "row"); ss(bar, "alignItems", "center");+ sn(bar, "paddingLeft", 14); sn(bar, "paddingRight", 14); sn(bar, "gap", 18);+ for (int i = 0; i < 7; i++) { Node *t = text(bar, menu[i], 13, 0xffffffff); if (!i) sn(t, "fontWeight", 600); }+ Node *spring = view(bar);+ sn(spring, "flexGrow", 1);+ text(bar, "Wed 28 Oct 16:20", 13, 0xffffffff);++ /* the file manager */+ Node *files = window(root, 140, 80, 1180, 780, 0xfff5f5f7);+ Node *title = view(files);+ sn(title, "height", 44); ss(title, "flexDirection", "row"); ss(title, "alignItems", "center");+ sn(title, "paddingLeft", 16); sn(title, "gap", 8); sn(title, "backgroundColor", 0xffebebef);+ sn(title, "borderBottomWidth", 1); sn(title, "borderBottomColor", 0xffd4d4d8);+ box(title, 12, 12, 6, 0xffff5f57); box(title, 12, 12, 6, 0xfffebc2e); box(title, 12, 12, 6, 0xff28c840);+ Node *tt = text(title, "Documents", 14, 0xff202020);+ sn(tt, "marginLeft", 20); sn(tt, "fontWeight", 600);+ Node *body = view(files);+ sn(body, "flexGrow", 1); ss(body, "flexDirection", "row");+ Node *side = view(body);+ sn(side, "width", 220); sn(side, "backgroundColor", 0xffe6e6eb); sn(side, "paddingTop", 12); sn(side, "gap", 2);+ for (int i = 0; i < 14; i++) {+ Node *r = view(side);+ ss(r, "flexDirection", "row"); ss(r, "alignItems", "center");+ sn(r, "height", 28); sn(r, "paddingLeft", 14); sn(r, "gap", 10);+ if (i == 2) { sn(r, "backgroundColor", 0x330a84ff); sn(r, "borderRadius", 6); sn(r, "marginLeft", 6); sn(r, "marginRight", 6); }+ box(r, 16, 16, 4, icon_colors[i % 12]);+ text(r, places[i], 13, 0xff303030);+ }+ Node *main = view(body);+ sn(main, "flexGrow", 1);+ Node *tools = view(main);+ sn(tools, "height", 40); ss(tools, "flexDirection", "row"); ss(tools, "alignItems", "center");+ sn(tools, "paddingLeft", 12); sn(tools, "gap", 8); sn(tools, "borderBottomWidth", 1); sn(tools, "borderBottomColor", 0xffd8d8dc);+ for (int i = 0; i < 5; i++) { Node *b = box(tools, 28, 24, 6, 0xffffffff); sn(b, "borderWidth", 1); sn(b, "borderColor", 0xffc8c8cc); }+ Node *search = box(tools, 240, 26, 13, 0xffffffff);+ sn(search, "marginLeft", 300); sn(search, "borderWidth", 1); sn(search, "borderColor", 0xffc0c0c4);+ Node *list = view(main);+ sn(list, "flexGrow", 1); ss(list, "overflow", "hidden");+ char name[256];+ uint64_t seed = 7;+ for (int i = 0; i < 40; i++) {+ Node *row = view(list);+ ss(row, "flexDirection", "row"); ss(row, "alignItems", "center");+ sn(row, "height", 26); sn(row, "paddingLeft", 12); sn(row, "paddingRight", 12); sn(row, "gap", 8);+ if (i & 1) sn(row, "backgroundColor", 0xffededf0);+ box(row, 16, 16, 3, icon_colors[(i * 5) % 12]);+ int len = 0;+ seed = seed * 6364136223846793005ull + 1442695040888963407ull;+ int nw = 2 + (int)(seed >> 60) % 9;+ for (int k = 0; k < nw; k++) {+ seed = seed * 6364136223846793005ull + 1442695040888963407ull;+ len += snprintf(name + len, sizeof name - (size_t)len, "%s%s", k ? " " : "", words[(seed >> 33) % 14]);+ }+ snprintf(name + len, sizeof name - (size_t)len, " %d.pdf", i);+ Node *t = text(row, name, 13, 0xff202020);+ sn(t, "flexGrow", 1); sn(t, "flexShrink", 1); sn(t, "flexBasis", 0);+ ss(t, "whiteSpace", "nowrap"); ss(t, "textOverflow", "ellipsis");+ Node *size = text(row, "1.2 MB", 12, 0xff707070);+ sn(size, "width", 70); ss(size, "textAlign", "end");+ Node *date = text(row, "18 Oct 2026, 04:20", 12, 0xff707070);+ sn(date, "width", 140);+ }+ Node *status = view(main);+ sn(status, "height", 26); sn(status, "paddingLeft", 12); ss(status, "justifyContent", "center");+ sn(status, "borderTopWidth", 1); sn(status, "borderTopColor", 0xffd8d8dc);+ text(status, "40 items, 1.4 GB free", 12, 0xff707070);++ /* a settings window over it: a wrapped paragraph and a column of controls */+ Node *set = window(root, 880, 260, 640, 600, 0xffffffff);+ pad(set, 24); sn(set, "gap", 10);+ Node *st = text(set, "Appearance", 22, 0xff1c1c1e);+ sn(st, "fontWeight", 700);+ Node *para = text(set, lb_paragraphs[LB_PARA_LATIN], 13, 0xff48484a);+ sn(para, "lineHeight", 1.45);+ for (int i = 0; i < 10; i++) {+ Node *r = view(set);+ ss(r, "flexDirection", "row"); ss(r, "alignItems", "center"); sn(r, "height", 30); sn(r, "gap", 12);+ Node *l = text(r, labels[i], 13, 0xff1c1c1e);+ sn(l, "width", 150);+ Node *field = box(r, 0, 28, 6, 0xfff2f2f7);+ sn(field, "flexGrow", 1); sn(field, "borderWidth", 1); sn(field, "borderColor", 0xffc7c7cc);+ Node *tog = box(r, 44, 24, 12, i % 3 ? 0xff34c759 : 0xffd1d1d6);+ ss(tog, "flexDirection", "row"); ss(tog, "justifyContent", i % 3 ? "flex-end" : "flex-start"); pad(tog, 2);+ Node *knob = box(tog, 20, 20, 10, 0xffffffff);+ sn(knob, "shadowColor", 0x40000000); sn(knob, "shadowBlur", 3); sn(knob, "shadowOffsetY", 1);+ }++ /* a notification with blur, a half-transparent card and a rotated badge */+ Node *note = window(root, 1500, 44, 390, 110, 0xd0f8f8fa);+ sn(note, "backdropBlur", 24); sn(note, "borderRadius", 16); pad(note, 14); sn(note, "gap", 4);+ Node *nt = text(note, "LordBench", 14, 0xff1c1c1e);+ sn(nt, "fontWeight", 600);+ text(note, "Measuring the interface: layout and paint of a fixed scene, then shaping five scripts.", 13, 0xff3a3a3c);+ Node *card = window(root, 1420, 620, 420, 240, 0xff1c1c1e);+ sn(card, "opacity", 0.9); pad(card, 18); sn(card, "gap", 8);+ for (int i = 0; i < 5; i++) {+ Node *r = view(card);+ ss(r, "flexDirection", "row"); sn(r, "gap", 10); ss(r, "alignItems", "center");+ box(r, 140 - i * 18, 10, 5, icon_colors[i]);+ text(r, menu[i], 12, 0xffd0d0d0);+ }+ Node *badge = box(root, 120, 36, 18, 0xffff375f);+ ss(badge, "position", "absolute"); sn(badge, "left", 1330); sn(badge, "top", 210); sn(badge, "rotate", 8);+ ss(badge, "alignItems", "center"); ss(badge, "justifyContent", "center");+ text(badge, "New", 14, 0xffffffff);++ /* the Dock */+ Node *dock = view(root);+ ss(dock, "position", "absolute");+ sn(dock, "left", 560); sn(dock, "top", 990); sn(dock, "width", 800); sn(dock, "height", 76);+ sn(dock, "backgroundColor", 0x80ffffff); sn(dock, "borderRadius", 22); sn(dock, "backdropBlur", 24);+ ss(dock, "flexDirection", "row"); ss(dock, "alignItems", "center"); ss(dock, "justifyContent", "center"); sn(dock, "gap", 12);+ for (int i = 0; i < 12; i++) {+ Node *ic = box(dock, 52, 52, 12, icon_colors[i]);+ sn(ic, "shadowColor", 0x40000000); sn(ic, "shadowBlur", 6); sn(ic, "shadowOffsetY", 2);+ }+}++/* ---- paint threads: the same row bands as lord-server's pool (par.c), without its priority ---- */++typedef void (*BandFn)(void *ctx, int a, int b);+static struct {+ pthread_mutex_t mu;+ pthread_cond_t go, done;+ unsigned long gen;+ BandFn fn;+ void *ctx;+ int j0, n, pieces, threads, stop;+ atomic_int next, left;+ pthread_t th[LB_UI_POOL_MAX];+} pool = { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, NULL, NULL, 0, 0, 0, 1, 0, 0, 0, { 0 } };+static _Thread_local int in_pool;++static void pool_pieces(void) {+ in_pool = 1;+ for (;;) {+ int p = atomic_fetch_add(&pool.next, 1);+ if (p >= pool.pieces) break;+ int a = pool.j0 + (int)((long)pool.n * p / pool.pieces), b = pool.j0 + (int)((long)pool.n * (p + 1) / pool.pieces);+ if (b > a) pool.fn(pool.ctx, a, b);+ if (atomic_fetch_sub(&pool.left, 1) == 1) {+ pthread_mutex_lock(&pool.mu);+ pthread_cond_signal(&pool.done);+ pthread_mutex_unlock(&pool.mu);+ }+ }+ in_pool = 0;+}++/* a worker starts from the generation current when it was created, so it only takes jobs posted after it */+static void *pool_worker(void *arg) {+ unsigned long seen = (unsigned long)(uintptr_t)arg;+ for (;;) {+ pthread_mutex_lock(&pool.mu);+ while (pool.gen == seen && !pool.stop) pthread_cond_wait(&pool.go, &pool.mu);+ int stop = pool.stop;+ seen = pool.gen;+ pthread_mutex_unlock(&pool.mu);+ if (stop) return NULL;+ pool_pieces();+ }+}++static void pool_rows(int j0, int j1, BandFn fn, void *ctx) {+ if (j1 <= j0) return;+ if (pool.threads <= 1 || in_pool || j1 - j0 < 2) { fn(ctx, j0, j1); return; }+ int n = j1 - j0, pieces = pool.threads * 3;+ if (pieces > n) pieces = n;+ pthread_mutex_lock(&pool.mu);+ pool.fn = fn;+ pool.ctx = ctx;+ pool.j0 = j0;+ pool.n = n;+ pool.pieces = pieces;+ atomic_store(&pool.next, 0);+ atomic_store(&pool.left, pieces);+ pool.gen++;+ pthread_cond_broadcast(&pool.go);+ pthread_mutex_unlock(&pool.mu);+ pool_pieces();+ pthread_mutex_lock(&pool.mu);+ while (atomic_load(&pool.left) > 0) pthread_cond_wait(&pool.done, &pool.mu);+ pthread_mutex_unlock(&pool.mu);+}++static int pool_start(int threads) {+ pthread_mutex_lock(&pool.mu);+ pool.stop = 0;+ unsigned long gen = pool.gen;+ pthread_mutex_unlock(&pool.mu);+ pool.threads = 1;+ for (int i = 1; i < threads; i++) {+ if (pthread_create(&pool.th[i], NULL, pool_worker, (void *)(uintptr_t)gen)) break;+ pool.threads++;+ }+ return pool.threads == threads ? 0 : -1;+}++static void pool_stop(void) {+ pthread_mutex_lock(&pool.mu);+ pool.stop = 1;+ pthread_cond_broadcast(&pool.go);+ pthread_mutex_unlock(&pool.mu);+ for (int i = 1; i < pool.threads; i++) pthread_join(pool.th[i], NULL);+ pool.threads = 1;+ pool.gen = 0; /* no worker left: the next run starts clean */+ pool.pieces = 0;+ atomic_store(&pool.next, 0);+ atomic_store(&pool.left, 0);+}++/* ---- layout and paint ---- */++int lb_ui_init(void) {+ if (ready) return 0;+ if (text_init_mem(lb_font_inter, sizeof lb_font_inter)) return -1;+ build_scene();+ ready = 1;+ return 0;+}++static void invalidate_all(void) {+ for (int i = 0; i < ui.cap; i++) if (ui.nodes[i]) node_invalidate(ui.nodes[i]);+}++static void frame(Canvas *c) {+ invalidate_all();+ layout_root(root, LB_UI_W, LB_UI_H);+ paint_damage(root);+ ui.damage = (Box){ 0, 0, LB_UI_W, LB_UI_H };+ canvas_set_clip(c, (Rect){ 0, 0, LB_UI_W, LB_UI_H });+ canvas_clear(c, 0);+ paint_root(c, root);+ ui.damage = (Box){ 0, 0, 0, 0 };+}++double lb_ui(int threads, double secs) {+ if (lb_ui_init()) return -1;+ uint32_t *px = malloc((size_t)LB_UI_W * LB_UI_H * 4);+ if (!px) return -1;+ Canvas c;+ canvas_init(&c, px, LB_UI_W, LB_UI_H, LB_UI_W);+ int k = threads < 1 ? 1 : threads > LB_UI_POOL_MAX ? LB_UI_POOL_MAX : threads;+ double r = -1;+ if (k > 1) {+ if (pool_start(k)) goto out;+ canvas_parallel(pool_rows);+ }+ frame(&c); /* glyphs rasterized, shadow masks made: a running desktop's caches */+ double t0 = bench_now_ms(), end = t0 + secs * 1000, now;+ long frames = 0;+ do { frame(&c); frames++; now = bench_now_ms(); } while (now < end);+ r = frames * 1000.0 / (now - t0);+out:+ canvas_parallel(NULL);+ pool_stop();+ free(px);+ return r;+}++int lb_ui_check(int *nodes, int *unknown) {+ if (lb_ui_init()) return -1;+ *nodes = node_count();+ *unknown = unknown_styles;+ return 0;+}++/* ---- shaping ---- */++enum { F_LATIN, F_ARABIC, F_DEVANAGARI, F_THAI, F_CJK, F_COUNT };+static const unsigned char *const font_data[F_COUNT] = { lb_font_inter, lb_font_arabic, lb_font_devanagari, lb_font_thai, lb_font_cjk };+static const size_t font_size[F_COUNT] = { sizeof lb_font_inter, sizeof lb_font_arabic, sizeof lb_font_devanagari, sizeof lb_font_thai, sizeof lb_font_cjk };++#define PARA_MAX 1024++typedef struct {+ Otf otf[F_COUNT];+ Shaper sh;+ uint32_t cp[PARA_MAX];+ uint8_t lv[PARA_MAX], lv2[PARA_MAX];+ int scr[PARA_MAX], fnt[PARA_MAX], order[PARA_MAX];+} ShapeState;++static int script_deva = -1;++/* the font of a script that Inter (the interface font) doesn't cover, as textlayout.c's script_font() */+static int script_font(int sc) {+ if (sc == SCRIPT_ARAB) return F_ARABIC;+ if (sc == script_deva) return F_DEVANAGARI;+ if (sc == SCRIPT_THAI) return F_THAI;+ if (sc == SCRIPT_HANI || sc == SCRIPT_HIRA || sc == SCRIPT_KANA) return F_CJK;+ return -1;+}++/* marks, joiners and selectors stay with the character before them (textlayout.c) */+static int sticks_to_prev(uint32_t cp) {+ return uc_ccc(cp) || uc_ignorable(cp) || uc_bidi(cp) == BIDI_NSM || uc_join(cp) == JOIN_T || (cp >= 0x1F3FB && cp <= 0x1F3FF);+}++/* set once, before any shaping thread starts: the threads only read it */+static void shape_setup(void) {+ if (script_deva < 0) script_deva = uc_script(0x0915);+}++static ShapeState *shape_new(void) {+ ShapeState *s = calloc(1, sizeof *s);+ if (!s) return NULL;+ for (int f = 0; f < F_COUNT; f++) otf_init(&s->otf[f], font_data[f], font_size[f], 0);+ return s;+}++static void shape_del(ShapeState *s) {+ if (!s) return;+ for (int f = 0; f < F_COUNT; f++) otf_free(&s->otf[f]);+ shape_free(&s->sh);+ free(s);+}++static uint32_t utf8_next(const unsigned char **p) {+ const unsigned char *s = *p;+ uint32_t c = *s++;+ int n = c >= 0xf0 ? 3 : c >= 0xe0 ? 2 : c >= 0xc0 ? 1 : 0;+ if (n) c &= 0x3fu >> n;+ while (n-- && *s) c = c << 6 | (*s++ & 0x3f);+ *p = s;+ return c;+}++/* one paragraph, as textlayout.c's build() does its first step (one line, no wrapping): glyphs, the+ * .notdef ones and the advance in font units; -1 if it doesn't fit */+static int shape_para(ShapeState *s, int p, int *glyphs, int *notdef, long *advance) {+ int n = 0;+ for (const unsigned char *q = (const unsigned char *)lb_paragraphs[p]; *q && n < PARA_MAX;) s->cp[n++] = utf8_next(&q);+ if (n == 0 || n >= PARA_MAX) return -1;+ int para = bidi_levels(s->cp, n, -1, s->lv, NULL);+ int last = SCRIPT_COMMON;+ for (int i = 0; i < n; i++) { /* common characters take the script before them… */+ int sc = uc_script(s->cp[i]);+ if (sc <= SCRIPT_INHERITED) sc = last; else last = sc;+ s->scr[i] = sc;+ }+ for (int i = n - 1, next = SCRIPT_COMMON; i >= 0; i--) { /* …or after them, at the start */+ if (s->scr[i] <= SCRIPT_INHERITED) s->scr[i] = next; else next = s->scr[i];+ }+ /* each character's font as textlayout.c's font_for_cp(): marks with their base, common characters with+ * the font before them when it has them, then Inter, then the script's font */+ for (int i = 0; i < n; i++) {+ uint32_t c = s->cp[i];+ int f;+ if (i > 0 && sticks_to_prev(c)) f = s->fnt[i - 1];+ else if (i > 0 && uc_script(c) <= SCRIPT_INHERITED && otf_cmap(&s->otf[s->fnt[i - 1]], c)) f = s->fnt[i - 1];+ else if (otf_cmap(&s->otf[F_LATIN], c)) f = F_LATIN;+ else { f = script_font(s->scr[i]); if (f < 0 || !otf_cmap(&s->otf[f], c)) f = F_LATIN; }+ s->fnt[i] = f;+ }+ int g = 0, bad = 0;+ long adv = 0;+ for (int rs = 0; rs < n;) {+ int re = rs + 1;+ while (re < n && s->fnt[re] == s->fnt[rs] && s->scr[re] == s->scr[rs] && s->lv[re] == s->lv[rs]) re++;+ int f = s->fnt[rs];+ int k = shape_run(&s->sh, &s->otf[f], s->cp + rs, re - rs, uc_script_tag(s->scr[rs]), s->lv[rs] & 1);+ for (int j = 0; j < k; j++) {+ if (!s->sh.run.g[j]) bad++;+ if (s->sh.pos[j].att < 0) adv += s->sh.pos[j].adv;+ }+ g += k;+ rs = re;+ }+ memcpy(s->lv2, s->lv, (size_t)n);+ bidi_line(s->cp, s->lv2, 0, n, para, s->order); /* the visual order of the line */+ if (glyphs) *glyphs = g;+ if (notdef) *notdef = bad;+ if (advance) *advance = adv;+ return 0;+}++int lb_shape_check(int p, int *glyphs, int *notdef, long *advance) {+ if (p < 0 || p >= LB_PARA_COUNT) return -1;+ shape_setup();+ ShapeState *s = shape_new();+ if (!s) return -1;+ int r = shape_para(s, p, glyphs, notdef, advance);+ shape_del(s);+ return r;+}++typedef struct {+ double secs;+ double runs[256], ms[256];+ atomic_int failed;+} ShapeJob;++static void shape_thread(void *arg, int t) {+ ShapeJob *j = arg;+ ShapeState *s = shape_new();+ if (!s) { atomic_store(&j->failed, 1); return; }+ long sink = 0;+ double t0 = bench_now_ms(), end = t0 + j->secs * 1000, now;+ double runs = 0;+ do {+ for (int p = 0; p < LB_PARA_COUNT; p++) {+ long a = 0;+ if (shape_para(s, p, NULL, NULL, &a)) { atomic_store(&j->failed, 1); shape_del(s); return; }+ sink += a + s->order[0]; /* the advances and the visual order are used */+ }+ runs++;+ now = bench_now_ms();+ } while (now < end);+ j->runs[t] = runs + (sink == 0x7fffffffffffL); /* never true: keeps the work from being optimized away */+ j->ms[t] = now - t0;+ shape_del(s);+}++double lb_shape(int threads, double secs) {+ static ShapeJob j;+ memset(&j, 0, sizeof j);+ if (threads < 1) threads = 1;+ if (threads > 256) threads = 256;+ j.secs = secs;+ shape_setup();+ if (lb_parallel(threads, shape_thread, &j) < 0 || atomic_load(&j.failed)) return -1;+ double rate = 0;+ for (int i = 0; i < threads; i++) if (j.ms[i] > 0) rate += j.runs[i] * 1000.0 / j.ms[i];+ return rate;+}diff --git a/server/src/bench/lbui.h b/server/src/bench/lbui.hnew file mode 100644index 0000000..724a4ba--- /dev/null+++ b/server/src/bench/lbui.h@@ -0,0 +1,37 @@+/* lbui.h — LordBench's workloads on LordOS's own interface code (docs/BENCHMARK.md, "Workloads"): the UI+ * engine's layout and paint (ui/node.c, layout.c, paint.c, text.c, canvas.c) on a fixed scene, and the+ * shaper (ui/otf.c, shape*.c, bidi.c) on fixed paragraphs in five scripts. Everything they use is built+ * into lord-bench: the scene is made in C from fixed data, the fonts are bytes in the binary+ * (build/gen/lb_fonts.h: LordOS's Inter and the subset Noto fonts of src/bench/fonts), and nothing is+ * opened by path. Used by lord-bench (lbmain.c) and tested in tests/lordbench_test.c. */+#ifndef LORD_BENCH_LBUI_H+#define LORD_BENCH_LBUI_H++#define LB_UI_W 1920 /* the scene's size, logical pixels at scale 1 */+#define LB_UI_H 1080+#define LB_UI_POOL_MAX 8 /* paint threads at most, as lord-server's (par.c) */++/* one-time setup of the engine with the built-in interface font; 0 ok */+int lb_ui_init(void);++/* frames per second of the fixed scene: each frame lays the whole tree out again (every node+ * invalidated; the glyph and text caches stay warm, as on a running desktop) and paints the whole+ * 1920×1080 screen. threads = 1: everything on one core; threads > 1: the same frames with the paint's+ * pixel loops split in row bands over min(threads, LB_UI_POOL_MAX) threads, the way lord-server's paint+ * threads do (canvas_parallel). -1 if it could not run. */+double lb_ui(int threads, double secs);++/* runs per second of shaping the five fixed paragraphs (lbtext.h), summed over the threads; one run+ * shapes every paragraph once as the engine's text layout does (textlayout.c, its first step): bidi+ * levels, scripts with the common characters joining their neighbours, each character's font (Inter, else+ * its script's), each run of one font, script and direction shaped (GSUB and GPOS), then the visual order+ * of the paragraph as one line. Each thread has its own shaper and font tables. */+double lb_shape(int threads, double secs);++/* for the tests: shapes paragraph p once; glyphs, the glyphs with no glyph in their font (.notdef) and the+ * sum of the advances in each font's units (a checksum). 0 ok, -1 failed */+int lb_shape_check(int p, int *glyphs, int *notdef, long *advance);+/* for the tests: the nodes of the scene and the style keys the engine didn't know (must be 0) */+int lb_ui_check(int *nodes, int *unknown_styles);++#endifdiff --git a/server/src/sysreport/cli.c b/server/src/sysreport/cli.cindex 96ef7e9..b8f266e 100644--- a/server/src/sysreport/cli.c+++ b/server/src/sysreport/cli.c@@ -16,7 +16,9 @@#include "sysreport.h"#include "fetch.h"#include "lord_version.h"+#include "../bench/lbproto.h"#include "../bench/lbrun.h"+#include "../sec/sandbox.h"#include "../sec/json.h"#include <signal.h>@@ -46,11 +48,18 @@ static int usage(int fetch) {static volatile sig_atomic_t interrupted;static void on_signal(int sig) { (void)sig; interrupted = 1; }-/* One line per measurement and per skipped one, from the result JSON lbrun built. */-static void bench_print(const char *json) {+static int json_has_try(const JVal *tries, const char *name) {+ for (const JVal *t = tries->kid; t; t = t->next) { const char *id = json_str(t, "id"); if (id && !strcmp(id, name)) return 1; }+ return 0;+}++/* One line per measurement and per skipped one, from the result JSON lbrun built. Returns how many of the+ * helper-sandbox self-test's tries were not refused (a missing one counts; the file tries on a kernel without+ * Landlock don't), 0 for a result without the test. */+static int bench_print(const char *json) {JDoc d;char err[96];- if (json_parse(json, strlen(json), &d, err, sizeof err)) { puts(json); return; }+ if (json_parse(json, strlen(json), &d, err, sizeof err)) { puts(json); return 0; }const JVal *r = json_get(d.root, "result");const char *status = json_str(r, "status"), *stop = json_str(r, "stopReason");printf("LordBench %d, %s test: %s in %.0f s (LordOS %s, %s, %.0f threads)\n", (int)json_num(r, "lordbench", 0),@@ -70,7 +79,31 @@ static void bench_print(const char *json) {printf(" %-18s %s\n", m->key, m->type == J_STR ? m->str : "");}if (only_full) printf("(%d more with --full)\n", only_full);+ /* the helper-sandbox self-test lord-bench made after locking itself in: every one of the LB_SBX_COUNT tries+ * must be there and refused, as the Stability verdict checks (apps/sysinfo/perf.js) */+ const JVal *sb = json_get(r, "sandboxTries");+ int leaks = 0;+ if (sb && sb->type == J_ARR) {+ int denied[LB_SBX_COUNT] = { 0 };+ for (int i = 0; i < LB_SBX_COUNT; i++)+ for (const JVal *t = sb->kid; t; t = t->next) {+ const char *id = json_str(t, "id");+ if (id && !strcmp(id, lb_sbx_name(i))) { denied[i] = json_bool(t, "denied", 0); break; }+ }+ /* without Landlock in the kernel (no SB_LANDLOCK_FS in the mask) the two file tries are expected to work:+ * said, not counted, as the verdict only warns for them */+ int no_landlock = !((int)json_num(r, "sandbox", 0) & SB_LANDLOCK_FS), refused = 0;+ for (int i = 0; i < LB_SBX_COUNT; i++) refused += denied[i];+ printf("helper sandbox: %d of %d tries refused\n", refused, LB_SBX_COUNT);+ for (int i = 0; i < LB_SBX_COUNT; i++) {+ if (denied[i]) continue;+ int file_try = i == LB_SBX_NEWFILE || i == LB_SBX_READ;+ if (no_landlock && file_try && json_has_try(sb, lb_sbx_name(i))) printf(" allowed without Landlock: %s\n", lb_sbx_name(i));+ else { printf(" NOT REFUSED: %s\n", lb_sbx_name(i)); leaks++; }+ }+ }json_free(&d);+ return leaks;}static int bench(int full, int json) {@@ -90,11 +123,12 @@ static int bench(int full, int json) {char *p = lbrun_poll();if (!p) return 1;if (!strstr(p, "\"state\":\"waiting\"") && !strstr(p, "\"state\":\"running\"")) {+ int leaks = 0;if (json) puts(p);- else bench_print(p);+ else leaks = bench_print(p);int ok = strstr(p, "\"status\":\"done\"") != NULL;free(p);- return ok ? 0 : 1;+ return !ok ? 1 : leaks ? 3 : 0; /* 3: finished, but the helper sandbox let a try through */}const char *st = strstr(p, "\"step\":\"");if (st && isatty(2)) { /* progress on the terminal only */diff --git a/server/src/ui/text.c b/server/src/ui/text.cindex e58a47f..63b20fc 100644--- a/server/src/ui/text.c+++ b/server/src/ui/text.c@@ -58,9 +58,11 @@ static unsigned char *map_file(const char *path, size_t *size) {static unsigned be16(const unsigned char *d, size_t n, size_t off) { return off + 2 <= n ? (unsigned)(d[off] << 8 | d[off + 1]) : 0; }-static int load(Font *f, const char *path, int index) {+/* a font already in memory (mapped: munmap it if it isn't a font) */+static int load_bytes(Font *f, unsigned char *data, size_t size, int index, int mapped) {memset(f, 0, sizeof *f);- f->data = map_file(path, &f->size);+ f->data = data;+ f->size = size;if (!f->data) return -1;int off = stbtt_GetFontOffsetForIndex(f->data, index);if (off < 0) off = 0;@@ -76,15 +78,22 @@ static int load(Font *f, const char *path, int index) {f->descent = -500;} else {otf_free(&f->otf);- munmap(f->data, f->size);+ if (mapped) munmap(f->data, f->size);f->data = NULL;return -1;}- snprintf(f->path, sizeof f->path, "%s", path);f->index = index;return 0;}+static int load(Font *f, const char *path, int index) {+ size_t size = 0;+ unsigned char *data = map_file(path, &size);+ if (load_bytes(f, data, size, index, 1)) return -1;+ snprintf(f->path, sizeof f->path, "%s", path);+ return 0;+}+int text_init(const char *dir) {snprintf(font_dir, sizeof font_dir, "%s", dir);for (int i = 0; i < NFONTS; i++) {@@ -101,6 +110,19 @@ int text_init(const char *dir) {return cache ? 0 : -1;}+/* LordBench's helper (bench/lbui.c), which opens no files: one interface font built into the binary+ * fills the four Inter slots; there is no monospace or brand font (they would be opened by path). */+int text_init_mem(const unsigned char *data, size_t size) {+ for (int i = 0; i < NFONTS; i++)+ if (load_bytes(&fonts[i], (unsigned char *)data, size, 0, 0)) return -1;+ nfonts = NFONTS;+ font_dir[0] = 0;+ mono_font[0] = mono_font[1] = brand_font[0] = brand_font[1] = -1;+ cache_cap = 4096;+ cache = calloc(cache_cap, sizeof *cache);+ return cache ? 0 : -1;+}+/* Additional fonts (the terminal's, the emoji one...). If it was already loaded it returns* the same index. -1 if it couldn't. */int text_font_load(const char *path, int index) {diff --git a/server/src/ui/ui.h b/server/src/ui/ui.hindex 5bc8ac4..75ab265 100644--- a/server/src/ui/ui.h+++ b/server/src/ui/ui.h@@ -214,6 +214,8 @@ const Glyph *text_glyph_id(int font, uint32_t gid, float size);const Glyph *text_glyph_color(int font, uint32_t gid, int max_w, int max_h);void text_font_vmetrics(int font, float size, float *asc, float *desc);int text_init(const char *font_dir);+/* For LordBench's helper, which opens no files: one interface font already in memory (it must stay there) */+int text_init_mem(const unsigned char *data, size_t size);/* Weight + TEXT_MONO picks the monospaced font (JetBrains Mono) in text_measure/text_draw and in* lord.measureText: this way the font travels with the weight without changing the signatures. */#define TEXT_MONO 1000.0fdiff --git a/server/tests/lordbench_test.c b/server/tests/lordbench_test.cindex 725bc2c..26463c2 100644--- a/server/tests/lordbench_test.c+++ b/server/tests/lordbench_test.c@@ -1,11 +1,14 @@/* lordbench_test.c — LordBench without the helper process (docs/BENCHMARK.md, "0.8.6 — LordBench"): 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+ * records lord-server accepts from lord-bench and from lord-media's video measurement (and the helper-sandbox+ * self-test's), the compositor's frame statistics, short runs of every CPU, memory and storage workload (the+ * UI engine's scene and the shaper's paragraphs with every glyph in the built-in fonts), the* conditions read from fake sysfs trees (temperatures and trip points, throttle counters, the Pi's* 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/lbui.h"+#include "../src/bench/lbtext.h"#include "../src/bench/lbcond.h"#include "../src/bench/lbrun.h"#include "../src/bench/lbframes.h"@@ -78,6 +81,24 @@ int main(void) {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");+ CHECK(!strcmp(lb_name(LB_CPU_UIN), "cpu.ui.n") && !strcmp(lb_unit(LB_CPU_UI1), "fps") && !strcmp(lb_name(LB_CPU_SHAPE1), "cpu.shape.1"), "UI names");+ m = msg(LB_MSG_RESULT, LB_CPU_SHAPEN, 1200, 3);+ CHECK(lb_msg_valid(&m), "a shaping result");+ /* the helper-sandbox self-test's records */+ m = msg(LB_MSG_SANDBOX, LB_SBX_EXEC, 1, 1);+ CHECK(lb_msg_valid(&m), "a refused try");+ m = msg(LB_MSG_SANDBOX, LB_SBX_READ, 0, 0);+ CHECK(lb_msg_valid(&m), "a try that worked");+ m = msg(LB_MSG_SANDBOX, LB_SBX_COUNT, 1, 1);+ CHECK(!lb_msg_valid(&m), "a try out of range");+ m = msg(LB_MSG_SANDBOX, LB_SBX_FORK, 0.5, 1);+ CHECK(!lb_msg_valid(&m), "a try neither refused nor not");+ m = msg(LB_MSG_SANDBOX, LB_SBX_FORK, 1, 4096);+ CHECK(!lb_msg_valid(&m), "an errno out of range");+ m = msg(LB_MSG_SANDBOX, LB_SBX_FORK, 1, 1.5);+ CHECK(!lb_msg_valid(&m), "a fractional errno");+ for (int i = 0; i < LB_SBX_COUNT; i++) CHECK(lb_sbx_name(i) && !strncmp(lb_sbx_name(i), "helper", 6), "try names %d", i);+ CHECK(!lb_sbx_name(LB_SBX_COUNT) && !lb_sbx_name(-1) && !strcmp(lb_sbx_name(LB_SBX_FORK), "helperFork"), "try names out of range");/* ---- lord-media's video records ---- */CHECK(lbv_record_valid(VB_HEVC_2160, VBR_RESULT, 24500, 300, 0), "a video result");@@ -185,6 +206,22 @@ int main(void) {CHECK((v = lb_xz(1, 0.1)) > 1, "xz %f", v);CHECK((v = lb_js(1, 0.2)) > 0.5, "js %f", v);CHECK((v = lb_js(2, 0.2)) > 0.5, "js x2 %f", v);+ /* the UI engine's scene: every style key known, then frames on one thread and with the paint bands */+ int nodes = 0, unknown = -1;+ CHECK(lb_ui_check(&nodes, &unknown) == 0 && nodes > 400 && unknown == 0, "scene: %d nodes, %d unknown styles", nodes, unknown);+ CHECK((v = lb_ui(1, 0.3)) > 0.5, "ui %f", v);+ CHECK((v = lb_ui(4, 0.3)) > 0.5, "ui x4 %f", v);+ /* the shaper: each paragraph shapes to real glyphs of its built-in fonts (none missing: the subsets cover+ * them), the same every time */+ for (int p = 0; p < LB_PARA_COUNT; p++) {+ int g = 0, bad = -1, g2 = 0, bad2 = -1;+ long adv = 0, adv2 = 0;+ CHECK(lb_shape_check(p, &g, &bad, &adv) == 0 && g > 80 && bad == 0 && adv > 0, "paragraph %d: %d glyphs, %d missing, advance %ld", p, g, bad, adv);+ CHECK(lb_shape_check(p, &g2, &bad2, &adv2) == 0 && g2 == g && bad2 == bad && adv2 == adv, "paragraph %d shapes the same twice", p);+ }+ CHECK(lb_shape_check(LB_PARA_COUNT, NULL, NULL, NULL) == -1, "a paragraph out of range");+ CHECK((v = lb_shape(1, 0.2)) > 1, "shape %f", v);+ CHECK((v = lb_shape(2, 0.2)) > 1, "shape x2 %f", v);CHECK((v = lb_mem_copy(2, 8, 0.1)) > 0.05, "copy %f", v);CHECK((v = lb_mem_triad(2, 8, 0.1)) > 0.05, "triad %f", v);CHECK((v = lb_mem_latency(8, 200000)) > 0.1 && v < 10000, "latency %f", v);diff --git a/server/tests/sysinfo_perf_test.mjs b/server/tests/sysinfo_perf_test.mjsindex 0a4d871..130d990 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, DESKTOP_CATEGORIES, desktopVerdict, REFERENCES, ratio, categoryRatios, comparableReferences, stability, compatibilityVerdict, conditionDiffs, changes, sustainedSeries, refreshBudget, fileName } from '../../apps/sysinfo/perf.js';+import { CATEGORIES, DESKTOP_CATEGORIES, SANDBOX_TRIES, ENGINE_IDS, 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) => {@@ -23,10 +23,17 @@ const ref = { lordbench: 1, results: { 'cpu.sha256.1': { value: 100 }, 'cpu.matm// 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('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);+eq('32 measurements, no repeats', [ids.length, new Set(ids).size], [32, 32]);+eq('references have every measurement or say it was not measured', REFERENCES.every((r) => ids.every((id) => (r.results[id] && r.results[id].value > 0) !== (r.notMeasured || []).includes(id))), true);near('×2 SHA', ratio(res(), ref, 'cpu.sha256.1'), 2);+// the engine's own workloads compare only within one LordOS version+const engRef = { lordbench: 1, results: { 'cpu.ui.1': { value: 20, lordos: '0.8.6' }, 'cpu.sha256.1': { value: 50 } } };+const engRes = (v) => res({ lordos: v, results: { 'cpu.ui.1': { value: 40 }, 'cpu.sha256.1': { value: 100 } } });+near('engine id, same version', ratio(engRes('0.8.6'), engRef, 'cpu.ui.1'), 2);+eq('engine id, another version: no ×N', ratio(engRes('0.8.7'), engRef, 'cpu.ui.1'), null);+near('other ids ignore the version', ratio(engRes('0.8.7'), engRef, 'cpu.sha256.1'), 2);+eq('every engine id of a reference carries its version', REFERENCES.every((r) => ENGINE_IDS.every((id) => !r.results[id] || typeof r.results[id].lordos === 'string')), true);near('latency: lower is better', ratio(res(), ref, 'mem.latency'), 2);eq('missing on one side', ratio(res(), ref, 'gpu.scene'), null);const cr = categoryRatios(res(), ref);@@ -43,6 +50,18 @@ eq('Pi throttling and under-voltage', stability(res({ after: { rpiThrottled: 0x5eq('Pi: only past events', stability(res({ after: { rpiThrottled: 0x50000 } })).state, 'pass');eq('sustained dropped 20 %', stability(res({ results: { 'sustained.start': { value: 50 }, 'sustained.end': { value: 40 } } })).notes, [{ id: 'sustainedDrop', vars: { pct: 20 } }]);eq('not quiet', stability(res({ quiet: { quiet: false, busyPct: 37.4 } })).notes, [{ id: 'notQuiet', vars: { pct: 37 } }]);+// the helper-sandbox self-test+const tries = (over = {}) => SANDBOX_TRIES.map((id) => ({ id, denied: over[id] == null ? true : over[id], errno: 1 }));+eq('every try refused: said, still a pass', stability(res({ sandboxTries: tries() })), { state: 'pass', notes: [{ id: 'sandboxHeld', vars: { count: 6 }, info: true }] });+eq('a try that worked fails the run', stability(res({ sandboxTries: tries({ helperExec: false }) })), { state: 'fail', notes: [{ id: 'sandboxLeaks', vars: { ids: ['helperExec'] } }] });+eq('a missing try counts as not refused', stability(res({ sandboxTries: tries().filter((t) => t.id !== 'helperRead') })).notes[0].vars.ids, ['helperRead']);+// without Landlock (mask SB_SECCOMP|SB_NOPRIV|SB_NOCAPS, no SB_LANDLOCK_FS) the file tries only warn+const noLl = { sandbox: 8 | 16 | 32, sandboxTries: tries({ helperNewFile: false, helperRead: false }) };+eq('no Landlock: the file tries warn', stability(res(noLl)), { state: 'warn', notes: [{ id: 'sandboxPartial', vars: { ids: ['helperNewFile', 'helperRead'] } }] });+eq('no Landlock: exec still fails', stability(res({ ...noLl, sandboxTries: tries({ helperNewFile: false, helperExec: false }) })).state, 'fail');+eq('with Landlock: a file try fails', stability(res({ sandbox: 2 | 8 | 16 | 32, sandboxTries: tries({ helperRead: false }) })).state, 'fail');+eq('no Landlock: a missing file try still fails', stability(res({ sandbox: 8, sandboxTries: tries().filter((t) => t.id !== 'helperRead') })).state, 'fail');+eq('older results have no self-test', stability(res()).notes, []);eq('a measurement failed', stability(res({ skipped: { 'gpu.scene': 'failed', 'disk.seqread': 'mode' } })).notes, [{ id: 'measureFailed', vars: { count: 1 } }]);eq('compatibility: limits warn', compatibilityVerdict([{ state: 'works' }, { state: 'limits' }, { state: 'absent' }]),diff --git a/tools/gen-lbfonts.py b/tools/gen-lbfonts.pynew file mode 100644index 0000000..29ac4e4--- /dev/null+++ b/tools/gen-lbfonts.py@@ -0,0 +1,82 @@+#!/usr/bin/env python3+"""gen-lbfonts.py - the fonts of LordBench's shaping workload (server/src/bench/lbui.c, docs/BENCHMARK.md).++lord-bench opens no files, so the fonts it shapes with are built into it (build/gen/lb_fonts.h, made by the+Makefile from server/src/bench/fonts). The Latin one is LordOS's own Inter (assets/fonts); the others are+Debian 13's Noto fonts subset to exactly the characters of the paragraphs in server/src/bench/lbtext.h,+keeping every OpenType layout feature and lookup those characters can reach, so the shaper gives the same+glyphs and positions it gives with the full font on that text. It is not the same work: the subsets have+smaller coverage tables and fewer lookups, and shape about 12 % faster than the full fonts (VM 116), so the+workload is comparable only with itself. Run it by hand when a paragraph changes (it is not part of+the build; needs fontTools, `pip install fonttools`, and the packages fonts-noto-core and fonts-noto-cjk):++ python3 tools/gen-lbfonts.py [--fonts DIR]++DIR defaults to /usr/share/fonts and must hold truetype/noto/NotoSans{Arabic,Devanagari,Thai}-Regular.ttf+and opentype/noto/NotoSansCJK-Regular.ttc (face 2, Simplified Chinese). The results are committed: every+build, on every machine, shapes with the same bytes.+"""+import argparse+import os+import re+import sys+import unicodedata++from fontTools import subset+from fontTools.ttLib import TTFont++ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+TEXT = os.path.join(ROOT, 'server', 'src', 'bench', 'lbtext.h')+OUT = os.path.join(ROOT, 'server', 'src', 'bench', 'fonts')++# (output, source relative to --fonts, face index in a collection)+FONTS = [+ ('NotoSansArabic-LB.ttf', 'truetype/noto/NotoSansArabic-Regular.ttf', 0),+ ('NotoSansDevanagari-LB.ttf', 'truetype/noto/NotoSansDevanagari-Regular.ttf', 0),+ ('NotoSansThai-LB.ttf', 'truetype/noto/NotoSansThai-Regular.ttf', 0),+ ('NotoSansCJKsc-LB.otf', 'opentype/noto/NotoSansCJK-Regular.ttc', 2),+]+++def paragraphs():+ src = open(TEXT, encoding='utf-8').read()+ body = src[src.index('lb_paragraphs'):]+ body = body[body.index('{') + 1:body.index('};')]+ out = re.findall(r'"([^"\\]*)"', body)+ if len(out) != 5:+ sys.exit(f'gen-lbfonts: expected 5 paragraphs in {TEXT}, found {len(out)}')+ return out+++def main():+ ap = argparse.ArgumentParser()+ ap.add_argument('--fonts', default='/usr/share/fonts')+ args = ap.parse_args()+ text = ''.join(paragraphs())+ # and what the shaper may turn them into: canonical and compatibility decompositions (Thai SARA AM is+ # shaped as NIKHAHIT + SARA AA, shape.c)+ text += unicodedata.normalize('NFD', text) + unicodedata.normalize('NFKD', text)+ chars = sorted({ord(c) for c in text})+ os.makedirs(OUT, exist_ok=True)+ for name, rel, index in FONTS:+ opts = subset.Options()+ opts.layout_features = ['*'] # every feature: the shaper picks what its script needs+ opts.layout_scripts = ['*']+ opts.name_IDs = ['*'] # keep the copyright, licence and version records+ opts.name_languages = ['*']+ opts.name_legacy = True+ opts.notdef_outline = True+ opts.hinting = False # shaping doesn't use hinting+ opts.font_number = index+ font = subset.load_font(os.path.join(args.fonts, rel), opts)+ sub = subset.Subsetter(opts)+ sub.populate(unicodes=chars)+ sub.subset(font)+ dst = os.path.join(OUT, name)+ subset.save_font(font, dst, opts)+ kept = TTFont(dst)+ print(f'{name}: {os.path.getsize(dst)} bytes, {kept["maxp"].numGlyphs} glyphs')+++if __name__ == '__main__':+ main()diff --git a/web/content/faq/faq.json b/web/content/faq/faq.jsonindex a737be8..e7b3804 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, 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, and how fast the pointer reaches the screen, 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). What that desktop test found is already fixed in 0.8.6: the compositor gets more CPU weight than any app and the lowest real-time priority, so the desktop no longer waits behind a busy app (on the reference virtual machine it measures as without load); on a Raspberry Pi 5 a busy app still takes it from 60 to about 30 frames a second, which is being worked on.",- "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, y cuánto tarda el puntero en llegar a la pantalla, 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). Lo que encontró esa prueba de escritorio ya está corregido en la 0.8.6: el compositor recibe más peso de CPU que cualquier app y la menor prioridad de tiempo real, así que el escritorio ya no espera detrás de una app ocupada (en la máquina virtual de referencia mide igual que sin carga); en una Raspberry Pi 5 una app ocupada todavía lo baja de 60 a unos 30 cuadros por segundo, y en eso se está trabajando.",- "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, e quanto o ponteiro demora para chegar à tela, 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). O que esse teste de desktop encontrou já está corrigido na 0.8.6: o compositor recebe mais peso de CPU que qualquer app e a menor prioridade de tempo real, então o desktop não espera mais atrás de um app ocupado (na máquina virtual de referência mede igual a sem carga); num Raspberry Pi 5 um app ocupado ainda o baixa de 60 para uns 30 quadros por segundo, e isso está sendo trabalhado."+ "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, and of LordOS's own interface work (laying out and drawing a desktop scene, and shaping text in five scripts), run in an isolated helper that checks its own sandbox first and 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, and how fast the pointer reaches the screen, 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). What that desktop test found is already fixed in 0.8.6: the compositor gets more CPU weight than any app and the lowest real-time priority, so the desktop no longer waits behind a busy app (on the reference virtual machine it measures as without load); on a Raspberry Pi 5 a busy app still takes it from 60 to about 30 frames a second, which is being worked on.",+ "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, y del propio trabajo de la interfaz de LordOS (el diseño y dibujo de una escena de escritorio y la composición de texto en cinco escrituras), que corre en un ayudante aislado que primero comprueba su propio aislamiento y 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, y cuánto tarda el puntero en llegar a la pantalla, 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). Lo que encontró esa prueba de escritorio ya está corregido en la 0.8.6: el compositor recibe más peso de CPU que cualquier app y la menor prioridad de tiempo real, así que el escritorio ya no espera detrás de una app ocupada (en la máquina virtual de referencia mide igual que sin carga); en una Raspberry Pi 5 una app ocupada todavía lo baja de 60 a unos 30 cuadros por segundo, y en eso se está trabajando.",+ "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, e do próprio trabalho da interface do LordOS (o layout e o desenho de uma cena de desktop e a composição de texto em cinco escritas), executado num auxiliar isolado que primeiro verifica o próprio isolamento e 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, e quanto o ponteiro demora para chegar à tela, 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). O que esse teste de desktop encontrou já está corrigido na 0.8.6: o compositor recebe mais peso de CPU que qualquer app e a menor prioridade de tempo real, então o desktop não espera mais atrás de um app ocupado (na máquina virtual de referência mede igual a sem carga); num Raspberry Pi 5 um app ocupado ainda o baixa de 60 para uns 30 quadros por segundo, e isso está sendo trabalhado."}}]diff --git a/web/content/paper/paper.en.md b/web/content/paper/paper.en.mdindex a4caf16..d2bdd58 100644--- a/web/content/paper/paper.en.md+++ b/web/content/paper/paper.en.md@@ -488,7 +488,7 @@ The Raspberry Pi 5 is the only supported board. Results on a real board (16 GB,### 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; it also measures software video decoding and the remote desktop's encoders, the desktop's frame times and the time from a pointer move to the screen, alone and under a low-priority load, and boot time over several restarts; it also runs from a terminal (`lordos-sysreport bench`). The references are a virtual machine and a Raspberry Pi 5 (§7.4); hardware video decoding and a real PC reference are not built yet.+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 and the time from a pointer move to the screen, alone and under a low-priority load, and boot time over several restarts; it also runs from a terminal (`lordos-sysreport bench`). Also in development, it times LordOS's own interface work with the engine's real code (the layout and paint of a fixed full-HD desktop scene, and the shaping of paragraphs in Latin, Arabic, Devanagari, Thai and Chinese with fonts built into the helper, which opens no files; on the reference virtual machine 37 frames per second on one core and 40 with the paint threads, 619 shaping runs per second on one core and 3,595 on eight), compared with a reference only when it was measured with the same LordOS version, and `lord-bench` checks its own sandbox before any work: six things it must not be able to do (open a local socket or a network connection, run a program, start a process, create a file, read a system file) were all refused on that machine, and a run where one gets through is marked unstable. The references are a virtual machine and a Raspberry Pi 5 (§7.4); hardware video decoding and a real PC reference are not built yet.### Source filesdiff --git a/web/content/paper/paper.es.md b/web/content/paper/paper.es.mdindex cc3a5c0..db26b40 100644--- a/web/content/paper/paper.es.md+++ b/web/content/paper/paper.es.md@@ -488,7 +488,7 @@ La Raspberry Pi 5 es la única placa soportada. Resultados en una placa real (16### 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; también mide la decodificación de video por software y los codificadores del escritorio remoto, los tiempos de cuadro del escritorio y el tiempo de un movimiento del puntero hasta la pantalla, solo y bajo una carga de baja prioridad, y el tiempo de arranque en varios reinicios; también corre desde una terminal (`lordos-sysreport bench`). Las referencias son una máquina virtual y una Raspberry Pi 5 (§7.4); la decodificación de video por hardware y una referencia de PC real todavía 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 y el tiempo de un movimiento del puntero hasta la pantalla, solo y bajo una carga de baja prioridad, y el tiempo de arranque en varios reinicios; también corre desde una terminal (`lordos-sysreport bench`). También en desarrollo, mide el trabajo de la propia interfaz de LordOS con el código real del motor (el diseño y dibujo de una escena de escritorio fija en full HD, y la composición tipográfica de párrafos en latín, árabe, devanagari, tailandés y chino con fuentes incluidas en el ayudante, que no abre archivos; en la máquina virtual de referencia 37 cuadros por segundo en un núcleo y 40 con los hilos de dibujo, 619 pasadas de composición por segundo en un núcleo y 3.595 en ocho), comparado con una referencia solo si se midió con la misma versión de LordOS, y `lord-bench` comprueba su propio aislamiento antes de cualquier trabajo: seis cosas que no debe poder hacer (abrir un socket local o una conexión de red, ejecutar un programa, iniciar un proceso, crear un archivo, leer un archivo del sistema) fueron todas rechazadas en esa máquina, y una prueba en la que alguna pase se marca como inestable. Las referencias son una máquina virtual y una Raspberry Pi 5 (§7.4); la decodificación de video por hardware y una referencia de PC real todavía no están construidas.### Archivos fuentediff --git a/web/content/paper/paper.pt.md b/web/content/paper/paper.pt.mdindex 2324521..1181f41 100644--- a/web/content/paper/paper.pt.md+++ b/web/content/paper/paper.pt.md@@ -488,7 +488,7 @@ O Raspberry Pi 5 é a única placa suportada. Resultados numa placa real (16 GB,### 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; 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 e o tempo de um movimento do ponteiro até a tela, sozinho e sob uma carga de baixa prioridade, e o tempo de boot em várias reinicializações; também roda a partir de um terminal (`lordos-sysreport bench`). As referências são uma máquina virtual e um Raspberry Pi 5 (§7.4); a decodificação de vídeo por hardware e uma referência de PC real ainda 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 e o tempo de um movimento do ponteiro até a tela, sozinho e sob uma carga de baixa prioridade, e o tempo de boot em várias reinicializações; também roda a partir de um terminal (`lordos-sysreport bench`). Também em desenvolvimento, mede o trabalho da própria interface do LordOS com o código real do motor (o layout e o desenho de uma cena de desktop fixa em full HD, e a composição tipográfica de parágrafos em latim, árabe, devanágari, tailandês e chinês com fontes embutidas no auxiliar, que não abre arquivos; na máquina virtual de referência 37 quadros por segundo em um núcleo e 40 com as threads de desenho, 619 passagens de composição por segundo em um núcleo e 3.595 em oito), comparado com uma referência só quando medido com a mesma versão do LordOS, e o `lord-bench` verifica o próprio isolamento antes de qualquer trabalho: seis coisas que não deve conseguir fazer (abrir um socket local ou uma conexão de rede, executar um programa, iniciar um processo, criar um arquivo, ler um arquivo do sistema) foram todas recusadas nessa máquina, e um teste em que alguma passe é marcado como instável. As referências são uma máquina virtual e um Raspberry Pi 5 (§7.4); a decodificação de vídeo por hardware e uma referência de PC real ainda não estão construídas.### Arquivos-fonte