@openmixer/plugin-qualify 0.18.5 → 0.19.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 (88) hide show
  1. package/README.md +19 -730
  2. package/bin/plugin-qualify-sync.mjs +1 -1
  3. package/bin/plugin-qualify.mjs +7 -0
  4. package/dist/clap-qualify.d.ts +1 -1
  5. package/dist/compare.d.ts +311 -0
  6. package/dist/compare.js +502 -0
  7. package/dist/compare.js.map +1 -0
  8. package/dist/distributed-records.d.ts +0 -2
  9. package/dist/distributed-records.js +0 -2
  10. package/dist/distributed-records.js.map +1 -1
  11. package/dist/host-admission.d.ts +2 -2
  12. package/dist/host-admission.js +7 -0
  13. package/dist/host-admission.js.map +1 -1
  14. package/dist/hosting-codes.generated.d.ts +1 -0
  15. package/dist/hosting-codes.generated.js +1 -0
  16. package/dist/hosting-codes.generated.js.map +1 -1
  17. package/dist/hosting-suitability.d.ts +3 -1
  18. package/dist/hosting-suitability.js +9 -0
  19. package/dist/hosting-suitability.js.map +1 -1
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.js +1 -0
  22. package/dist/index.js.map +1 -1
  23. package/dist/lv2-loader.js +6 -5
  24. package/dist/lv2-loader.js.map +1 -1
  25. package/dist/measurement/format.d.ts +15 -0
  26. package/dist/measurement/format.js +19 -0
  27. package/dist/measurement/format.js.map +1 -1
  28. package/dist/measurement/sweep-jsonl.js +5 -1
  29. package/dist/measurement/sweep-jsonl.js.map +1 -1
  30. package/dist/measurement-grid.js +1 -1
  31. package/dist/pins-file.d.ts +22 -2
  32. package/dist/pins-file.js +118 -17
  33. package/dist/pins-file.js.map +1 -1
  34. package/dist/qualification-record.d.ts +26 -0
  35. package/dist/qualification-record.js +21 -0
  36. package/dist/qualification-record.js.map +1 -1
  37. package/dist/qualify-declarations.d.ts +6 -0
  38. package/dist/qualify-declarations.js +8 -0
  39. package/dist/qualify-declarations.js.map +1 -1
  40. package/dist/qualify-isolated.d.ts +16 -3
  41. package/dist/qualify-isolated.js +31 -3
  42. package/dist/qualify-isolated.js.map +1 -1
  43. package/dist/qualify-pool.d.ts +129 -0
  44. package/dist/qualify-pool.js +290 -0
  45. package/dist/qualify-pool.js.map +1 -0
  46. package/dist/qualify-rejudge.js +7 -0
  47. package/dist/qualify-rejudge.js.map +1 -1
  48. package/dist/qualify-sync.d.ts +36 -1
  49. package/dist/qualify-sync.js +144 -20
  50. package/dist/qualify-sync.js.map +1 -1
  51. package/dist/records-package.d.ts +5 -0
  52. package/dist/records-package.js +25 -8
  53. package/dist/records-package.js.map +1 -1
  54. package/fixtures/clap-scan/fake.json +8 -2
  55. package/fixtures/probe-output/success-msi.json +2 -2
  56. package/package.json +3 -3
  57. package/src/clap-qualify.ts +1 -1
  58. package/src/compare.ts +699 -0
  59. package/src/distributed-records.ts +0 -3
  60. package/src/host-admission.ts +9 -2
  61. package/src/hosting-codes.generated.ts +1 -0
  62. package/src/hosting-suitability.ts +14 -0
  63. package/src/index.ts +1 -0
  64. package/src/lv2-loader.ts +5 -4
  65. package/src/measurement/format.ts +32 -0
  66. package/src/measurement/sweep-jsonl.ts +5 -1
  67. package/src/measurement-grid.ts +1 -1
  68. package/src/pins-file.ts +109 -16
  69. package/src/qualification-record.ts +38 -0
  70. package/src/qualify-declarations.ts +8 -0
  71. package/src/qualify-isolated.ts +31 -5
  72. package/src/qualify-pool.ts +318 -0
  73. package/src/qualify-rejudge.ts +8 -0
  74. package/src/qualify-sync.ts +140 -19
  75. package/src/records-package.ts +25 -8
  76. package/tools/benchmark.py +9 -3
  77. package/tools/compare-host.mjs +432 -0
  78. package/tools/compare-run.mjs +355 -0
  79. package/tools/descriptors.py +27 -0
  80. package/tools/isolated-step.mjs +3 -1
  81. package/tools/lilv_load.py +25 -0
  82. package/tools/lv2_resolve.py +3 -1
  83. package/tools/pool-step.mjs +186 -0
  84. package/tools/scan.py +16 -20
  85. package/tools/audit-overlap.sh +0 -250
  86. package/tools/commit-message-check.sh +0 -128
  87. package/tools/commit-message-patterns.json +0 -41
  88. package/tools/private-refs-check.sh +0 -90
