@openmixer/plugin-qualify 0.0.0-stage → 0.3.0

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 (114) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +203 -2
  3. package/bin/plugin-qualify.mjs +77 -0
  4. package/dist/clap-loader.d.ts +147 -0
  5. package/dist/clap-loader.js +252 -0
  6. package/dist/clap-loader.js.map +1 -0
  7. package/dist/clap-qualify.d.ts +126 -0
  8. package/dist/clap-qualify.js +272 -0
  9. package/dist/clap-qualify.js.map +1 -0
  10. package/dist/host-profiles.d.ts +42 -0
  11. package/dist/host-profiles.js +106 -0
  12. package/dist/host-profiles.js.map +1 -0
  13. package/dist/hosting-codes.d.ts +62 -0
  14. package/dist/hosting-codes.js +72 -0
  15. package/dist/hosting-codes.js.map +1 -0
  16. package/dist/hosting-suitability.d.ts +354 -0
  17. package/dist/hosting-suitability.js +654 -0
  18. package/dist/hosting-suitability.js.map +1 -0
  19. package/dist/index.d.ts +17 -0
  20. package/dist/index.js +20 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/loader.d.ts +26 -0
  23. package/dist/loader.js +9 -0
  24. package/dist/loader.js.map +1 -0
  25. package/dist/lv2-loader.d.ts +7 -0
  26. package/dist/lv2-loader.js +50 -0
  27. package/dist/lv2-loader.js.map +1 -0
  28. package/dist/measurement/cli.d.ts +168 -0
  29. package/dist/measurement/cli.js +353 -0
  30. package/dist/measurement/cli.js.map +1 -0
  31. package/dist/measurement/fixtures.d.ts +23 -0
  32. package/dist/measurement/fixtures.js +129 -0
  33. package/dist/measurement/fixtures.js.map +1 -0
  34. package/dist/measurement/format.d.ts +483 -0
  35. package/dist/measurement/format.js +627 -0
  36. package/dist/measurement/format.js.map +1 -0
  37. package/dist/measurement/guards.d.ts +33 -0
  38. package/dist/measurement/guards.js +61 -0
  39. package/dist/measurement/guards.js.map +1 -0
  40. package/dist/measurement/index.d.ts +36 -0
  41. package/dist/measurement/index.js +39 -0
  42. package/dist/measurement/index.js.map +1 -0
  43. package/dist/measurement/merge.d.ts +143 -0
  44. package/dist/measurement/merge.js +315 -0
  45. package/dist/measurement/merge.js.map +1 -0
  46. package/dist/measurement/plan.d.ts +127 -0
  47. package/dist/measurement/plan.js +141 -0
  48. package/dist/measurement/plan.js.map +1 -0
  49. package/dist/measurement/probe-json.d.ts +61 -0
  50. package/dist/measurement/probe-json.js +253 -0
  51. package/dist/measurement/probe-json.js.map +1 -0
  52. package/dist/measurement/provenance.d.ts +91 -0
  53. package/dist/measurement/provenance.js +173 -0
  54. package/dist/measurement/provenance.js.map +1 -0
  55. package/dist/measurement/sweep-jsonl.d.ts +40 -0
  56. package/dist/measurement/sweep-jsonl.js +154 -0
  57. package/dist/measurement/sweep-jsonl.js.map +1 -0
  58. package/dist/measurement/vocabulary.d.ts +125 -0
  59. package/dist/measurement/vocabulary.js +217 -0
  60. package/dist/measurement/vocabulary.js.map +1 -0
  61. package/dist/qualify-cli.d.ts +83 -0
  62. package/dist/qualify-cli.js +224 -0
  63. package/dist/qualify-cli.js.map +1 -0
  64. package/dist/qualify-declarations.d.ts +98 -0
  65. package/dist/qualify-declarations.js +76 -0
  66. package/dist/qualify-declarations.js.map +1 -0
  67. package/dist/qualify-options.d.ts +22 -0
  68. package/dist/qualify-options.js +36 -0
  69. package/dist/qualify-options.js.map +1 -0
  70. package/dist/rating.d.ts +32 -0
  71. package/dist/rating.js +30 -0
  72. package/dist/rating.js.map +1 -0
  73. package/dist/tool-paths.d.ts +12 -0
  74. package/dist/tool-paths.js +29 -0
  75. package/dist/tool-paths.js.map +1 -0
  76. package/fixtures/clap-scan/controls.json +8 -0
  77. package/fixtures/clap-scan/fake.json +16 -0
  78. package/fixtures/clap-scan/mixed.json +18 -0
  79. package/fixtures/zero-path.lv2/manifest.ttl +3 -0
  80. package/fixtures/zero-path.lv2/zero-path.c +85 -0
  81. package/fixtures/zero-path.lv2/zero-path.ttl +21 -0
  82. package/package.json +91 -3
  83. package/src/clap-loader.ts +393 -0
  84. package/src/clap-qualify.ts +387 -0
  85. package/src/host-profiles.ts +122 -0
  86. package/src/hosting-codes.ts +71 -0
  87. package/src/hosting-suitability.ts +982 -0
  88. package/src/index.ts +19 -0
  89. package/src/loader.ts +30 -0
  90. package/src/lv2-loader.ts +50 -0
  91. package/src/measurement/cli.ts +458 -0
  92. package/src/measurement/fixtures.ts +141 -0
  93. package/src/measurement/format.ts +1064 -0
  94. package/src/measurement/guards.ts +64 -0
  95. package/src/measurement/index.ts +39 -0
  96. package/src/measurement/merge.ts +434 -0
  97. package/src/measurement/plan.ts +219 -0
  98. package/src/measurement/probe-json.ts +271 -0
  99. package/src/measurement/provenance.ts +220 -0
  100. package/src/measurement/sweep-jsonl.ts +173 -0
  101. package/src/measurement/vocabulary.ts +298 -0
  102. package/src/qualify-cli.ts +277 -0
  103. package/src/qualify-declarations.ts +117 -0
  104. package/src/qualify-options.ts +49 -0
  105. package/src/rating.ts +53 -0
  106. package/src/tool-paths.ts +32 -0
  107. package/tools/_declarations.py +21 -0
  108. package/tools/benchmark.py +2462 -0
  109. package/tools/gen-python-declarations.d.mts +4 -0
  110. package/tools/gen-python-declarations.mjs +92 -0
  111. package/tools/hosting-sweep.mjs +51 -0
  112. package/tools/lv2-measure.mjs +204 -0
  113. package/tools/lv2_presets.py +132 -0
  114. package/tools/scan.py +432 -0
