Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
0ef2b26
sgv2-core: spp3 open-loop thermal unit on a split-invariant block clock
RyanTheTide Nov 4, 2026
ac23488
sgv2-lv2: load the unit from the parameter blob, engine page, bench
RyanTheTide Nov 4, 2026
b30b415
sgv2-lv2: name the unit accessor unit()
RyanTheTide Nov 4, 2026
07278ac
supervisor: the kernel interface for "Speaker Protection"
RyanTheTide Nov 4, 2026
0240e82
sgv2-lv2: test-blob and engine-probe tools for graph bring-up
RyanTheTide Nov 4, 2026
34f93d4
spp3: look-ahead in the model path, start state, measured-power meter
RyanTheTide Nov 4, 2026
bd1c0bc
spp3: per-sample gain smoothing, undelayed power, immediate hard path
RyanTheTide Nov 4, 2026
794b0c7
spp3 tests: the hard path is 20 dB at once
RyanTheTide Nov 4, 2026
4df0a36
lsm2: model-only loudspeaker manager
RyanTheTide Nov 4, 2026
a08cfac
atsp: audio-only two-node thermal protection
RyanTheTide Nov 4, 2026
8c27ec9
Merge branch 'v2-B/engine' into v2-B/supervisor
RyanTheTide Nov 4, 2026
da50e9d
atsp: simplify the slot validation for clippy
RyanTheTide Nov 4, 2026
e70ded2
supervisor: observation, tick and the 10 ms loop on the Kernel trait
RyanTheTide Nov 4, 2026
eb8c52b
atsp: simplify the slot validation for clippy
RyanTheTide Nov 4, 2026
ba05166
Merge v2 into v2-B/engine
RyanTheTide Nov 4, 2026
2e35057
Merge v2-B/engine into v2-B/supervisor
RyanTheTide Nov 4, 2026
612c890
spp3: the feed-forward predictor law from the specification
RyanTheTide Nov 4, 2026
3776b8d
atsp host-block mode; lsm2 runtime power budgets
RyanTheTide Nov 4, 2026
c6adba9
Merge branch 'v2-B/engine' into v2-B/supervisor
RyanTheTide Nov 4, 2026
7b34541
packaging: the session side of the v2 speaker graph
RyanTheTide Nov 4, 2026
a47ae90
supervisor: session file, granted flag, systemd notification
RyanTheTide Nov 4, 2026
5764482
spp3: closed-loop resistance thermometry and the corrected limit
RyanTheTide Nov 4, 2026
c9408ac
Merge remote-tracking branch 'origin/v2-B/supervisor' into v2-D/session
RyanTheTide Nov 4, 2026
c175ea1
Merge remote-tracking branch 'origin/v2-B/engine' into v2-D/session
RyanTheTide Nov 4, 2026
062d1a4
sgv2-core: adversarial property tests
RyanTheTide Nov 4, 2026
c989c79
Merge v2-B/engine into v2-B/live
RyanTheTide Nov 4, 2026
29dfcc8
session: never block the report, keep the protect stage running
RyanTheTide Nov 4, 2026
2624d49
packaging: drop a stray Python cache file
RyanTheTide Nov 4, 2026
e60046f
Merge v2-D/session into v2-B/live
RyanTheTide Nov 4, 2026
bedf1c0
spp3: publish the V/I sense window diagnostics; bring-up probes
RyanTheTide Nov 4, 2026
0a2e4ad
Run confined under the packaged unit: SELinux, report access, report …
RyanTheTide Nov 4, 2026
78e64e4
core: a fail-safe output that is finite and bounded for any input
RyanTheTide Nov 4, 2026
b91228d
sgv2-core: cargo-fuzz targets
RyanTheTide Nov 4, 2026
34d4a78
Merge remote-tracking branch 'origin/v2-B/engine' into v2-T/engine-fuzz
RyanTheTide Nov 4, 2026
5be9a7a
core: hold the program to full scale and latch the fail-safe on a non…
RyanTheTide Nov 4, 2026
209f7af
spp3: refuse a non-finite speed-up factor; hold 20 dB on the hard pat…
RyanTheTide Nov 4, 2026
f9d2b08
supervisor: proof of a live engine, the card's identity and operating…
RyanTheTide Nov 4, 2026
06273fe
Merge v2-D/session into v2-B/supervisor: the review fixes
RyanTheTide Nov 4, 2026
03e4ae1
spp3: a lost sense bus invalidates the closed loop at once
RyanTheTide Nov 4, 2026
2ea4aa5
spp3: validate every range process uses at load; no clamp on the RT t…
RyanTheTide Nov 4, 2026
d86d406
lsm2: refuse mitigation off, no thermal axis, and latency below 256 f…
RyanTheTide Nov 4, 2026
0d7ee6c
supervisor: grant from a prepared PCM, keep the quantum across reacti…
RyanTheTide Nov 4, 2026
6d5c076
Merge v2-D/session into v2-B/supervisor: B2's cold-start fixes
RyanTheTide Nov 4, 2026
3e3f775
core: test that no input ever leaves above the input times the allowe…
RyanTheTide Nov 4, 2026
9718502
core, lv2: hand the thermal state to the next stream instead of reset…
RyanTheTide Nov 4, 2026
660f33d
spp3: the candidate ratio floor is 1e-4 (-40 dB), as specified
RyanTheTide Nov 4, 2026
3e21dbf
spp3: SafeTlim, 64007 start state, pilot gates, pilot-tone closed loo…
RyanTheTide Nov 4, 2026
e27dde8
supervisor: peak full scale per channel, wake on XRUN, grace after a …
RyanTheTide Nov 4, 2026
63e3060
Merge v2-D/session into v2-B/supervisor: peak full scale, XRUN wake, …
RyanTheTide Nov 4, 2026
2019965
Merge v2-B/engine (engine safety fixes) into v2-B5/spp3-complete
RyanTheTide Nov 4, 2026
7d39a79
Merge v2-B/engine (660f33d engine safety fixes) into v2-B/live
RyanTheTide Nov 4, 2026
e6b0080
sgv2-core: adapt the adversarial tests to the 256-frame spp3
RyanTheTide Nov 4, 2026
c53de61
Merge remote-tracking branch 'origin/v2-B/engine' into v2-T/engine-fuzz
RyanTheTide Nov 4, 2026
9bd2846
spp3: cap the closed-loop correction at the base until t-4663
RyanTheTide Nov 4, 2026
a1f8645
spp3: the Daybreak task for the CL cap is t-4668
RyanTheTide Nov 4, 2026
05dc537
sgv2-core, sgv2-lv2: run the adversarial tests against the safety fixes
RyanTheTide Nov 4, 2026
484d406
session: J616s sense without batch handling, speaker headroom 256
RyanTheTide Nov 4, 2026
6b0b0e3
supervisor: CAP_SYS_ADMIN for "Speaker Protection", re-grant after a …
RyanTheTide Nov 4, 2026
db32abc
Merge v2-D/session into v2-B/supervisor: sgv2k2 capability and resume
RyanTheTide Nov 4, 2026
ab0b2c4
Merge v2-B/j616-graph: J616s sense without batch handling, speaker he…
RyanTheTide Nov 4, 2026
80bf9ba
Merge v2-D/session (6b0b0e3 + J616s graph fix) into v2-B/live
RyanTheTide Nov 4, 2026
e85e2e1
Merge v2-B/j616-graph: pause the speaker sink while unlinked
RyanTheTide Nov 4, 2026
02a6b3a
session: pause the speaker sink while it is unlinked
RyanTheTide Nov 4, 2026
88f0947
Merge v2-D/session into v2-B/live
RyanTheTide Nov 4, 2026
ce9b207
sgv2-core: the steady-state hard-limit check is an observation
RyanTheTide Nov 4, 2026
0c063db
sgv2-core: pin the closed-loop slicing dependence (aarch64)
RyanTheTide Nov 4, 2026
46aba32
supervisor: reopen the engine page after a restart (0660, group root)
RyanTheTide Nov 4, 2026
b8a1001
Merge v2-D/session into v2-B/supervisor: engine page reopen after res…
RyanTheTide Nov 4, 2026
1a9ea31
spp3: rig laws 1-6: invTempCo, Rshunt-net T_CL, pilot generator, cand…
RyanTheTide Nov 4, 2026
d6f9574
spp3: refuse parameter sets outside physical ranges
RyanTheTide Nov 4, 2026
8b75078
Merge v2-D/session (46aba32 engine page reopen) into v2-B/live
RyanTheTide Nov 4, 2026
17f468a
core: meter the program unclamped up to 16 FS; only the output is hel…
RyanTheTide Nov 4, 2026
f74e05b
lv2: a missing program port fails safe instead of leaving stale outputs
RyanTheTide Nov 4, 2026
a3c7240
spp3: Float32 pilot Goertzel and smoothed-R range test (rig law a); h…
RyanTheTide Nov 4, 2026
a6b367b
lsm2: the specified temperature knee, and a backstop at TemperatureHa…
RyanTheTide Nov 4, 2026
873039b
blob-info: print the closed-loop window and smoothing per channel
RyanTheTide Nov 4, 2026
3432988
spp3: non-finite sense is open loop, and never stops the delay estimator
RyanTheTide Nov 4, 2026
65c7d81
spp3, atsp: the meter-failure region no longer depends on host slicing
RyanTheTide Nov 4, 2026
68ac03e
spp3: closed-loop window sums in a LaneAcc, bit-identical across slicing
RyanTheTide Nov 4, 2026
afcd163
lv2: the engine page reports a non-finite active gain as NaN, not unity
RyanTheTide Nov 4, 2026
b3d0f9c
spp3: fused Float32 Goertzel, block-ahead sense, the +-1.5 FS input c…
RyanTheTide Nov 4, 2026
ceaec16
atsp: generate the gain curve as frames are processed, not a block ahead
RyanTheTide Nov 4, 2026
29ac279
spp3: lift the closed-loop cap: T_CL is bit-exact on the CL goldens
RyanTheTide Nov 4, 2026
554b30e
Merge branch 'v2-B/engine' into b5-merge
RyanTheTide Nov 4, 2026
03fb4fa
Merge remote-tracking branch 'origin/v2-B5/spp3-complete' into b5-merge
RyanTheTide Nov 4, 2026
4c6c1ec
spp3: AudioUnitReset keeps the corrected-limit smoother; inactive unt…
RyanTheTide Nov 4, 2026
8fc4d8b
tests: hold six adversarial oracles that predate the B5 spp3 laws
RyanTheTide Nov 4, 2026
c120c22
Merge remote-tracking branch 'origin/v2-B5/spp3-complete' into b5-merge
RyanTheTide Nov 4, 2026
5f64d60
spp3: each render call starts the dezipper at the selected target
RyanTheTide Nov 4, 2026
803be11
session: J616s sense headroom 512, so a late cycle does not shift the…
RyanTheTide Nov 4, 2026
54673fa
Merge v2-B/j616-graph: J616s sense headroom 512
RyanTheTide Nov 4, 2026
0b6482c
Merge v2-D/session into v2-B/live
RyanTheTide Nov 4, 2026
8c88ecb
Merge remote-tracking branch 'origin/v2-B5/spp3-complete' into v2-B5/…
RyanTheTide Nov 4, 2026
c42c38f
spp3: refuse thermal time constants below 0.1 s; slice tests follow t…
RyanTheTide Nov 4, 2026
5aa2382
supervisor: a NaN or non-finite engine gain is a fault
RyanTheTide Nov 4, 2026
a61bfef
Merge v2-D/session into v2-B/supervisor: NaN gain is a fault
RyanTheTide Nov 4, 2026
247335a
Merge v2-D/session (5aa2382 min-gain check) into v2-B/live
RyanTheTide Nov 4, 2026
3f24e70
Merge v2-B/engine (afcd163) into v2-B/live
RyanTheTide Nov 4, 2026
ec2f716
spp3: SafeTlim counts from a full seed; a restored hold does not re-t…
RyanTheTide Nov 4, 2026
806fc1e
tests: rt_alloc counts only the calling thread's allocations
RyanTheTide Nov 4, 2026
78dd7da
Merge v2-B/engine (thread-local rt_alloc counter) into v2-B5/spp3-com…
RyanTheTide Nov 4, 2026
e6a7d34
spp3: the rig's meter definitions for TlimAdj and the part gains
RyanTheTide Nov 4, 2026
85daf58
spp3: T_CL starts from RdcScale * R_cal; any finite pilot levels
RyanTheTide Nov 4, 2026
51be4bd
spp3: the thermal update cadence scales with the sample rate
RyanTheTide Nov 4, 2026
ba2fa48
spp3: the thermal nodes in Float32 with the reference's fused recurrence
RyanTheTide Nov 4, 2026
01479ef
session: J316 and J413 channel order, V/I pairs and sense headroom
RyanTheTide Nov 4, 2026
4d14beb
Merge v2-B6/session: J316 and J413 channel order, V/I pairs and sense…
RyanTheTide Nov 4, 2026
3381b4d
supervisor, session: a report counts only from a live helper and engi…
RyanTheTide Nov 4, 2026
53e878f
Merge v2-D/session into v2-B/supervisor: live-helper reports
RyanTheTide Nov 4, 2026
0d71471
Merge v2-D/session into v2-B/live: B6 channel order and V/I, live-hel…
RyanTheTide Nov 4, 2026
35f24ce
spp3: AudioUnitReset also restarts the pilot generator
RyanTheTide Nov 4, 2026
9d38028
session: unlink the amps and the sense before the helper exits
RyanTheTide Nov 4, 2026
435dee0
Merge v2-D/session into v2-B/supervisor: helper unlinks on stop
RyanTheTide Nov 4, 2026
c811fd1
Merge v2-D/session into v2-B/live: helper unlinks on stop
RyanTheTide Nov 4, 2026
2b8a92c
Merge v2-B/engine (806fc1e, thread-local rt_alloc counter) into v2-B/…
RyanTheTide Nov 4, 2026
3d610aa
spp3: the feed-forward node above 1000 K holds the hard path, no re-seed
RyanTheTide Nov 4, 2026
4b6e022
Merge v2-B5/spp3-complete into v2-B/live
RyanTheTide Nov 4, 2026
ab36b6e
spp3: cap the closed-loop correction at the base again (J616s incident)
RyanTheTide Nov 4, 2026
e09126d
supervisor, session: a late helper report no longer drops the audio
RyanTheTide Nov 4, 2026
6d5c47a
Merge v2-D/session into v2-B/supervisor: late helper report tolerance
RyanTheTide Nov 4, 2026
75797c0
Merge v2-D/session into v2-B/live: late helper report tolerance
RyanTheTide Nov 4, 2026
33e78bc
Merge v2-B/live into v2-D/session: B5's thermal hand-off (spp3-comple…
RyanTheTide Nov 4, 2026
34554b2
thermal state across engine and PipeWire restarts
RyanTheTide Nov 4, 2026
a9f07e0
Merge v2-D/session into v2-B/supervisor: thermal state across restarts
RyanTheTide Nov 4, 2026
16551e3
Merge v2-B5/spp3-complete into v2-D/session: the closed-loop relaxati…
RyanTheTide Nov 4, 2026
f2fbd68
Merge v2-D/session into v2-B/supervisor: the closed-loop relaxation cap
RyanTheTide Nov 4, 2026
a0bd99e
supervisor: a helper verdict that never reads torn, a reader that is …
RyanTheTide Nov 4, 2026
12d1702
Merge v2-D/session into v2-B/supervisor: tear-free helper verdict
RyanTheTide Nov 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions crates/sgv2-bench/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "sgv2-bench"
description = "CPU benchmark of the sgv2 units: time per channel per quantum"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
rust-version.workspace = true
publish = false

