@openmixer/plugin-qualify 0.17.5 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +127 -13
  2. package/bin/plugin-qualify-sync.mjs +3 -1
  3. package/dist/clap-qualify.d.ts +3 -1
  4. package/dist/clap-qualify.js +7 -1
  5. package/dist/clap-qualify.js.map +1 -1
  6. package/dist/direct-limit.d.ts +27 -0
  7. package/dist/direct-limit.js +52 -0
  8. package/dist/direct-limit.js.map +1 -0
  9. package/dist/distributed-records.d.ts +4 -2
  10. package/dist/distributed-records.js +1 -1
  11. package/dist/distributed-records.js.map +1 -1
  12. package/dist/host-admission.d.ts +12 -2
  13. package/dist/host-admission.js +24 -4
  14. package/dist/host-admission.js.map +1 -1
  15. package/dist/host-profiles.d.ts +8 -0
  16. package/dist/host-profiles.js +16 -1
  17. package/dist/host-profiles.js.map +1 -1
  18. package/dist/hosting-codes.generated.d.ts +10 -0
  19. package/dist/hosting-codes.generated.js +10 -0
  20. package/dist/hosting-codes.generated.js.map +1 -1
  21. package/dist/hosting-suitability.d.ts +34 -8
  22. package/dist/hosting-suitability.js +92 -7
  23. package/dist/hosting-suitability.js.map +1 -1
  24. package/dist/index.d.ts +3 -0
  25. package/dist/index.js +3 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/measurement/format.d.ts +54 -8
  28. package/dist/measurement/format.js +54 -3
  29. package/dist/measurement/format.js.map +1 -1
  30. package/dist/measurement/plan.d.ts +3 -3
  31. package/dist/measurement/plan.js +1 -1
  32. package/dist/measurement-grid.d.ts +8 -0
  33. package/dist/measurement-grid.js +4 -0
  34. package/dist/measurement-grid.js.map +1 -1
  35. package/dist/memory-bound.d.ts +6 -0
  36. package/dist/memory-bound.js +8 -0
  37. package/dist/memory-bound.js.map +1 -1
  38. package/dist/memory-budget.d.ts +39 -0
  39. package/dist/memory-budget.js +32 -0
  40. package/dist/memory-budget.js.map +1 -0
  41. package/dist/probe-judge.d.ts +11 -0
  42. package/dist/probe-judge.js +26 -10
  43. package/dist/probe-judge.js.map +1 -1
  44. package/dist/probe-merge.js +6 -5
  45. package/dist/probe-merge.js.map +1 -1
  46. package/dist/probe-output-fixtures.d.ts +6 -0
  47. package/dist/probe-output-fixtures.js +8 -0
  48. package/dist/probe-output-fixtures.js.map +1 -1
  49. package/dist/probe-output.d.ts +4 -2
  50. package/dist/probe-output.js +2 -1
  51. package/dist/probe-output.js.map +1 -1
  52. package/dist/probe-runner.js +7 -3
  53. package/dist/probe-runner.js.map +1 -1
  54. package/dist/qualification-record.d.ts +116 -10
  55. package/dist/qualification-record.js +34 -30
  56. package/dist/qualification-record.js.map +1 -1
  57. package/dist/qualify-adapter-pass.d.ts +67 -0
  58. package/dist/qualify-adapter-pass.js +255 -0
  59. package/dist/qualify-adapter-pass.js.map +1 -0
  60. package/dist/qualify-declarations.d.ts +53 -9
  61. package/dist/qualify-declarations.js +54 -2
  62. package/dist/qualify-declarations.js.map +1 -1
  63. package/dist/qualify-rejudge.d.ts +81 -0
  64. package/dist/qualify-rejudge.js +421 -0
  65. package/dist/qualify-rejudge.js.map +1 -0
  66. package/dist/qualify-sync.d.ts +72 -1
  67. package/dist/qualify-sync.js +194 -21
  68. package/dist/qualify-sync.js.map +1 -1
  69. package/fixtures/records-0.16.1/http___example.org_raffo@unversioned-2060c09ff626.default.probe.json +46 -0
  70. package/fixtures/records-0.16.1/http___example.org_raffo@unversioned-2060c09ff626.default.qualification.json +185 -0
  71. package/fixtures/records-0.16.1/http___lv2plug.in_plugins_eg-amp@unversioned-f046a60efd45.default.probe.json +51 -0
  72. package/fixtures/records-0.16.1/http___lv2plug.in_plugins_eg-amp@unversioned-f046a60efd45.default.qualification.json +232 -0
  73. package/fixtures/records-0.16.1/https___github.com_lucianodato_noise-repellent@unversioned-c3b5e21dd9a7.default.probe.json +51 -0
  74. package/fixtures/records-0.16.1/https___github.com_lucianodato_noise-repellent@unversioned-c3b5e21dd9a7.default.qualification.json +245 -0
  75. package/fixtures/records-0.16.1/in.lsp-plug.impulse_responses_mono@unversioned-d5235d2f5f53.custom.probe.json +52 -0
  76. package/fixtures/records-0.16.1/in.lsp-plug.impulse_responses_mono@unversioned-d5235d2f5f53.custom.qualification.json +145 -0
  77. package/fixtures/records-0.16.1/in.lsp-plug.trigger_midi_mono@unversioned-d5235d2f5f53.custom.probe.json +52 -0
  78. package/fixtures/records-0.16.1/in.lsp-plug.trigger_midi_mono@unversioned-d5235d2f5f53.custom.qualification.json +155 -0
  79. package/package.json +1 -1
  80. package/src/clap-qualify.ts +8 -1
  81. package/src/direct-limit.ts +68 -0
  82. package/src/distributed-records.ts +1 -1
  83. package/src/host-admission.ts +27 -4
  84. package/src/host-profiles.ts +17 -1
  85. package/src/hosting-codes.generated.ts +10 -0
  86. package/src/hosting-suitability.ts +105 -11
  87. package/src/index.ts +3 -0
  88. package/src/measurement/format.ts +97 -3
  89. package/src/measurement/plan.ts +3 -3
  90. package/src/measurement-grid.ts +5 -0
  91. package/src/memory-bound.ts +10 -0
  92. package/src/memory-budget.ts +55 -0
  93. package/src/probe-judge.ts +29 -9
  94. package/src/probe-merge.ts +6 -5
  95. package/src/probe-output-fixtures.ts +10 -1
  96. package/src/probe-output.ts +5 -2
  97. package/src/probe-runner.ts +5 -3
  98. package/src/qualification-record.ts +121 -18
  99. package/src/qualify-adapter-pass.ts +278 -0
  100. package/src/qualify-declarations.ts +67 -3
  101. package/src/qualify-rejudge.ts +452 -0
  102. package/src/qualify-sync.ts +210 -20
  103. package/tools/_declarations.py +1 -0
  104. package/tools/benchmark.py +25 -2
  105. package/tools/gen-python-declarations.mjs +1 -0
  106. package/tools/lv2-measure.mjs +7 -4
  107. package/tools/lv2_presets.py +1 -1
  108. package/tools/lv2_resolve.py +49 -0
  109. package/tools/mod-host-admit.mjs +23 -6
