Skip to content

feat!: add pitch fields to Telemetry and trim Wasm voice slices - #104

Merged
byteland-app merged 5 commits into
mainfrom
stitch/unify-pitch-telemetry-trim-voice-slices-jm1-18e3aa25-2cee-4064-9e61-f0efda192548
Nov 26, 2026
Merged

byteland-app merged 5 commits into
mainfrom
stitch/unify-pitch-telemetry-trim-voice-slices-jm1-18e3aa25-2cee-4064-9e61-f0efda192548

Conversation

@google-labs-stitch

@google-labs-stitch google-labs-stitch Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add resample_ratio, period_samples, frequency_hz, target_midi_note and voiced from Feedback to Telemetry and populate them in Processor::telemetry.
  • Mark Telemetry with #[non_exhaustive] so future telemetry fields are non-breaking after the 0.4.0 release.
  • Keep 16-entry stack arrays on Telemetry in Rust so Telemetry stays Copy without heap allocation, and add Telemetry::active_voice_ratios and Telemetry::active_voice_gains slice methods.
  • Customize Wasm serialization of Telemetry in src/wasm.rs to copy only 0..voice_count active entries into Float32Array values via Float32Array::new_with_length and Float32Array::copy_from, and preserve serde::Serialize and serde::Deserialize parity on wasm32.
  • Update tsify annotations on Telemetry so TypeScript declarations export voiceRatios and voiceGains as Float32Array.
  • Normalize the new Telemetry intra-doc links and Default prose note in scripts/normalize-jsdoc.mjs and check Telemetry JSDoc and Float32Array declarations in scripts/verify-pack.mjs.
  • Update rustdoc comments and README.md in ASD-STE100 Simplified Technical English, and keep Processor::feedback, Processor::take_feedback and rendered fixed-point PCM unchanged.

Verification

Telemetry Wasm boundary and parity verification

  • Passed cargo fmt --check, cargo clippy --locked --lib -- -D warnings, cargo build --locked --release, RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps, cargo package --locked, RUSTDOCFLAGS="-D warnings" npm run check:wasm, npm run verify:pack, npm run verify:pack -- --ignore-scripts and MSRV 1.88 host + wasm32 checks.
  • Verified bit-exact PCM and f32 output at 44.1 kHz and 48 kHz against main across Choir, Harmony, humanize / flex_tune, Punch, Warm, Formant, Alien, Reverb and drain cycles.
  • Verified Processor::telemetry and Tunelet.prototype.telemetry match Feedback on all five pitch fields, keep independent peak windows and return Float32Array slices of length voiceCount (1 in default Choir, 5 in Harmony, 16 in 16-voice Choir).
  • Verified Wasm import traces at voiceCount === 1: __wbg_set_bea140a88be9b277 drops from 34 to 2 (outputPeak only), __wbg_* calls drop from 52 to 29 (31 vs 96 including cast intrinsics; 31 vs 119 for single-call takeEngineReport), takeTelemetry() drops from 4.55 us/call to 1.64 us/call and 50 Hz engine report reads drop from 6.14 us/call to 1.78 us/call.

Automated PR initiated by user @byteland-app via Stitch Loop.

- Add the five Feedback pitch fields to Telemetry
- Populate the pitch fields in Processor::telemetry
- Add active_voice_ratios and active_voice_gains on Telemetry
- Serialize active Wasm voices into Float32Array slices
- Type voiceRatios and voiceGains as Float32Array in TypeScript
- Update the telemetry rustdoc and README.md
@byteland-app

Copy link
Copy Markdown
Contributor

Review: High-value change — unifying pitch fields into Telemetry and trimming Wasm voice slices to Float32Array cuts Telemetry overhead ~2.8x and avoids redundant feedback() calls in downstream apps. Target this for the 0.4.0 breaking window, and please add #[non_exhaustive] to Telemetry while making this breaking change so future telemetry fields are non-breaking.

- Merge main at 0.3.3 into the feature branch
- Keep Object and Reflect imports in src/wasm.rs
- Combine pitch and mono peak notes in src/lib.rs
- Combine voice slice and mono peak notes in README.md
- Add #[non_exhaustive] to Telemetry in src/processor.rs
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Added #[non_exhaustive] to Telemetry in src/processor.rs (c8b52ef) so future telemetry fields are non-breaking. With feat!: on the PR title and commits against main (0.3.3 with bump-minor-pre-major: true in release-please-config.json), release-please targets this change for the 0.4.0 breaking release window.