[dependencies]
sgv2-core = { path = "../sgv2-core", features = ["std"] }

[lints]
workspace = true
224 changes: 224 additions & 0 deletions crates/sgv2-bench/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
//! `sgv2-bench`: wall-clock cost of each unit's `process`, per quantum and
//! per channel per quantum, at the quantum sizes PipeWire runs.
//!
//! Parameters are synthetic (no Mac's tuning): the cost of spp3 does not
//! depend on the values, only on the channel count and the code path, and
//! the drive is chosen so the limiter is engaged (the slowest path).
//!
//! Usage: `sgv2-bench [seconds-per-case] [--json]`.

use std::time::Instant;

use sgv2_core::{lsm2, placeholder, spp3, FailSafe, Health, Io, ProtectionUnit, UnitKind};

const RATE: u32 = 48_000;

fn spp3_params(n: usize) -> spp3::Params {
let mut p = spp3::Params {
channels: n as u32,
sample_rate: RATE,
block_frames: 512,
thermal_ambient_temp: 40.0,
thermal_gain_attack_time_s: 1.0,
thermal_gain_release_time_s: 5.0,
thermal_lookahead_delay_ms: 2.0,
thermal_protection_enabled: 1,
..spp3::Params::default()
};
for c in 0..n {
p.ch[c] = spp3::ChannelParams {
source: c as u32,
group: (c / 4) as u32,
t_sett_vc: 20.0,
t_sett_mg: 20.0,
tau_tvc: 1.0,
tau_tmg: 50.0,
temperature_limit: 100.0,
hard_temp_limit_headroom: 5.0,
reb_ref: 4.0,
rshunt: 0.1,
ag: 10.0,
thermal_ff_speedup_factor: 0.5,
imon_scale: 1.0,
vmon_scale: 10.0,
sense_i: 2 * c as u32,
sense_v: 2 * c as u32 + 1,
..Default::default()
};
}
p
}