@@ -0,0 +1,255 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ // Copyright (C) 2026 Pau Aliagas <linuxnow@gmail.com>
3
+ /**
4
+ * `plugin-qualify-sync --adapter-only`: an LV2 plugin's verdict on omx-clap-host is decided by its run under plugin-hostd's
5
+ * LV2 adapter, and a record without one owes it (`qualify-rejudge.ts`). This pass makes only that run, for each plugin, at
6
+ * each cell a Pi runs, and puts the block in the record; every other figure stays as it was, and `--rejudge` reads it.
7
+ *
8
+ * Each cell has a private JACK server of its own (`jackd -d dummy`, the rate and quantum on its command line), so that the
9
+ * run can never reach the device's live server (plugin-qualify#187), and each run a fresh host, its time limited by
10
+ * `budget_s` a command and its address space by the limit of a direct spawn. A crash or a timeout is the plugin's recorded
11
+ * outcome. A pass does not start without the versions of the hosts it runs, or without a private server: nothing it could
12
+ * write would say what it measured. A plugin is finished when its block was taken at these host versions at every cell,
13
+ * so a pass cut short can be run again; a host that could not be run decides nothing, and that plugin is tried again.
14
+ */
15
+ import { spawn, spawnSync } from "node:child_process";
16
+ import { existsSync, mkdtempSync, readFileSync, readdirSync, rmSync } from "node:fs";
17
+ import { tmpdir } from "node:os";
18
+ import { basename, join } from "node:path";
19
+ import { ADAPTER_HOST, SPAWNED_ADMISSIONS, admitUnderAdapter } from "./host-admission.js";
20
+ import { HOSTD_ENV } from "./hostd-pin-files.js";
21
+ import { cellKey } from "./measurement-grid.js";
22
+ import { defaultAddressSpaceLimit } from "./direct-limit.js";
23
+ import { PROBE_OK } from "./probe-output.js";
24
+ import { QUALIFICATION_RECORD_SCHEMA } from "./qualification-record.js";
25
+ import { ADMIT_ADDRESS_KB_ENV, ADMIT_STATE_DIR_ENV, ADMIT_STEP_MS_ENV, PI_CELLS } from "./qualify-declarations.js";
26
+ import { digestFiles } from "./qualify-sync.js";
27
+ import { writeFileWhole } from "./whole-file.js";
28
+ /** The cells the pass runs at: the ones a Pi runs. */
29
+ export const ADAPTER_PASS_CELLS = PI_CELLS;
30
+ /** The code of a cell no private server could be had for: the run did not happen. */
31
+ export const NO_PRIVATE_SERVER = `${ADAPTER_HOST}.no-private-server`;
32
+ const RECORD_SUFFIX = ".qualification.json";
33
+ const SERVER_WAIT_MS = 5000;
34
+ const SERVER_SETTLE_MS = 300;
35
+ const SERVER_STOP_MS = 2000;
36
+ /** What a program answers to `--version`: its last word on the line that says `version`. */
37
+ export function parseVersion(text) {
38
+ return /version:?\s+(\S+)/.exec(text)?.[1];
39
+ }
40
+ const spawnVersion = (tool) => {
41
+ const r = spawnSync(tool, ["--version"], { encoding: "utf8", timeout: 10000, killSignal: "SIGKILL" });
42
+ return { status: r.status, stdout: `${r.stdout ?? ""}\n${r.stderr ?? ""}` };
43
+ };
44
+ /** The versions of the hosts as installed now, or which of them could not say. */
45
+ export function hostVersions(env, run = spawnVersion) {
46
+ const versions = {};
47
+ for (const [name, tool] of [[ADAPTER_HOST, ADAPTER_HOST], ["plugin-hostd", env[HOSTD_ENV] ?? "plugin-hostd"]]) {
48
+ const r = run(tool);
49
+ const version = r.status === 0 ? parseVersion(r.stdout) : undefined;
50
+ if (version === undefined)
51
+ return { ok: false, error: `${tool} --version names no version, so a run could not say which host it was under` };
52
+ versions[name] = version;
53
+ }
54
+ return { ok: true, versions };
55
+ }
56
+ const sleepSync = (ms) => {
57
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
58
+ };
59
+ /** `jackd` on a name of its own and the dummy driver, at the cell's rate and quantum; `undefined` when none came up. */
60
+ export const startPrivateJack = (cell) => {
61
+ const name = `omx-qualify-${String(process.pid)}-${String(cell.quantum)}`;
62
+ let child;
63
+ let ended = false;
64
+ try {
65
+ child = spawn("jackd", ["-r", "-n", name, "-d", "dummy", "-r", String(cell.rate), "-p", String(cell.quantum)], { stdio: "ignore", detached: true });
66
+ }
67
+ catch {
68
+ return undefined;
69
+ }
70
+ child.on("error", () => (ended = true));
71
+ child.on("exit", () => (ended = true));
72
+ child.unref();
73
+ const running = () => {
74
+ if (ended || child.pid === undefined)
75
+ return false;
76
+ // the exit event needs the loop this synchronous pass holds: the process table says
77
+ return existsSync(`/proc/${String(child.pid)}`) && !/^\S+ \(.*\) Z/.test(readStat(child.pid));
78
+ };
79
+ // a TERM first: jackd frees the shared memory it holds under /dev/shm itself, which a KILL would leave behind for good
80
+ const signal = (sig) => {
81
+ try {
82
+ if (child.pid !== undefined)
83
+ process.kill(-child.pid, sig);
84
+ }
85
+ catch {
86
+ // already gone
87
+ }
88
+ };
89
+ const stop = () => {
90
+ signal("SIGTERM");
91
+ const until = Date.now() + SERVER_STOP_MS;
92
+ while (running() && Date.now() < until)
93
+ sleepSync(20);
94
+ if (running())
95
+ signal("SIGKILL");
96
+ for (const d of serverDirs(name))
97
+ rmSync(d, { recursive: true, force: true });
98
+ };
99
+ const until = Date.now() + SERVER_WAIT_MS;
100
+ while (Date.now() < until) {
101
+ if (child.pid === undefined || !running()) {
102
+ stop();
103
+ return undefined;
104
+ }
105
+ if (serverDirs(name).length > 0) {
106
+ sleepSync(SERVER_SETTLE_MS);
107
+ return { name, alive: running, stop };
108
+ }
109
+ sleepSync(50);
110
+ }
111
+ stop();
112
+ return undefined;
113
+ };
114
+ const readStat = (pid) => {
115
+ try {
116
+ return readFileSync(`/proc/${String(pid)}/stat`, "utf8");
117
+ }
118
+ catch {
119
+ return "";
120
+ }
121
+ };
122
+ /** Where jackd keeps a server's sockets, and its semaphores: the socket appears as the server opens it. */
123
+ function serverDirs(name) {
124
+ try {
125
+ return readdirSync("/dev/shm").filter((d) => d.startsWith(`jack_${name}_`) || new RegExp(`^jack_sem\\.\\d+_${name}_`).test(d)).map((d) => join("/dev/shm", d));
126
+ }
127
+ catch {
128
+ return [];
129
+ }
130
+ }
131
+ /** Whether a machine can give a pass its private server at all: the program is there. */
132
+ function jackdInstalled(env) {
133
+ return (env["PATH"] ?? process.env["PATH"] ?? "").split(":").some((d) => d !== "" && existsSync(join(d, "jackd")));
134
+ }
135
+ // --- the block --------------------------------------------------------------------------------------------------------
136
+ /**
137
+ * The runs of every cell as one block. Its top is what the judge reads: a refusal or a crash at any cell decides, with the
138
+ * cell it happened at, whatever the others say; then a cell where the host could not be run leaves it not measured, so
139
+ * still owed; only every cell admitted is admitted. Pure.
140
+ */
141
+ export function adapterBlockOf(runs, versions, measuredAt) {
142
+ const cells = runs.map(({ cell, run }) => ({ rate: cell.rate, quantum: cell.quantum, measured: run.measured, admitted: run.admitted, ...(run.code === undefined ? {} : { code: run.code }), params: run.params }));
143
+ const worst = cells.find((c) => c.measured && !c.admitted) ?? cells.find((c) => !c.measured);
144
+ const top = worst === undefined
145
+ ? { measured: true, admitted: true, params: {} }
146
+ : { measured: worst.measured, admitted: false, ...(worst.code === undefined ? {} : { code: worst.code }), params: { ...worst.params, rate: worst.rate, quantum: worst.quantum } };
147
+ return { host: ADAPTER_HOST, ...top, versions, measuredAt, cells };
148
+ }
149
+ /** The record with the block, and every other byte of it as it was. Pure. */
150
+ export const mergeAdapterRun = (record, block) => ({ ...record, adapter: block });
151
+ /** Whether a record's adapter run is done: at these host versions, measured, at every cell. */
152
+ export function adapterFinished(record, versions, cells = ADAPTER_PASS_CELLS) {
153
+ const a = record.adapter;
154
+ if (a === undefined || !a.measured || a.versions === undefined || a.cells === undefined)
155
+ return false;
156
+ const same = Object.keys(versions).length === Object.keys(a.versions).length && Object.entries(versions).every(([k, v]) => a.versions[k] === v);
157
+ return same && cells.every((c) => a.cells.some((x) => cellKey(x) === cellKey(c)));
158
+ }
159
+ /** The pass could not start: nothing was run and nothing written. */
160
+ export class AdapterPassRefused extends Error {
161
+ }
162
+ const readRecord = (path) => {
163
+ try {
164
+ const r = JSON.parse(readFileSync(path, "utf8"));
165
+ return r.schema === QUALIFICATION_RECORD_SCHEMA ? r : undefined;
166
+ }
167
+ catch {
168
+ return undefined;
169
+ }
170
+ };
171
+ /**
172
+ * The run of each LV2 plugin of the state whose probe ended well (one that did not has no verdict a run could decide), at
173
+ * each cell. Each record is written whole as its plugin ends.
174
+ */
175
+ export function adapterPass(ctx, state, options = {}) {
176
+ const read = hostVersions(ctx.env, options.versions);
177
+ if (!read.ok)
178
+ throw new AdapterPassRefused(read.error);
179
+ if (!(options.jackdPresent ?? jackdInstalled(ctx.env)))
180
+ throw new AdapterPassRefused(`no jackd on the path: ${NO_PRIVATE_SERVER}, and the device's own JACK server is never used for this`);
181
+ const { versions } = read;
182
+ const starter = options.jack ?? startPrivateJack;
183
+ const runs = options.runs ?? SPAWNED_ADMISSIONS;
184
+ const now = options.now ?? (() => new Date().toISOString());
185
+ const servers = new Map();
186
+ const serverFor = (cell) => {
187
+ const key = cellKey(cell);
188
+ const had = servers.get(key);
189
+ if (had?.alive() === true)
190
+ return had;
191
+ had?.stop();
192
+ servers.delete(key);
193
+ const fresh = starter(cell);
194
+ if (fresh !== undefined)
195
+ servers.set(key, fresh);
196
+ return fresh;
197
+ };
198
+ const count = { measured: 0, already: 0, failed: 0 };
199
+ const limit = { [ADMIT_STEP_MS_ENV]: String(ctx.settings.budgetS * 1000), [ADMIT_ADDRESS_KB_ENV]: String(Math.ceil(defaultAddressSpaceLimit() / 2 ** 10)) };
200
+ try {
201
+ for (const [key, entry] of Object.entries(state.entries)) {
202
+ if (entry.format !== "lv2")
203
+ continue;
204
+ const files = digestFiles(entry.root, entry.files.map((f) => f.path), entry.files);
205
+ if (files === undefined || !files.every((f) => entry.files.some((x) => x.path === f.path && x.sha256 === f.sha256))) {
206
+ ctx.log(`${key}: its files changed since it was measured; the sync measures it whole`);
207
+ continue;
208
+ }
209
+ for (const plugin of entry.plugins) {
210
+ if (plugin.record === undefined || !plugin.record.endsWith(RECORD_SUFFIX))
211
+ continue;
212
+ const path = join(ctx.settings.qualificationDir, basename(plugin.record));
213
+ const record = readRecord(path);
214
+ if (record === undefined) {
215
+ ctx.log(`${plugin.uri}: its record does not read; no adapter run`);
216
+ count.failed++;
217
+ continue;
218
+ }
219
+ if (record.probe.outcome !== PROBE_OK)
220
+ continue;
221
+ if (options.force !== true && adapterFinished(record, versions)) {
222
+ count.already++;
223
+ continue;
224
+ }
225
+ const started = Date.now();
226
+ const done = ADAPTER_PASS_CELLS.map((cell) => {
227
+ const server = serverFor(cell);
228
+ if (server === undefined)
229
+ return { cell, run: { host: ADAPTER_HOST, measured: false, admitted: false, code: NO_PRIVATE_SERVER, params: {} } };
230
+ const stateDir = mkdtempSync(join(tmpdir(), "plugin-qualify-adapter-state-"));
231
+ try {
232
+ const env = { ...ctx.env, ...limit, [ADMIT_STATE_DIR_ENV]: stateDir, LV2_PATH: ctx.settings.lv2Dirs.join(":"), JACK_DEFAULT_SERVER: server.name, JACK_NO_START_SERVER: "1" };
233
+ return { cell, run: admitUnderAdapter(record.plugin.id, runs, env) ?? { host: ADAPTER_HOST, measured: false, admitted: false, code: `${ADAPTER_HOST}.admission-failed`, params: {} } };
234
+ }
235
+ finally {
236
+ rmSync(stateDir, { recursive: true, force: true });
237
+ }
238
+ });
239
+ const block = adapterBlockOf(done, versions, now());
240
+ writeFileWhole(path, `${JSON.stringify(mergeAdapterRun(record, block), null, 2)}\n`);
241
+ if (block.measured)
242
+ count.measured++;
243
+ else
244
+ count.failed++;
245
+ ctx.log(`${plugin.uri}: adapter ${block.measured ? (block.admitted ? "admitted" : `refused (${block.code ?? ""})`) : `not run (${block.code ?? ""})`} in ${((Date.now() - started) / 1000).toFixed(1)} s`);
246
+ }
247
+ }
248
+ }
249
+ finally {
250
+ for (const s of servers.values())
251
+ s.stop();
252
+ }
253
+ return { ...count, versions };
254
+ }
255
+ //# sourceMappingURL=qualify-adapter-pass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualify-adapter-pass.js","sourceRoot":"","sources":["../src/qualify-adapter-pass.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,sDAAsD;AACtD;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAqB,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS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C,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,IAAI,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC7M,CAAC;QACH,CAAC;IACH,CAAC;YAAS,CAAC;QACT,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE;YAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC;AAChC,CAAC"}
@@ -118,8 +118,30 @@ export declare const GRID_CONTINUITY_QUANTUM = 512;
118
118
  * same two (src/memory-bound.test.ts holds them together).
119
119
  */
120
120
  export declare const MEMORY_LIMIT_RAM_FRACTION = 0.5;
121
+ /**
122
+ * The address space (`RLIMIT_AS`) of a process plugin-qualify spawns directly, with no runner to give it a cgroup: all the
123
+ * machine's RAM. Address space is what a plugin reserves, not what it touches, so this is the far bound of a direct
124
+ * run, not its budget. Off for a sanitizer build, which reserves far more address space than it uses.
125
+ */
126
+ export declare const ADDRESS_SPACE_LIMIT_RAM_FRACTION = 1;
121
127
  export declare const MEMORY_BOUND_EXIT_ENV = "OMX_RT_OOM_EXIT";
122
128
  export declare const MEMORY_BOUND_EXIT_STATUS = 121;
129
+ /**
130
+ * The memory-only pass (`plugin-qualify-sync --memory-only`). With `PROBE_MEMORY_ONLY_ENV` set the probers take the
131
+ * footprint and nothing else; the probe runner passes its environment on, so its limits hold unchanged.
132
+ * `PROBE_NOTES_ENV` is the count of notes an instrument that declares no voice capacity holds, basis `probe`:
133
+ * `MEMORY_PASS_PROBE_NOTES` unless `memory_notes` says otherwise.
134
+ */
135
+ export declare const PROBE_MEMORY_ONLY_ENV = "OMX_PROBE_MEMORY_ONLY";
136
+ export declare const PROBE_NOTES_ENV = "OMX_PROBE_NOTES";
137
+ export declare const MEMORY_PASS_PROBE_NOTES = 16;
138
+ /**
139
+ * What `tools/mod-host-admit.mjs` is told in an adapter-only pass: how long the host has for one command, its address
140
+ * space (`ulimit -v`, in KB) and the directory for the state files of the plugin it loads.
141
+ */
142
+ export declare const ADMIT_STEP_MS_ENV = "OMX_ADMIT_STEP_MS";
143
+ export declare const ADMIT_ADDRESS_KB_ENV = "OMX_ADMIT_ADDRESS_KB";
144
+ export declare const ADMIT_STATE_DIR_ENV = "OMX_ADMIT_STATE_DIR";
123
145
  /** Seconds one `.clap` may take to qualify at every rate before the prober is killed. */