@@ -16,7 +16,9 @@ import { spawnSync } from "node:child_process";
16
16
  import { existsSync, readFileSync } from "node:fs";
17
17
  import { basename, join } from "node:path";
18
18
  import { ADAPTER_PASS_CELLS, startPrivateJack } from "./qualify-adapter-pass.js";
19
+ import { clapPinUri } from "./pins-file.js";
19
20
  import { PROBE_OK, readProbeOutput } from "./probe-output.js";
21
+ import { HOSTING_CODE } from "./hosting-codes.js";
20
22
  import { ISOLATED_SIGNAL_TOOL_ENV, ISOLATED_SIGNAL_TOOL_NAME } from "./qualify-declarations.js";
21
23
  import { locateNativeTool, toolsDir } from "./tool-paths.js";
22
24
  import { writeFileWhole } from "./whole-file.js";
@@ -73,9 +75,35 @@ function figuresOf(run) {
73
75
  ...(run.midiInputsLinked === undefined ? {} : { midiInputsLinked: run.midiInputsLinked }),
74
76
  };
75
77
  }
76
- /** Whether a record's outcome calls for the isolated step: rated `conditional` by some host, or a probe that crashed or hung. */
78
+ /**
79
+ * A verdict whose only gap is memory nobody measured: it reads `unknown` and every reason that is not `suitable` is
80
+ * `hosting.memory.unmeasured`. Nothing says the plugin is unfit, so it is hosted in a worker of its own until its
81
+ * footprint is measured, and the isolated step is what shows it running alone.
82
+ */
83
+ export function memoryGapOnly(v) {
84
+ if (!v.measured || v.rating !== "unknown")
85
+ return false;
86
+ const open = v.reasons.filter((r) => r.rating !== "suitable");
87
+ return open.length > 0 && open.every((r) => r.code === HOSTING_CODE.memoryUnmeasured);
88
+ }
89
+ /** Whether a record's outcome calls for the isolated step: rated `conditional` by some host, a memory gap and nothing else, or a probe that crashed or hung. */
77
90
  export function owesIsolated(record) {
78
- return PROBE_FAILED_HARD.has(record.probe.outcome) || record.verdicts.some((v) => v.measured && v.rating === "conditional");
91
+ return PROBE_FAILED_HARD.has(record.probe.outcome) || record.verdicts.some((v) => v.measured && (v.rating === "conditional" || memoryGapOnly(v)));
92
+ }
93
+ /**
94
+ * The pin a record can give back to a plugin whose state lost it: the bytes the probe pinned, and the word of a decided
95
+ * isolated step (`isolated` or `refused`). `undefined` when the record holds no whole pin or the step decided nothing.
96
+ */
97
+ export function pinFromRecord(record) {
98
+ const step = record.run?.steps.find((s) => s.step === RUN_STEP.isolated);
99
+ if (step === undefined || step.result === ISOLATED_RESULT.notRun)
100
+ return undefined;
101
+ const { files, layout } = record.binary;
102
+ if (files === undefined || files.length === 0 || layout === undefined)
103
+ return undefined;
104
+ const sorted = [...files].sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
105
+ const uri = record.plugin.format === "clap" ? clapPinUri(record.binary.path, record.plugin.id) : record.plugin.id;
106
+ return pinAfterStep({ uri, integrity: { files: sorted, layout } }, step);
79
107
  }
80
108
  /** Whether the isolated step saw this plugin running alone. A record's word alone never says so. */