fn lsm2_params() -> lsm2::Params {
let mut p = lsm2::Params {
channels: 2,
sample_rate: RATE,
enable_mitigation: 1,
control_sample_peak: 1,
control_displacement: 1,
control_velocity: 1,
control_power: 1,
control_temperature: 1,
link_slow_gains: 1,
model_only: 1,
attack_time_ms: 2.0,
fast_release_time_ms: 150.0,
slow_release_time_ms: 10_000.0,
filterbank_latency_ms: 2.5,
speaker_response_lookahead_ms: 1.0,
power_time_scale_s: [0.002, 0.2, 2.0, 30.0],
power_hard_limit_w: [50.0, 20.0, 2.0, 1.5],
power_soft_limit_pct: [100.0; 4],
max_power_attenuation_db: 4.0,
low_rail_power_ratio: 1.0,
..lsm2::Params::default()
};
for c in 0..2 {
p.ch[c] = lsm2::ChannelParams {
source: c as u32,
volts_full_scale: 6.0,
parasitic_resistance: 0.2,
rdc: 4.0,
bl: 0.8,
mms_kg: 0.0002,
rms: 0.2,
kms: 1500.0,
disp_bl: 0.8,
disp_mms_kg: 0.00022,
disp_rms: 0.25,
disp_kms: 1600.0,
rth_vc: 30.0,
tau_vc: 2.0,
rth_mag: 20.0,
tau_mag: 60.0,
ambient: 40.0,
amplitude_limit: 1.0,
displacement_limit: 0.0005,
velocity_limit0: 0.5,
max_velocity_attenuation_db: 18.0,
temperature_soft_limit: 110.0,
temperature_hard_limit: 125.0,
temperature_headroom: 4.0,
max_temperature_attenuation_db: 10.0,
};
}
p
}

