Skip to content

feat!: use patch structures for configurations and events - #64

Closed
google-labs-stitch[bot] wants to merge 3 commits into
mainfrom
stitch/feat/config-and-event-patches-jm1-35acd4fd-8752-417a-bf02-45c806951c9b
Closed

google-labs-stitch[bot] wants to merge 3 commits into
mainfrom
stitch/feat/config-and-event-patches-jm1-35acd4fd-8752-417a-bf02-45c806951c9b

Conversation

@google-labs-stitch

Copy link
Copy Markdown
Contributor

Summary

This pull request adds shared *Patch structures, JSON-safe numbers, unified scale modes and WebAssembly helpers across the Rust, WebAssembly and TypeScript APIs.

  • Patch structures and builders: Add Copy *Patch types (ProcessorPatch, CorrectionPatch, ResynthesisPatch, HarmonyPatch, PitchPatch, FormantPatch, PunchPatch, WarmPatch, AlienPatch and ReverbPatch) with Option<T> fields, new(), with_* builders, From<*Patch> for *Config and merge_patch on all configuration structures.
  • Processor and Wasm configuration updates: Accept ProcessorPatch in Processor::new and new Tunelet, and add Processor::update_config and Tunelet.updateConfig with atomic stack validation before state changes.
  • JSON-safe numbers: Change ResynthesisConfig::random_seed and ResynthesisPatch::random_seed to u32, remove tsify(large_number_types_as_bigints) and serialize processedFrames in Feedback and Telemetry as number saturated at Number.MAX_SAFE_INTEGER.
  • Non-destructive timed event patches: Add Patch, ResynthesisPatch, PunchPatch, WarmPatch, AlienPatch and ReverbPatch variants to ControlEvent, and simulate sequential merges on a stack copy in ValidatedEvents::new.
  • Scale parity and MIDI helpers: Expand CorrectionScale with all seven HarmonyScale modes, implement From<HarmonyScale> for CorrectionScale and HarmonyScale::note_mask, and export noteMaskFromKeyScale and parseMidiBytes in the WebAssembly and TypeScript entry points.

Verification

  • cargo build --locked --release
  • cargo fmt --check
  • cargo clippy --locked --lib -- -D warnings
  • cargo doc --locked --no-deps
  • npm run build
  • Verified sample-exact PCM parity against pre-change FNV-1a hashes, zero real-time heap allocations in Rust, multi-event non-destructive block patches, JSON.stringify support, HarmonicMinor B4 (71.0) pitch tracking and parseMidiBytes validation.

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

- Add Copy patch types and builders for all stages.
- Merge validated patches in Processor::new and update_config.
- Add non-destructive patch variants to ControlEvent.
- Change ResynthesisConfig::random_seed to u32.
- Serialize Wasm frame counts as JavaScript numbers.
- Add all seven HarmonyScale modes to CorrectionScale.
- Export updateConfig, noteMaskFromKeyScale and parseMidiBytes in Wasm.
- Keep the asynchronous Wasm import in src/index.ts.
- Pass the frame count and active configuration in Processor::validate.
- Update the ResynthesisPatch::harmony_gain documentation for mono mode.
- Merge release 0.3.1 and the CI workflows from main.
- Keep the formant and pitch updates from main.
@byteland-app

Copy link
Copy Markdown
Contributor

Closing as superseded by #122 (for partial config patches) and #61 (for scalar events). This PR bundles breaking random_seed (u64 -> u32) and processedFrames (bigint -> number) changes that break downstream consumers, and validates partial patches against ProcessorConfig::default() instead of the active config.

@byteland-app
byteland-app deleted the stitch/feat/config-and-event-patches-jm1-35acd4fd-8752-417a-bf02-45c806951c9b branch November 25, 2026 08:06
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Acknowledged. This pull request stays closed because #122 and #61 supersede it, and no further changes were made to this branch.

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