124
146
  export declare const CLAP_QUALIFY_TIMEOUT_S = 120;
125
147
  /**
@@ -167,10 +189,16 @@ export declare const DESCRIPTOR_CODE_BINARY_UNHASHED = "qualify.descriptor.binar
167
189
  export declare const DESCRIPTOR_CODE_DIR_UNWRITABLE = "qualify.descriptor.dir-unwritable";
168
190
  /** Every threshold, so none is baked into the code. */
169
191
  export interface HostingPolicy {
170
- /** Minimum instantiate/destroy lifecycles. The operator's §14.4 ruling: 1000. */
192
+ /** Minimum instantiate/destroy lifecycles. §14.4 sets it: 1000. */
171
193
  readonly cycleFloor: number;
172
194
  /** Minimum continuous soak, seconds. Default 3 h — the operator's longest show. */
173
195
  readonly soakSeconds: number;
196
+ /**
197
+ * The memory growth a soak may show past warm-up, in KB per minute of audio. 10 MB/min ships provisional and is
198
+ * tightened from measurements; a verdict that rests on it says so.
199
+ */
200
+ readonly memoryGrowthKbPerMinCeiling: number;
201
+ readonly memoryGrowthCeilingProvisional: boolean;
174
202
  /** Above this ratio a plugin is spiky: in-process a spike is the whole desk's xrun. */
175
203
  readonly costTailRatioCeiling: number;
176
204
  /** A soak rate whose settled output sits this far under the plugin's own best rate is
@@ -180,7 +208,7 @@ export interface HostingPolicy {
180
208
  readonly hostProvenance?: string;
181
209
  }
182
210
  /**
183
- * Defaults. The cycle floor is the operator's ruling of 2026-09-05 (§14.4, option c) and the
211
+ * Defaults. The cycle floor is the decision of 2026-09-05 (§14.4, option c) and the
184
212
  * soak is §3's default show length. The per-instance cost ceiling is the HOST's budget and
185
213
  * lives in {@link HOST_BUDGETS} (plugin-qualify §3a), not here.
186
214
  */
@@ -190,19 +218,23 @@ export declare const DEFAULT_HOSTING_POLICY: HostingPolicy;
190
218
  import type { HostBudget } from "./measurement/format.js";
191
219
  export type { HostBudget };
192
220
  /**
193
- * Each shipped host profile's budget, by profile id. `openmixer-console` is §14.2's 5 % per
194
- * instance at the rig's rate and buffer. `mod-host` runs a whole pedalboard on one JACK thread,
195
- * so it gets the same per-instance share, at 48 kHz / 128 frames. `jalv` gives each plugin its own
196
- * process and client, so a quarter core per instance, at 48 kHz / 256 frames. The last two are
197
- * declared defaults, not a measurement of anyone's board — a project brings its own profile file.
198
- * `omx-clap-host` runs its plugins one JACK client each, called in turn on the server's one cycle,
199
- * so it gets mod-host's share and pair.
221
+ * The cells a Raspberry Pi runs: zynthian-sys's JACK settings, 48000/128 on a Pi 5 with the V5 kit and 48000/256 on a Pi 4 and
222
+ * the other kits, the one a Pi 5 with no kit card also ran its stress and first boot at. The Zynthian benchmark's matrix sweeps
223
+ * more cells; these two are what a Pi is set to.
200
224
  */
225
+ export declare const PI_CELLS: {
226
+ rate: number;
227
+ quantum: number;
228
+ }[];
201
229
  export declare const HOST_BUDGETS: {
202
230
  readonly "openmixer-console": {
203
231
  readonly coreFractionCeiling: 0.05;
204
232
  readonly rate: 96000;
205
233
  readonly quantum: 1024;
234
+ readonly memory: {
235
+ perInstanceKb: number;
236
+ perConsoleKb: number;
237
+ };
206
238
  };
207
239
  readonly jalv: {
208
240
  readonly coreFractionCeiling: 0.25;
@@ -219,4 +251,16 @@ export declare const HOST_BUDGETS: {
219
251
  readonly rate: 48000;
220
252
  readonly quantum: 128;
221
253
  };
254
+ readonly "openmixer-pi-4gb": {
255
+ readonly coreFractionCeiling: 0.05;
256
+ readonly rate: 48000;
257
+ readonly quantum: 128;
258
+ readonly memory: import("./measurement/format.js").HostMemoryBudget;
259
+ };
260
+ readonly "openmixer-pi-8gb": {
261
+ readonly coreFractionCeiling: 0.05;
262
+ readonly rate: 48000;
263
+ readonly quantum: 128;
264
+ readonly memory: import("./measurement/format.js").HostMemoryBudget;
265
+ };
222
266
  };
@@ -123,8 +123,30 @@ export const GRID_CONTINUITY_QUANTUM = CLAP_SWEEP_FRAMES;
123
123
  * same two (src/memory-bound.test.ts holds them together).
124
124
  */
125
125
  export const MEMORY_LIMIT_RAM_FRACTION = 0.5;
126
+ /**
127
+ * The address space (`RLIMIT_AS`) of a process plugin-qualify spawns directly, with no runner to give it a cgroup: all the
128
+ * machine's RAM. Address space is what a plugin reserves, not what it touches, so this is the far bound of a direct
129
+ * run, not its budget. Off for a sanitizer build, which reserves far more address space than it uses.
130
+ */
131
+ export const ADDRESS_SPACE_LIMIT_RAM_FRACTION = 1;
126
132
  export const MEMORY_BOUND_EXIT_ENV = "OMX_RT_OOM_EXIT";
127
133
  export const MEMORY_BOUND_EXIT_STATUS = 121;
134
+ /**
135
+ * The memory-only pass (`plugin-qualify-sync --memory-only`). With `PROBE_MEMORY_ONLY_ENV` set the probers take the
136
+ * footprint and nothing else; the probe runner passes its environment on, so its limits hold unchanged.
137
+ * `PROBE_NOTES_ENV` is the count of notes an instrument that declares no voice capacity holds, basis `probe`:
138
+ * `MEMORY_PASS_PROBE_NOTES` unless `memory_notes` says otherwise.
139
+ */
140
+ export const PROBE_MEMORY_ONLY_ENV = "OMX_PROBE_MEMORY_ONLY";
141
+ export const PROBE_NOTES_ENV = "OMX_PROBE_NOTES";
142
+ export const MEMORY_PASS_PROBE_NOTES = 16;
143
+ /**
144
+ * What `tools/mod-host-admit.mjs` is told in an adapter-only pass: how long the host has for one command, its address
145
+ * space (`ulimit -v`, in KB) and the directory for the state files of the plugin it loads.
146
+ */
147
+ export const ADMIT_STEP_MS_ENV = "OMX_ADMIT_STEP_MS";
148
+ export const ADMIT_ADDRESS_KB_ENV = "OMX_ADMIT_ADDRESS_KB";
149
+ export const ADMIT_STATE_DIR_ENV = "OMX_ADMIT_STATE_DIR";
128
150
  /** Seconds one `.clap` may take to qualify at every rate before the prober is killed. */
129
151
  export const CLAP_QUALIFY_TIMEOUT_S = 120;
130
152
  /**
@@ -171,7 +193,7 @@ export const DESCRIPTOR_CODE_SCHEMA_FLOOR = "qualify.descriptor.schema-floor";
171
193
  export const DESCRIPTOR_CODE_BINARY_UNHASHED = "qualify.descriptor.binary-unhashed";
172
194
  export const DESCRIPTOR_CODE_DIR_UNWRITABLE = "qualify.descriptor.dir-unwritable";
173
195
  /**
174
- * Defaults. The cycle floor is the operator's ruling of 2026-09-05 (§14.4, option c) and the
196
+ * Defaults. The cycle floor is the decision of 2026-09-05 (§14.4, option c) and the
175
197
  * soak is §3's default show length. The per-instance cost ceiling is the HOST's budget and
176
198
  * lives in {@link HOST_BUDGETS} (plugin-qualify §3a), not here.
177
199
  */
@@ -180,6 +202,8 @@ export const DEFAULT_HOSTING_POLICY = {
180
202
  soakSeconds: 3 * 60 * 60,
181
203
  costTailRatioCeiling: 4,
182
204
  soakDeadDropDb: 40,
205
+ memoryGrowthKbPerMinCeiling: 10240,
206
+ memoryGrowthCeilingProvisional: true,
183
207
  };
184
208
  /**
185
209
  * Each shipped host profile's budget, by profile id. `openmixer-console` is §14.2's 5 % per
@@ -190,10 +214,38 @@ export const DEFAULT_HOSTING_POLICY = {
190
214
  * `omx-clap-host` runs its plugins one JACK client each, called in turn on the server's one cycle,
191
215
  * so it gets mod-host's share and pair.
192
216
  */
217
+ const GIB_KB = 1024 * 1024;
218
+ /**
219
+ * The desk's memory budget: half of its 30 GiB for the plugins of a console, the rest the engine's and the system's;
220
+ * one instance's share is what the probe bounds a run by, 4 GiB.
221
+ */
222
+ const DESK_MEMORY = { perInstanceKb: 4 * GIB_KB, perConsoleKb: 16 * GIB_KB };
223
+ /**
224
+ * What a Raspberry Pi gives its plugins' memory, by the board's RAM: all but 1 GiB for the system and Zynthian's own
225
+ * UI, and an instance's share an eighth of that. Provisional until measured on a Pi: the stress runs show a 4 GiB Pi 5 stopping
226
+ * at 400 MB free, and no plugin's footprint has been read there yet.
227
+ */
228
+ const piMemory = (ramGib) => ({
229
+ perInstanceKb: ((ramGib - 1) * GIB_KB) / 8,
230
+ perConsoleKb: (ramGib - 1) * GIB_KB,
231
+ provisional: true,
232
+ cells: PI_CELLS,
233
+ });
234
+ /**
235
+ * The cells a Raspberry Pi runs: zynthian-sys's JACK settings, 48000/128 on a Pi 5 with the V5 kit and 48000/256 on a Pi 4 and
236
+ * the other kits, the one a Pi 5 with no kit card also ran its stress and first boot at. The Zynthian benchmark's matrix sweeps
237
+ * more cells; these two are what a Pi is set to.
238
+ */
239
+ export const PI_CELLS = [
240
+ { rate: MEASURE_BASE_RATE, quantum: 128 },
241
+ { rate: MEASURE_BASE_RATE, quantum: 256 },
242
+ ];
193
243
  export const HOST_BUDGETS = {
194
- "openmixer-console": { coreFractionCeiling: 0.05, rate: COST_REFERENCE_RATE, quantum: QUANTUM_FRAMES },
244
+ "openmixer-console": { coreFractionCeiling: 0.05, rate: COST_REFERENCE_RATE, quantum: QUANTUM_FRAMES, memory: DESK_MEMORY },
195
245
  jalv: { coreFractionCeiling: 0.25, rate: MEASURE_BASE_RATE, quantum: 256 },
196
246
  "mod-host": { coreFractionCeiling: 0.05, rate: MEASURE_BASE_RATE, quantum: 128 },
197
247
  "omx-clap-host": { coreFractionCeiling: 0.05, rate: MEASURE_BASE_RATE, quantum: 128 },
248
+ "openmixer-pi-4gb": { coreFractionCeiling: 0.05, rate: MEASURE_BASE_RATE, quantum: 128, memory: piMemory(4) },
249
+ "openmixer-pi-8gb": { coreFractionCeiling: 0.05, rate: MEASURE_BASE_RATE, quantum: 128, memory: piMemory(8) },
198
250
  };
199
251
  //# sourceMappingURL=qualify-declarations.js.map
@@ -1 +1 @@
1
- {"version":3,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AM,CAAC,MAAM,YAAY,GAAG;IAC1B,mBAAmB,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE;IAC3H,IAAI,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,EAAE;IAC1E,UAAU,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,EAAE;IAChF,eAAe,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,EAAE;IACrF,kBAAkB,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE;IAC7G,kBAAkB,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE;CACtD,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { type GridCell } from "./measurement-grid.js";
2
+ import { type ProbeOutput } from "./probe-output.js";
3
+ import { type ProbeRun } from "./probe-runner.js";
4
+ import { type NotMeasured, type OwedMeasurement, type QualificationRecord } from "./qualification-record.js";
5
+ import { type SyncContext, type SyncState } from "./qualify-sync.js";
6
+ /** The codes of a measurement a record owes. */
7
+ export declare const OWED_CODE: {
8
+ /** An LV2 verdict of a host that runs it through the adapter, and no measured adapter run. */
9
+ readonly adapterRun: "qualify.sync.adapter-run-owed";
10
+ /** A verdict decided by a run under its host (mod-host, jalv), and no run in the record. */
11
+ readonly hostRun: "qualify.sync.host-run-owed";
12
+ /** The plugin's files are not the bytes the record measured. */
13
+ readonly bytesChanged: "qualify.sync.bytes-changed";
14
+ /** The probe output is missing, is not the copy the record names, or does not read. */
15
+ readonly figuresUnreadable: "qualify.sync.figures-unreadable";
16
+ /** The plugin has a record that holds no figures at all. */
17
+ readonly noFigures: "qualify.sync.no-figures";
18
+ };
19
+ /** The cells the memory-only pass measures: the ones a Pi runs, 48 kHz at 128 and 256 frames. */
20
+ export declare const MEMORY_PASS_CELLS: readonly GridCell[];
21
+ /** What a memory-only pass cannot say, in every record it writes to: growth over time needs a soak. */
22
+ export declare const MEMORY_PASS_NOT_MEASURED: NotMeasured;
23
+ /** The tool as the record says it: this package's own version, read where it is installed. */
24
+ export declare function rejudgeToolName(): string;
25
+ /** A world holding one bundle, as plugin-hostd runs a pinned LV2 plugin, for as long as `body` runs. */
26
+ export declare function lv2World<T>(bundle: string, body: (world: string) => T): T;
27
+ export declare class RejudgeRefusal extends Error {
28
+ }
29
+ /**
30
+ * One record judged again from its probe output, with what it owes. The figures, who took them and when are as they were;
31
+ * only the verdicts, the tiers and the cost reasons beside them are new. `at` is the prior re-judge's when nothing else
32
+ * differs, so that a second run leaves the file alone.
33
+ */
34
+ export declare function rejudgeRecord(record: QualificationRecord, probeBytes: Uint8Array, options: {
35
+ readonly host: string;
36
+ readonly by: string;
37
+ readonly at: string;
38
+ }): {
39
+ record: QualificationRecord;
40
+ owes: readonly OwedMeasurement[];
41
+ };
42
+ /** The file that lists what a re-judge left owing, beside the state file. */
43
+ export declare const owedFile: (stateFile: string) => string;
44
+ export declare const OWED_SCHEMA = "plugin-qualify.owed/1";
45
+ export interface OwingRecord {
46
+ readonly plugin: string;
47
+ /** The record's file name, when the plugin has one. */
48
+ readonly record?: string;
49
+ readonly owes: readonly OwedMeasurement[];
50
+ }
51
+ export interface RejudgeResult {
52
+ readonly state: SyncState;
53
+ readonly changed: number;
54
+ readonly unchanged: number;
55
+ readonly owing: readonly OwingRecord[];
56
+ }
57
+ /**
58
+ * Every record of the device's qualification directory judged again, the state's outcomes and pin words brought into line,
59
+ * and the list of what is owed written beside the state file. Each file is written whole, and only when it differs.
60
+ */
61
+ export declare function rejudgeState(ctx: SyncContext, state: SyncState, now?: () => string): RejudgeResult;
62
+ /**
63
+ * A memory-only run's footprints in a record: the `memory` of each cell and nothing else of it, a cell the record's grid
64
+ * does not hold joined with no other figure. A cell the run could not read says why instead of a figure, so that it is
65
+ * never read as fitting. Pure.
66
+ */
67
+ export declare function mergeMemoryRun(record: QualificationRecord, output: ProbeOutput, cells: readonly GridCell[]): QualificationRecord;
68
+ export interface MemoryPassResult {
69
+ readonly measured: number;
70
+ readonly already: number;
71
+ readonly failed: number;
72
+ }
73
+ /**
74
+ * The footprint of each plugin of the state, at `MEMORY_PASS_CELLS`, merged into the record its verdict for this run's host
75
+ * came from. One plugin's failure is that plugin's; each record is written whole as its plugin ends, so a pass cut short
76
+ * keeps what it finished, and a pass run again skips those unless `force`.
77
+ */
78
+ export declare function memoryPass(ctx: SyncContext, state: SyncState, options?: {
79
+ readonly force?: boolean;
80
+ readonly run?: ProbeRun;
81
+ }): MemoryPassResult;