fn noise(n: usize, seed: u32, level: f32) -> Vec<f32> {
let mut s = seed;
(0..n)
.map(|_| {
s = s.wrapping_mul(1664525).wrapping_add(1013904223);
((s >> 8) as f32 / (1u32 << 24) as f32 * 2.0 - 1.0) * level
})
.collect()
}

struct Result {
unit: &'static str,
channels: usize,
sense: usize,
quantum: usize,
calls: usize,
p50_ns: f64,
p99_ns: f64,
max_ns: f64,
mean_ns: f64,
}

fn bench(name: &'static str, unit: &mut dyn ProtectionUnit, n: usize, s: usize, q: usize, seconds: f64) -> Result {
let len = q * 64;
let input: Vec<Vec<f32>> = (0..n).map(|c| noise(len, 11 + c as u32, 0.9)).collect();
let sense: Vec<Vec<f32>> = (0..s).map(|k| noise(len, 101 + k as u32, 0.3)).collect();
let mut output = vec![vec![0.0f32; q]; n];
let calls = ((seconds * RATE as f64) / q as f64) as usize;
let mut t = Vec::with_capacity(calls);
// warm-up: one second of audio, so the limiter is engaged
for k in 0..(RATE as usize / q) {
let off = (k % 64) * q;
let ins: Vec<&[f32]> = input.iter().map(|b| &b[off..off + q]).collect();
let sns: Vec<&[f32]> = sense.iter().map(|b| &b[off..off + q]).collect();
let mut outs: Vec<&mut [f32]> = output.iter_mut().map(|b| &mut b[..]).collect();
unit.process(Io { frames: q, input: &ins, sense: &sns, output: &mut outs });
}
for k in 0..calls {
let off = (k % 64) * q;
let ins: Vec<&[f32]> = input.iter().map(|b| &b[off..off + q]).collect();
let sns: Vec<&[f32]> = sense.iter().map(|b| &b[off..off + q]).collect();
let mut outs: Vec<&mut [f32]> = output.iter_mut().map(|b| &mut b[..]).collect();
let t0 = Instant::now();
let h: Health = unit.process(Io { frames: q, input: &ins, sense: &sns, output: &mut outs });
let dt = t0.elapsed().as_nanos() as f64;
std::hint::black_box(h);
std::hint::black_box(&output);
t.push(dt);
}
let mean = t.iter().sum::<f64>() / t.len() as f64;
t.sort_by(|a, b| a.partial_cmp(b).unwrap());
let pct = |p: f64| t[((t.len() as f64 - 1.0) * p) as usize];
Result {
unit: name,
channels: n,
sense: s,
quantum: q,
calls,
p50_ns: pct(0.5),
p99_ns: pct(0.99),
max_ns: *t.last().unwrap(),
mean_ns: mean,
}
}

fn main() {
let args: Vec<String> = std::env::args().collect();
let seconds: f64 = args.iter().skip(1).find_map(|a| a.parse().ok()).unwrap_or(30.0);
let json = args.iter().any(|a| a == "--json");
let mut results = Vec::new();
for q in [256usize, 512, 1024] {
let mut u = spp3::Unit::new(spp3_params(6));
assert!(!u.is_failsafe());
results.push(bench("spp3", &mut u, 6, 12, q, seconds));
let mut u = spp3::Unit::new(spp3_params(6));
results.push(bench("spp3-no-sense", &mut u, 6, 0, q, seconds));
let mut u = spp3::Unit::new(spp3_params(2));
results.push(bench("spp3", &mut u, 2, 4, q, seconds));
let mut u = lsm2::Unit::new(lsm2_params());
assert!(!u.is_failsafe());
results.push(bench("lsm2", &mut u, 2, 0, q, seconds));
let mut u = placeholder::Unit::new(placeholder::Params { channels: 6, ..Default::default() });
results.push(bench("placeholder", &mut u, 6, 12, q, seconds));
let mut u = FailSafe::new(UnitKind::Spp3, Health::NO_PARAMS);
results.push(bench("failsafe", &mut u, 6, 0, q, seconds));
}
if json {
for r in &results {
println!(
"{{\"unit\":\"{}\",\"channels\":{},\"sense\":{},\"quantum\":{},\"calls\":{},\"mean_ns\":{:.0},\"p50_ns\":{:.0},\"p99_ns\":{:.0},\"max_ns\":{:.0},\"per_channel_p50_ns\":{:.0},\"cpu_pct_of_realtime\":{:.4}}}",
r.unit, r.channels, r.sense, r.quantum, r.calls, r.mean_ns, r.p50_ns, r.p99_ns, r.max_ns,
r.p50_ns / r.channels as f64,
100.0 * r.mean_ns / (r.quantum as f64 / RATE as f64 * 1e9)
);
}
return;
}
println!(
"{:<14} {:>3} {:>5} {:>7} {:>9} {:>9} {:>9} {:>9} {:>11} {:>9}",
"unit", "ch", "sense", "quantum", "mean ns", "p50 ns", "p99 ns", "max ns", "p50 ns/ch", "% RT"
);
for r in &results {
println!(
"{:<14} {:>3} {:>5} {:>7} {:>9.0} {:>9.0} {:>9.0} {:>9.0} {:>11.0} {:>9.4}",
r.unit,
r.channels,
r.sense,
r.quantum,
r.mean_ns,
r.p50_ns,
r.p99_ns,
r.max_ns,
r.p50_ns / r.channels as f64,
100.0 * r.mean_ns / (r.quantum as f64 / RATE as f64 * 1e9)
);
}
}
12 changes: 12 additions & 0 deletions crates/sgv2-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,17 @@ license.workspace = true
authors.workspace = true
rust-version.workspace = true

[features]
# Host-side helpers (blob building); the plugin and the RT path never need it.
std = []

[dependencies]
# Pure-Rust, no_std, correctly rounded sqrt and a portable exp: the same
# results on every target, which the differential rig depends on.
libm = "0.2"

[dev-dependencies]
sgv2-core = { path = ".", features = ["std"] }

[lints]
workspace = true
Loading
Loading