@@ -0,0 +1,141 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ // Copyright (C) 2026 Pau Aliagas <linuxnow@gmail.com>
3
+ /**
4
+ * Documents the tests build on.
5
+ *
6
+ * Kept in `src/` rather than a test file so every test in this directory shares ONE idea of
7
+ * what a well-formed document looks like — a fixture copied between test files is how two
8
+ * tests end up asserting against two different formats, both of which pass.
9
+ */
10
+
11
+ import type { MeasuredPlugin, MeasurementDocument, MeasurementHost, MeasurementRun } from "./format.js";
12
+ import { buildMeasurementDocument } from "./format.js";
13
+ import type { MeasurementDimension } from "./vocabulary.js";
14
+
15
+ /** A host with every optional field populated — the maximal shape a round trip must survive. */
16
+ export const FIXTURE_HOST: MeasurementHost = {
17
+ hostname: "ref-desk",
18
+ kernel: "7.1.5-200.fc44.x86_64",
19
+ os: "Linux",
20
+ cpuModel: "Intel(R) Core(TM) Ultra 9 275HX",
21
+ cpuCount: 24,
22
+ pinnedCpu: 7,
23
+ pinnedCpuKind: "performance",
24
+ pinnedCpuMaxKHz: 5300000,
25
+ governor: "performance",
26
+ turboEnabled: true,
27
+ realtimePriority: false,
28
+ memoryLocked: false,
29
+ toolchain: { python: "3.14.6" },
30
+ };
31
+
32
+ /** A run record with both method blocks present. */
33
+ export function fixtureRun(overrides: Partial<MeasurementRun> = {}): MeasurementRun {
34
+ return {
35
+ id: "run-ref-2026-07-28",
36
+ measuredAt: "2026-07-28T18:03:03+02:00",
37
+ dimensions: ["latency", "cost"],
38
+ rates: [48000, 96000],
39
+ tool: { name: "lv2-measure", version: "0.1.0" },
40
+ host: FIXTURE_HOST,
41
+ method: {
42
+ latency: {
43
+ method: "impulse-onset",
44
+ blockFrames: 512,
45
+ stimulus: "unit impulse, escalating to a sustained tone",
46
+ paramSweep: true,
47
+ },
48
+ cost: {
49
+ method: "block-time-percentile",
50
+ blockFrames: 512,
51
+ warmupBlocks: 64,
52
+ minTimedBlocks: 64,
53
+ maxTimedBlocks: 512,
54
+ targetSecondsPerPlugin: 0.25,
55
+ percentile: 95,
56
+ stimulus: "sustained 1000 Hz sine at 0.5 full-scale on every audio input",
57
+ controls: "lv2:default on every control input",
58
+ timingFloorNsPerBlock: 32.5,
59
+ },
60
+ },
61
+ elapsedSeconds: 900,
62
+ label: "reference sweep",
63
+ relativeRankingOnly: true,
64
+ note: "A RELATIVE ranking measured on one machine, not a guarantee on any other.",
65
+ ...overrides,
66
+ };
67
+ }
68
+
69
+ /** A fully measured plugin: readings at both rates, on both dimensions. */
70
+ export function fixturePlugin(uri: string, overrides: Partial<MeasuredPlugin> = {}): MeasuredPlugin {
71
+ return {
72
+ uri,
73
+ name: "LSP Compressor Mono",
74
+ version: "1.22",
75
+ bundle: "/usr/lib64/lv2/lsp-plugins.lv2/",
76
+ lv2Class: "Compressor Plugin",
77
+ topology: { audioInputs: 2, audioOutputs: 1, midiInputs: 0, controlInputs: 40 },
78
+ latency: {
79
+ perRate: {
80
+ "48000": { frames: 0, ms: 0 },
81
+ "96000": { frames: 0, ms: 0 },
82
+ },
83
+ scalingClass: "zero",
84
+ declaredPortSymbol: "out_latency",
85
+ declaredFrames: 0,
86
+ },
87
+ cost: {
88
+ perRate: {
89
+ "48000": {
90
+ nsPerSampleMedian: 6.9,
91
+ nsPerSamplePercentile: 7.2,
92
+ nsPerSampleMin: 6.4,
93
+ nsPerSampleMax: 41.1,
94
+ blocks: 512,
95
+ blockFrames: 512,
96
+ warmupNsPerSampleMedian: 12.3,
97
+ },
98
+ "96000": {
99
+ nsPerSampleMedian: 6.95,
100
+ nsPerSamplePercentile: 7.4,
101
+ blocks: 512,
102
+ blockFrames: 512,
103
+ },
104
+ },
105
+ },
106
+ ...overrides,
107
+ };
108
+ }
109
+
110
+ /** A plugin with nothing to measure — an analyser, no audio output. */
111
+ export function fixtureUnmeasurable(uri: string, code = "no-audio-out"): MeasuredPlugin {
112
+ return {
113
+ uri,
114
+ name: "x42 Phase Wheel",
115
+ topology: { audioInputs: 2, audioOutputs: 0 },
116
+ latency: { perRate: {}, unmeasuredReason: code },
117
+ cost: { perRate: {}, unmeasuredReason: code },
118
+ };
119
+ }
120
+
121
+ /** A plugin this run crashed on — a fact about the run, not the plugin. */
122
+ export function fixtureProbeFailure(uri: string): MeasuredPlugin {
123
+ return {
124
+ uri,
125
+ name: "x42 Meter",
126
+ topology: { audioInputs: 2, audioOutputs: 2 },
127
+ latency: { perRate: {}, unmeasuredReason: "probe-crashed", unmeasuredDetail: "worker crashed (SIGABRT)" },
128
+ cost: { perRate: {}, unmeasuredReason: "probe-crashed", unmeasuredDetail: "worker crashed (SIGABRT)" },
129
+ };
130
+ }
131
+
132
+ /** A complete document. */
133
+ export function fixtureDocument(
134
+ plugins: readonly MeasuredPlugin[] = [fixturePlugin("http://lsp-plug.in/plugins/lv2/compressor_mono")],
135
+ run: Partial<MeasurementRun> = {},
136
+ ): MeasurementDocument {
137
+ return buildMeasurementDocument(fixtureRun(run), plugins);
138
+ }
139
+
140
+ /** Both dimensions, for tests that need the list without importing the vocabulary. */
141
+ export const BOTH_DIMENSIONS: readonly MeasurementDimension[] = ["latency", "cost"];