81
109
  export function provenAlone(record) {
@@ -155,7 +183,7 @@ export function pinAfterStep(pin, step) {
155
183
  return rest;
156
184
  }
157
185
  /** The run id of a record from before the steps: its probe output's, read from the copy beside it. */
158
- function runIdOf(record, dir) {
186
+ export function runIdOf(record, dir) {
159
187
  if (record.run !== undefined)
160
188
  return record.run.id;
161
189
  if (record.rejudged !== undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"qualify-isolated.js","sourceRoot":"","sources":["../src/qualify-isolated.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,sDAAsD;AACtD;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAoB,MAAM,2BAA2B,CAAC;AAGnG,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,wBAAwB,EAAE,yBAAy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+1,129 @@
1
+ import type { GridCell } from "./measurement-grid.js";
2
+ import type { PinEntry, PinPool } from "./pins-file.js";
3
+ import type { QualificationRecord, RunStep } from "./qualification-record.js";
4
+ import { type JackStarter } from "./qualify-adapter-pass.js";
5
+ /** The name of the step in a record's run. It is not one of `RUN_STEP`: a record is complete without it (a plugin that does not ask for the pool, or a machine that cannot run the step, has none). */
6
+ export declare const POOL_STEP = "pool";
7
+ /** The server's DSP load with the pool may be at most this fraction of the load without it. */
8
+ export declare const POOL_GAIN = 0.85;
9
+ /**
10
+ * The load must also fall by at least this many points of the cycle. The server's load has a floor of its own (the signal
11
+ * client, the ports, the worker's routing), so a plugin with next to nothing to do can fall by a good ratio of a small
12
+ * difference, and a pool for it would cost the cores it holds.
13
+ */
14
+ export declare const POOL_MIN_GAIN = 3;
15
+ /**
16
+ * The pool's helpers must have been on a cpu this many nanoseconds in the busiest window with the pool (20 ms of a 3 s
17
+ * window, across all of them): a worker that holds the pool and whose plugin asks for tasks every block keeps them
18
+ * busy for a good part of it, and a few microseconds is a start-up, not a pool at work.
19
+ */
20
+ export declare const POOL_HELPERS_IDLE_NS = 20000000;
21
+ export declare const POOL_RESULT: {
22
+ readonly cores: "cores";
23
+ readonly off: "off";
24
+ readonly notAsked: "not-asked";
25
+ readonly notRun: "not-run";
26
+ };
27
+ /** Why the step decided what it did, or why it could not run. */
28
+ export declare const POOL_CODE: {
29
+ readonly noHost: "pool.no-host";
30
+ readonly noServer: "pool.no-private-server";
31
+ readonly notAdded: "pool.not-added";
32
+ readonly windowFailed: "pool.window-failed";
33
+ readonly unwatched: "pool.not-watched";
34
+ readonly notRtSafe: "pool.not-rt-safe";
35
+ readonly notApplied: "pool.not-applied";
36
+ readonly crashed: "pool.crashed-with-pool";
37
+ readonly unsafeOutput: "pool.unsafe-output";
38
+ readonly xruns: "pool.more-xruns";
39
+ readonly notFaster: "pool.not-faster";
40
+ readonly helpersIdle: "pool.helpers-idle";
41
+ };
42
+ /** What one window saw, with the pool as the word set it. */
43
+ export interface PoolWindowFacts {
44
+ readonly problem?: string;
45
+ readonly alive?: boolean;
46
+ readonly workers?: number;
47
+ /** hostd's `worker_list` field for the worker: `on` for a worker started with the pool. */
48
+ readonly poolOfWorker?: string;
49
+ readonly xruns?: number;
50
+ readonly finite?: boolean;
51
+ readonly silent?: boolean;
52
+ readonly dspLoad?: number;
53
+ /** Nanoseconds the worker's pool helpers were on a cpu in the window (the busiest of the windows taken): little means the worker held the pool and its helpers ran next to nothing. */
54
+ readonly helperBusyNs?: number;
55
+ }
56
+ /** What the plugin did on the helper threads of a real pool under the interposer. */
57
+ export interface PoolRtFacts {
58
+ readonly helpers: number;
59
+ /** The tasks the helpers ran; none means the pool was not exercised, and nothing was seen of it. */
60
+ readonly tasksOnHelpers: number;
61
+ readonly allocations: number;
62
+ readonly locks: number;
63
+ readonly syscalls: number;
64
+ }
65
+ /** What one run of the step saw. A run that never reached the plugin says `started: false`, and `problem`. */
66
+ export interface PoolRunFacts {
67
+ readonly started: boolean;
68
+ readonly problem?: string;
69
+ /** Whether the plugin offers clap.thread-pool. */
70
+ readonly asks?: boolean;
71
+ /** The plugin's tasks on helper threads, counted by the interposer (the prober's `--pool`); absent when it could not be watched. */
72
+ readonly rt?: PoolRtFacts;
73
+ readonly added?: boolean;
74
+ readonly off?: PoolWindowFacts;
75
+ readonly on?: PoolWindowFacts;
76
+ /** The worker under `pool=cores` was started with the pool and the one under `pool=off` was not. */
77
+ readonly poolApplied?: boolean;
78
+ }
79
+ export type PoolRunner = (uri: string, cell: GridCell, env: Readonly<Record<string, string | undefined>>) => PoolRunFacts;
80
+ /** The decision table of the step, with the figures it took. Pure. */
81
+ export declare function judgePoolRun(run: PoolRunFacts): RunStep;
82
+ /** The pool word a step grants, or `undefined` for a step that decided nothing or granted none. */
83
+ export declare function poolWordOf(step: RunStep | undefined): PinPool | undefined;
84
+ /** The pool step of a run, if it has one. */
85
+ export declare function poolStepOf(run: QualificationRecord["run"]): RunStep | undefined;
86
+ /** The pin once the step has spoken: its pool word follows the step, and a step that decided nothing leaves none. A refused pin carries none. Pure. */
87
+ export declare function pinAfterPool(pin: PinEntry | undefined, step: RunStep | undefined): PinEntry | undefined;
88
+ /** Whether a step ended with a decision: `not-run` is the machine's, and the sync asks again. */
89
+ export declare const poolDecided: (s: RunStep) => boolean;
90
+ /**
91
+ * Whether a record owes the pool step: a CLAP plugin judged in a pass with steps, not refused, with no decided pool step.
92
+ * A record from before the steps owes the isolated step first, which gives it a run; the pool is for a plugin that runs,
93
+ * and a refused one never is.
94
+ */
95
+ export declare function owesPool(record: QualificationRecord): boolean;
96
+ /** Whether the plugin of a `clap:<path>#<id>` uri offers clap.thread-pool, by the prober's own `--asks-thread-pool`; `undefined` when it could not be asked. */
97
+ export declare function asksForPool(prober: string, uri: string, env: Readonly<Record<string, string | undefined>>): boolean | undefined;
98
+ /**
99
+ * What the plugin does on helper threads: the prober run with a real pool of one helper per core of this process's set but
100
+ * one (at most seven), under the interposer, which counts what any thread does while a sweep runs. The pool must have
101
+ * been used: a run whose tasks all ran on the calling thread saw nothing of the helpers.
102
+ */
103
+ export declare function watchOnHelpers(prober: string, interposer: string, uri: string, cell: GridCell, env: Readonly<Record<string, string | undefined>>): {
104
+ readonly rt: PoolRtFacts;
105
+ } | {
106
+ readonly problem: string;
107
+ };
108
+ /** The step as it runs on a device: a private server at the cell, and `tools/pool-step.mjs` under it. */
109
+ export declare function spawnedPoolRunner(jack?: JackStarter): PoolRunner;
110
+ /** The step's environment: each of its commands has the sync's budget. */
111
+ export declare const poolEnv: (env: Readonly<Record<string, string | undefined>>, budgetS: number) => Readonly<Record<string, string | undefined>>;
112
+ /**
113
+ * The steps of a run with the pool step added or replaced: a step that could not run takes the place of an earlier one
114
+ * that could not, and a decided step is never replaced here.
115
+ */
116
+ export declare function withPoolStep(steps: readonly RunStep[], step: RunStep): RunStep[];
117
+ /**
118
+ * The pin a record can give back to a plugin whose state lost it: what {@link pinFromRecord} gives, with the pool word
119
+ * of the record's pool step.
120
+ */
121
+ export declare function pinFromRecordWithPool(record: QualificationRecord): PinEntry | undefined;
122
+ /**
123
+ * The missing pool step of a record already judged: the run keeps its id and gains the step, and nothing else is
124
+ * measured. `undefined` when it owes none, or has no run id to extend. Writes the record whole.
125
+ */
126
+ export declare function completePool(path: string, record: QualificationRecord, uri: string, cell: GridCell, runner: PoolRunner, env: Readonly<Record<string, string | undefined>>): {
127
+ readonly record: QualificationRecord;
128
+ readonly step: RunStep;
129
+ } | undefined;
@@ -0,0 +1,290 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ // Copyright (C) 2026 Pau Aliagas <linuxnow@gmail.com>
3
+ /**
4
+ * The pool step: the one place that grants a plugin the CLAP thread pool. omx-clap-host sizes a pool of helper threads
5
+ * from its worker's cpu set, and plugin-hostd starts a worker with it only for a plugin whose pin says `pool=cores`
6
+ * (plugin-db's `PLUGIN_DB_PIN_POOLS`: "measured real-time safe and faster at the quantum"). That word is the plugin's
7
+ * qualification to give, so nothing writes it but this step.
8
+ *
9
+ * A plugin that does not offer `clap.thread-pool` is never asked: its record says `not-asked` and its pin has no pool
10
+ * word, so it runs serial. A plugin that does is first run by the prober with real helper threads under the interposer
11
+ * (`clap-qualify --pool`, which counts what the plugin's tasks do on a thread that is not the audio thread); one that
12
+ * allocates, locks or makes a system call there is `off`. Then it is run twice in a worker of its own on a private JACK
13
+ * server at the host's rate and quantum, with the same notes held, once under `pool=off` and once under `pool=cores`
14
+ * (`tools/pool-step.mjs`), each mode twice in turn and judged by its best window, because what else runs on the machine can
15
+ * only make a window worse. The pool is granted when, with it on,
16
+ *
17
+ * - its tasks, run on the helpers under the interposer, allocated nothing, took no lock and made no system call,
18
+ * - the worker really started with the pool (a daemon that does not apply the word decides nothing),
19
+ * - the output is finite and not silent, and the worker lived through the window,
20
+ * - the window took no more xruns than the same window without the pool, and
21
+ * - the server's DSP load, which is the share of the cycle the plugin's block takes, fell to at most
22
+ * {@link POOL_GAIN} of the load without the pool and by at least {@link POOL_MIN_GAIN} points of the cycle (a plugin
23
+ * with next to nothing to do has too little to run in parallel for a ratio to mean anything).
24
+ *
25
+ * A plugin that is measured and fails any of these gets `pool=off`: the word says it was looked at. A machine that could
26
+ * not run the step decides nothing, and the sync tries again.
27
+ */
28
+ import { spawnSync } from "node:child_process";
29
+ import { existsSync } from "node:fs";
30
+ import { availableParallelism } from "node:os";
31
+ import { join } from "node:path";
32
+ import { ADMIT_STEP_MS_ENV, CLAP_QUALIFY_TOOL_NAME, ISOLATED_SIGNAL_TOOL_ENV, ISOLATED_SIGNAL_TOOL_NAME, RT_INTERPOSE_NAME } from "./qualify-declarations.js";
33
+ import { ISOLATED_RESULT, RUN_STEP, baseSteps, pinFromRecord, runIdOf } from "./qualify-isolated.js";
34
+ import { startPrivateJack } from "./qualify-adapter-pass.js";
35
+ import { locateNativeTool, toolsDir } from "./tool-paths.js";
36
+ import { writeFileWhole } from "./whole-file.js";
37
+ /** The name of the step in a record's run. It is not one of `RUN_STEP`: a record is complete without it (a plugin that does not ask for the pool, or a machine that cannot run the step, has none). */
38
+ export const POOL_STEP = "pool";
39
+ /** The server's DSP load with the pool may be at most this fraction of the load without it. */
40
+ export const POOL_GAIN = 0.85;
41
+ /**
42
+ * The load must also fall by at least this many points of the cycle. The server's load has a floor of its own (the signal
43
+ * client, the ports, the worker's routing), so a plugin with next to nothing to do can fall by a good ratio of a small
44
+ * difference, and a pool for it would cost the cores it holds.
45
+ */
46
+ export const POOL_MIN_GAIN = 3;
47
+ /**
48
+ * The pool's helpers must have been on a cpu this many nanoseconds in the busiest window with the pool (20 ms of a 3 s
49
+ * window, across all of them): a worker that holds the pool and whose plugin asks for tasks every block keeps them
50
+ * busy for a good part of it, and a few microseconds is a start-up, not a pool at work.
51
+ */
52
+ export const POOL_HELPERS_IDLE_NS = 20_000_000;
53
+ export const POOL_RESULT = { cores: "cores", off: "off", notAsked: "not-asked", notRun: "not-run" };
54
+ /** Why the step decided what it did, or why it could not run. */
55
+ export const POOL_CODE = {
56
+ noHost: "pool.no-host",
57
+ noServer: "pool.no-private-server",
58
+ notAdded: "pool.not-added",
59
+ windowFailed: "pool.window-failed",
60
+ unwatched: "pool.not-watched",
61
+ notRtSafe: "pool.not-rt-safe",
62
+ notApplied: "pool.not-applied",
63
+ crashed: "pool.crashed-with-pool",
64
+ unsafeOutput: "pool.unsafe-output",
65
+ xruns: "pool.more-xruns",
66
+ notFaster: "pool.not-faster",
67
+ helpersIdle: "pool.helpers-idle",
68
+ };
69
+ function figuresOf(run) {
70
+ const { off, on, rt } = run;
71
+ const watched = rt === undefined ? {} : { allocationsOn: rt.allocations, locksOn: rt.locks, syscallsOn: rt.syscalls, tasksOnHelpers: rt.tasksOnHelpers };
72
+ const timed = off?.dspLoad === undefined || on?.dspLoad === undefined ? {} : { dspLoadOff: off.dspLoad, dspLoadOn: on.dspLoad, xrunsOff: off.xruns ?? 0, xrunsOn: on.xruns ?? 0 };
73
+ return Object.keys(watched).length === 0 && Object.keys(timed).length === 0 ? undefined : { ...watched, ...timed };
74
+ }
75
+ /** The decision table of the step, with the figures it took. Pure. */
76
+ export function judgePoolRun(run) {
77
+ const step = (result, code, detail) => {
78
+ const pool = figuresOf(run);
79
+ return { step: POOL_STEP, result, ...(code === undefined ? {} : { code }), ...(detail === undefined ? {} : { detail }), ...(pool === undefined ? {} : { pool }) };
80
+ };
81
+ if (!run.started)
82
+ return step(POOL_RESULT.notRun, POOL_CODE.noHost, run.problem);
83
+ if (run.asks === false)
84
+ return step(POOL_RESULT.notAsked);
85
+ // the plugin on helper threads comes first: a plugin that allocates or locks there is refused the pool whatever it gains,
86
+ // and one nobody could watch there decides nothing
87
+ const { rt } = run;
88
+ if (rt === undefined || rt.tasksOnHelpers < 1)
89
+ return step(POOL_RESULT.notRun, POOL_CODE.unwatched, run.problem ?? "the plugin's tasks were not seen on helper threads under the interposer");
90
+ if (rt.allocations + rt.locks + rt.syscalls > 0) {
91
+ return step(POOL_RESULT.off, POOL_CODE.notRtSafe, `${String(rt.allocations)} allocations, ${String(rt.locks)} locks and ${String(rt.syscalls)} system calls while its tasks ran on ${String(rt.helpers)} helper threads`);
92
+ }
93
+ if (run.added !== true)
94
+ return step(POOL_RESULT.notRun, POOL_CODE.notAdded, run.problem);
95
+ const { off, on } = run;
96
+ // the window without the pool is the reference: a plugin that does not even run alone says nothing about the pool
97
+ if (off === undefined || off.problem !== undefined || off.alive !== true || off.finite !== true)
98
+ return step(POOL_RESULT.notRun, POOL_CODE.windowFailed, off?.problem ?? "the window without the pool did not run");
99
+ if (on === undefined)
100
+ return step(POOL_RESULT.notRun, POOL_CODE.windowFailed, "the window with the pool did not run");
101
+ if (run.poolApplied !== true)
102
+ return step(POOL_RESULT.notRun, POOL_CODE.notApplied, "the daemon did not start the worker with the thread pool");
103
+ if (on.alive !== true)
104
+ return step(POOL_RESULT.off, POOL_CODE.crashed, on.problem);
105
+ if (on.problem !== undefined)
106
+ return step(POOL_RESULT.notRun, POOL_CODE.windowFailed, on.problem);
107
+ if (on.finite !== true || on.silent !== false)
108
+ return step(POOL_RESULT.off, POOL_CODE.unsafeOutput);
109
+ // the worker held the pool and its helpers ran nothing: the plugin's requests never reached them, so the window with the
110
+ // pool measured the window without it again, and no gain was seen because there was nothing to see
111
+ if (on.helperBusyNs !== undefined && on.helperBusyNs < POOL_HELPERS_IDLE_NS)
112
+ return step(POOL_RESULT.off, POOL_CODE.helpersIdle, "the worker's pool helpers ran no task in the window with the pool");
113
+ if ((on.xruns ?? 0) > (off.xruns ?? 0))
114
+ return step(POOL_RESULT.off, POOL_CODE.xruns);
115
+ if (off.dspLoad === undefined || on.dspLoad === undefined)
116
+ return step(POOL_RESULT.notRun, POOL_CODE.windowFailed, "the server's load was not read");
117
+ if (on.dspLoad > off.dspLoad * POOL_GAIN || off.dspLoad - on.dspLoad < POOL_MIN_GAIN)
118
+ return step(POOL_RESULT.off, POOL_CODE.notFaster);
119
+ return step(POOL_RESULT.cores);
120
+ }
121
+ /** The pool word a step grants, or `undefined` for a step that decided nothing or granted none. */
122
+ export function poolWordOf(step) {
123
+ if (step?.step !== POOL_STEP)
124
+ return undefined;
125
+ return step.result === POOL_RESULT.cores ? "cores" : step.result === POOL_RESULT.off ? "off" : undefined;
126
+ }
127
+ /** The pool step of a run, if it has one. */
128
+ export function poolStepOf(run) {
129
+ return run?.steps.find((s) => s.step === POOL_STEP);
130
+ }
131
+ /** The pin once the step has spoken: its pool word follows the step, and a step that decided nothing leaves none. A refused pin carries none. Pure. */
132
+ export function pinAfterPool(pin, step) {
133
+ if (pin === undefined)
134
+ return undefined;
135
+ const { pool: _had, ...rest } = pin;
136
+ const word = poolWordOf(step);
137
+ return word === undefined || pin.verdict === "refused" ? rest : { ...rest, pool: word };
138
+ }
139
+ /** Whether a step ended with a decision: `not-run` is the machine's, and the sync asks again. */
140
+ export const poolDecided = (s) => s.step === POOL_STEP && s.result !== POOL_RESULT.notRun;
141
+ /**
142
+ * Whether a record owes the pool step: a CLAP plugin judged in a pass with steps, not refused, with no decided pool step.
143
+ * A record from before the steps owes the isolated step first, which gives it a run; the pool is for a plugin that runs,
144
+ * and a refused one never is.
145
+ */
146
+ export function owesPool(record) {
147
+ if (record.plugin.format !== "clap" || record.run === undefined)
148
+ return false;
149
+ const steps = record.run.steps;
150
+ if (steps.some(poolDecided))
151
+ return false;
152
+ if (steps.some((s) => s.step === RUN_STEP.isolated && s.result === ISOLATED_RESULT.refused))
153
+ return false;
154
+ return record.verdicts.some((v) => v.measured && v.rating !== "unsuitable");
155
+ }
156
+ /** How long each window plays, and what the step may take beyond the two: the host's start and its answers. */
157
+ const POOL_WINDOW_MS = 3000;
158
+ const POOL_ROUNDS = 2;
159
+ const POOL_STEP_SLACK_MS = 120000;
160
+ /** Whether the plugin of a `clap:<path>#<id>` uri offers clap.thread-pool, by the prober's own `--asks-thread-pool`; `undefined` when it could not be asked. */
161
+ export function asksForPool(prober, uri, env) {
162
+ const m = /^clap:(.*)#([^#]*)$/s.exec(uri);
163
+ if (m === null)
164
+ return undefined;
165
+ const r = spawnSync(prober, ["--asks-thread-pool", m[1], m[2]], { encoding: "utf8", timeout: 60000, killSignal: "SIGKILL", env: { ...env } });
166
+ if (r.status !== 0)
167
+ return undefined;
168
+ try {
169
+ return JSON.parse(r.stdout).threadPool === true;
170
+ }
171
+ catch {
172
+ return undefined;
173
+ }
174
+ }
175
+ /** The most helper threads the prober's pool makes (`POOL_HELPERS_MAX` in native/clap-qualify.c). */
176
+ const POOL_HELPERS_MAX = 7;
177
+ /** How many blocks the prober's sweeps run: the sync's own, so a plugin that needs a few blocks to settle is seen settled. */
178
+ const WATCH_BLOCKS = 512;
179
+ /**
180
+ * What the plugin does on helper threads: the prober run with a real pool of one helper per core of this process's set but
181
+ * one (at most seven), under the interposer, which counts what any thread does while a sweep runs. The pool must have
182
+ * been used: a run whose tasks all ran on the calling thread saw nothing of the helpers.
183
+ */
184
+ export function watchOnHelpers(prober, interposer, uri, cell, env) {
185
+ const m = /^clap:(.*)#([^#]*)$/s.exec(uri);
186
+ if (m === null)
187
+ return { problem: `${uri} is no clap uri` };
188
+ const helpers = Math.min(POOL_HELPERS_MAX, availableParallelism() - 1);
189
+ if (helpers < 1)
190
+ return { problem: "this machine has one core, and a pool of one core is no pool" };
191
+ const preload = [interposer, env["LD_PRELOAD"]].filter((x) => x !== undefined && x !== "").join(" ");
192
+ const r = spawnSync(prober, ["--rates", String(cell.rate), "--block", String(cell.quantum), "--blocks", String(WATCH_BLOCKS), "--pool", String(helpers), m[1], m[2]], {
193
+ encoding: "utf8",
194
+ timeout: 120000,
195
+ killSignal: "SIGKILL",
196
+ env: { ...env, LD_PRELOAD: preload },
197
+ });
198
+ if (r.error !== undefined || r.status !== 0)
199
+ return { problem: `${CLAP_QUALIFY_TOOL_NAME} --pool: ${r.error?.message ?? `exit ${String(r.status)}`}` };
200
+ const line = r.stdout.split("\n").filter((l) => l.startsWith("{")).pop();
201
+ if (line === undefined)
202
+ return { problem: `${CLAP_QUALIFY_TOOL_NAME} --pool printed no line` };
203
+ try {
204
+ const doc = JSON.parse(line);
205
+ const sweeps = [doc.rtSafety, doc.noteSweep].filter((x) => x?.interposer === true);
206
+ if (doc.rtSafety?.interposer !== true)
207
+ return { problem: "the interposer did not load in the prober" };
208
+ const sum = (key) => sweeps.reduce((n, x) => n + (x?.[key] ?? 0), 0);
209
+ return { rt: { helpers, tasksOnHelpers: doc.threadPool?.tasksOnHelpers ?? 0, allocations: sum("allocationsInRun"), locks: sum("locksInRun"), syscalls: sum("syscallsInRun") } };
210
+ }
211
+ catch {
212
+ return { problem: `${CLAP_QUALIFY_TOOL_NAME} --pool printed no JSON` };
213
+ }
214
+ }
215
+ /** The step as it runs on a device: a private server at the cell, and `tools/pool-step.mjs` under it. */
216
+ export function spawnedPoolRunner(jack = startPrivateJack) {
217
+ return (uri, cell, env) => {
218
+ const prober = locateNativeTool(CLAP_QUALIFY_TOOL_NAME, env, existsSync).path;
219
+ if (prober === undefined)
220
+ return { started: false, problem: `no ${CLAP_QUALIFY_TOOL_NAME}` };
221
+ // a plugin that does not offer the pool is not worth a JACK server and a daemon: ask the plugin first
222
+ const asks = asksForPool(prober, uri, env);
223
+ if (asks === undefined)
224
+ return { started: false, problem: `${uri} could not be asked for clap.thread-pool` };
225
+ if (!asks)
226
+ return { started: true, asks: false };
227
+ // then what it does on helper threads, which needs no server: a plugin that allocates there is refused without one
228
+ const interposer = locateNativeTool(RT_INTERPOSE_NAME, env, existsSync).path;
229
+ if (interposer === undefined)
230
+ return { started: true, asks: true, problem: `no ${RT_INTERPOSE_NAME}` };
231
+ const watched = watchOnHelpers(prober, interposer, uri, cell, env);
232
+ if (!("rt" in watched))
233
+ return { started: true, asks: true, problem: watched.problem };
234
+ if (watched.rt.tasksOnHelpers < 1 || watched.rt.allocations + watched.rt.locks + watched.rt.syscalls > 0)
235
+ return { started: true, asks: true, rt: watched.rt };
236
+ const signal = locateNativeTool(ISOLATED_SIGNAL_TOOL_NAME, env, existsSync).path;
237
+ if (signal === undefined)
238
+ return { started: false, problem: `no ${ISOLATED_SIGNAL_TOOL_NAME}` };
239
+ const server = jack(cell);
240
+ if (server === undefined)
241
+ return { started: false, problem: `${POOL_CODE.noServer} at ${String(cell.rate)}/${String(cell.quantum)}` };
242
+ try {
243
+ const r = spawnSync(process.execPath, [join(toolsDir(), "pool-step.mjs"), uri, String(POOL_WINDOW_MS)], {
244
+ encoding: "utf8",
245
+ timeout: 2 * POOL_ROUNDS * POOL_WINDOW_MS + POOL_STEP_SLACK_MS,
246
+ killSignal: "SIGKILL",
247
+ env: { ...env, JACK_DEFAULT_SERVER: server.name, [ISOLATED_SIGNAL_TOOL_ENV]: signal },
248
+ });
249
+ if (r.error !== undefined || r.status !== 0)
250
+ return { started: false, problem: `pool-step: ${r.error?.message ?? `exit ${String(r.status)}`}: ${(r.stderr ?? "").trim()}` };
251
+ return { ...JSON.parse(r.stdout), asks: true, rt: watched.rt };
252
+ }
253
+ finally {
254
+ server.stop();
255
+ }
256
+ };
257
+ }
258
+ /** The step's environment: each of its commands has the sync's budget. */
259
+ export const poolEnv = (env, budgetS) => ({ ...env, [ADMIT_STEP_MS_ENV]: String(budgetS * 1000) });
260
+ /**
261
+ * The steps of a run with the pool step added or replaced: a step that could not run takes the place of an earlier one
262
+ * that could not, and a decided step is never replaced here.
263
+ */
264
+ export function withPoolStep(steps, step) {
265
+ return [...steps.filter((s) => s.step !== POOL_STEP), step];
266
+ }
267
+ /**
268
+ * The pin a record can give back to a plugin whose state lost it: what {@link pinFromRecord} gives, with the pool word
269
+ * of the record's pool step.
270
+ */
271
+ export function pinFromRecordWithPool(record) {
272
+ return pinAfterPool(pinFromRecord(record), poolStepOf(record.run));
273
+ }
274
+ /**
275
+ * The missing pool step of a record already judged: the run keeps its id and gains the step, and nothing else is
276
+ * measured. `undefined` when it owes none, or has no run id to extend. Writes the record whole.
277
+ */
278
+ export function completePool(path, record, uri, cell, runner, env) {
279
+ if (!owesPool(record))
280
+ return undefined;
281
+ const id = runIdOf(record, join(path, ".."));
282
+ if (id === undefined)
283
+ return undefined;
284
+ const step = judgePoolRun(runner(uri, cell, env));
285
+ const run = { id, steps: withPoolStep(record.run?.steps ?? baseSteps(record), step) };
286
+ const next = { ...record, run };
287
+ writeFileWhole(path, `${JSON.stringify(next, null, 2)}\n`);
288
+ return { record: next, step };
289
+ }
290
+ //# sourceMappingURL=qualify-pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualify-pool.js","sourceRoot":"","sources":["../src/qualify-pool.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,sDAAsD;AACtD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9J,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAoB,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,uMAAuM;AACvM,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAEhC,+FAA+F;AAC/F,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC;AAE9B;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAE/B;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;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A2B;IAC/D,OAAO,YAAY,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,MAA2B,EAAE,GAAW,EAAE,IAAc,EAAE,MAAkB,EAAE,GAAiD;IACxK,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7C,IAAI,EAAE,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACvC,MAAM,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;IAClD,MAAM,GAAG,GAAa,EAAE,EAAE,EAAE,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;IAChG,MAAM,IAAI,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC;IAChC,cAAc,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3D,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAChC,CAAC"}
@@ -33,6 +33,7 @@ import { probeTarget, ProbeRunnerError } from "./probe-runner.js";
33
33
  import { proberOffer } from "./clap-qualify.js";
34
34
  import { IN_PROCESS_TIER_HOST, ISOLATED_TIER_HOST, QUALIFICATION_RECORD_SCHEMA, memoryOfCell, tiersOf, unmeasuredWordOf, verdictRows, } from "./qualification-record.js";
35
35
  import { ISOLATED_RESULT, RUN_STEP, pinAfterStep, provenAlone } from "./qualify-isolated.js";
36
+ import { pinAfterPool, poolStepOf } from "./qualify-pool.js";
36
37
  import { PI_CELLS, PROBE_MEMORY_ONLY_ENV, PROBE_NOTES_ENV } from "./qualify-declarations.js";
37
38
  import { SYNC_STATE_SCHEMA, digestFiles, recordStem } from "./qualify-sync.js";
38
39
  import { writeFileWhole } from "./whole-file.js";
@@ -239,6 +240,12 @@ const readRecord = (path) => {
239
240
  const nameOf = (record) => record.plugin.id;
240
241
  /** A state plugin with the verdict its record now holds for the host: the pin's files stay as they are, only its word follows. */
241
242
  function pluginWithVerdict(plugin, v, run) {
243
+ // the pool word is a figure of the record's pool step, not a rating: a re-judge keeps it
244
+ const judged = pluginWithVerdictOnly(plugin, v, run);
245
+ const step = poolStepOf(run);
246
+ return judged.pin === undefined || step === undefined ? judged : { ...judged, pin: pinAfterPool(judged.pin, step) };
247
+ }
248
+ function pluginWithVerdictOnly(plugin, v, run) {
242
249
  const { pin, code: _code, ...rest } = plugin;
243
250
  const word = v.measured ? pinVerdictOf(v.rating) : undefined;
244
251
  // a rating does not make a plugin isolated: a run seen alone does, and a re-judge measures nothing. A record from before