@byteland-app

Copy link
Copy Markdown
Contributor

Round 2 review: Approved for the 0.4.0 breaking window — Telemetry #[non_exhaustive] and trimmed Float32Array voice slices look great. Please rebase onto updated main (after #135; also add rustdoc link mappings in normalize-jsdoc.mjs once #107 lands).

- Merge main at 0.3.4 into the feature branch
- Keep ControlActivity and Telemetry in src/wasm.rs
- Combine ControlActivity and Telemetry notes in src/lib.rs
- Combine ControlActivity and voice slice notes in README.md
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Merged updated main (0.3.4 at 720690b, after #135, #123, #105, and #120) into this branch in ac5b3a5:

  • Resolved conflicts with #135 (README.md, src/lib.rs, src/processor.rs, src/wasm.rs): Combined ControlActivity (control_activity() / controlActivity()) with Telemetry's pitch fields, active_voice_ratios() / active_voice_gains() accessors, and trimmed Float32Array voiceRatios / voiceGains slices in ASD-STE100.
  • Verified CI, MSRV 1.88, and 0.3.4 parity: Passed cargo fmt --check, cargo clippy --locked --lib -- -D warnings, RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps, cargo package --locked, RUSTDOCFLAGS="-D warnings" npm run check:wasm, npm run verify:pack (both unscoped and scoped 0.3.4 archives, HTTP Wasm loaders, and strict TypeScript profiles), MSRV 1.88 host + wasm32 builds, and bit-exact PCM parity against 0.3.4.
  • Note on #107: #107 has not landed on main yet (scripts/normalize-jsdoc.mjs is not on main). Once #107 lands, the five Telemetry intra-doc links to map in EXACT_REPLACEMENTS are [Feedback::resample_ratio], [Feedback::period_samples], [Feedback::frequency_hz], [Feedback::target_midi_note], and [period_samples](Self::period_samples) (alongside Telemetry's Default gives a snapshot with all zeros and no target. prose line).

@byteland-app

Copy link
Copy Markdown
Contributor

Round 3 review: Approved for 0.4.0 — Telemetry #[non_exhaustive], pitch fields, and trimmed Float32Array voice slices are verified. Please rebase onto updated main after #107 (adding normalize-jsdoc.mjs mappings for the new Telemetry rustdoc links).

- Merge main into the feature branch
- Map the five Telemetry rustdoc links in normalize-jsdoc.mjs
- Remove the Default prose line of Telemetry in normalize-jsdoc.mjs
- Check Telemetry JSDoc and Float32Array types in verify-pack.mjs
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Synced with updated main (0850e25, after #107, #117, and #45) and added the Telemetry JSDoc mappings in 5a5c103:

  • scripts/normalize-jsdoc.mjs: Added EXACT_REPLACEMENTS mappings for [period_samples](Self::period_samples) (periodSamples), [Feedback::resample_ratio] (Feedback.resampleRatio), [Feedback::period_samples] (Feedback.periodSamples), [Feedback::frequency_hz] (Feedback.frequencyHz), and [Feedback::target_midi_note] (Feedback.targetMidiNote), plus a PROSE_REPLACEMENTS rule stripping `Default` gives a snapshot with all zeros and no target. on Telemetry.
  • scripts/verify-pack.mjs: Added Telemetry runtime, multi-profile TypeScript (voiceRatios: Float32Array, voiceGains: Float32Array), and normalized JSDoc checks across both tunelet and @bytelandtechnology/tunelet archives.
  • Verification: Passed cargo fmt --check, cargo clippy --locked --lib -- -D warnings, RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps, cargo package --locked, RUSTDOCFLAGS="-D warnings" npm run check:wasm, npm run verify:pack (and --ignore-scripts), MSRV 1.88 host + wasm32 builds, and bit-exact PCM / f32 parity against 0850e25.

@byteland-app
byteland-app merged commit 66d372b into main Nov 26, 2026
7 checks passed
google-labs-stitch Bot added a commit that referenced this pull request Nov 26, 2026
- Merge upstream main with #139, #131, #104 and #61.
- Guard vibrato_preserve updates in Resynthesis::apply_config.
- Drop the duplicate PeriodFilter::configure call after new.
- Taper the vibrato modulation ratio with the flex_tune pull.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant