Skip to content

build(deps): bump tract to ^0.21.15#685

Open
czoli1976 wants to merge 1 commit intoRikorose:mainfrom
czoli1976:ship-upstream/tract-0.21.15-bump
Open

build(deps): bump tract to ^0.21.15#685
czoli1976 wants to merge 1 commit intoRikorose:mainfrom
czoli1976:ship-upstream/tract-0.21.15-bump

Conversation

@czoli1976
Copy link
Copy Markdown

Summary

Bumps libDF's tract pin from ^0.21.4 to ^0.21.15. Picks up the items called out in #682:

  • 0.21.6 — first WASM-specific f32 4×4 SIMD kernel (the wasm32 path was scalar before this)
  • 0.21.8 — MMM kits for matmul + element-wise binary op optimisations
  • 0.21.10 — reduce optimisations affecting modern normalisation layers
  • 0.21.11 — slice-bubbling + improved gather with compressed inputs
  • 0.21.12 — explicit multithread-mm feature flag in tract-linalg

Why two source patches alongside the manifest bump

tract introduced two non-semver-compatible API changes within the 0.21.x patch line, so this can't be a manifest-only bump:

  1. Graph::symbol_tableGraph::symbols (introduced 0.21.6) — 3 call sites in libDF/src/tract.rs.

  2. ndarray re-export drifttract-core re-exports a newer ndarray than the standalone ndarray crate at libDF's current pin. Fixed by routing the ndarray import through tract_core::ndarray (using use tract_core::ndarray::{self, prelude::*, …}; so the self alias keeps every later ndarray::* reference resolving against tract's re-export). Five files: tract.rs, wasm.rs, transforms.rs, wav_utils.rs, bin/enhance_wav.rs. Avoids E0308 type-mismatch errors at the libDF ↔ tract API boundary (Axis, prelude::*, ShapeError).

Both renames are mechanical and bit-equivalent.

Test plan — addresses the validation framing in #682

  • Native build: cargo check -p deep_filter --features tract,default-model clean on macOS + cargo 1.95.0. Pre-existing warnings only — no errors, no new warnings.
  • WASM build: wasm-pack build libDF --target no-modules --release --features wasm succeeds. Final wasm-opt -Oz output is 9.13 MiB vs 8.28 MiB on the 0.21.4 baseline (+10.3%; expected, MMM kits + first WASM SIMD kernel codegen).
  • Numerical quality (WASM): DNSMOS P.835 scores on a 30-clip VoiceBank+DEMAND subset are bit-identical to 0.21.4 — SIG=2.9947 BAK=3.6512 OVR=2.6339 P808=3.5753, all four match to all reported decimals.
  • Numerical quality (native CLI): deep-filter binary on the same 30-clip subset produces DNSMOS P.835 scores bit-identical to 0.21.4 — SIG=3.5662 BAK=4.1302 OVR=3.3237 P808=3.8365.
  • Native RTF (CLI): 0.184 mean (0.21.15) vs 0.195 mean (0.21.4). The 0.21.x kernel work primarily targets WASM, so native gain is modest and partly cargo-profile noise.
  • Cross-version sweep also tested 0.21.5 / 0.21.6 / 0.21.12 — DNSMOS bit-equivalence holds across all of them. 0.21.15 chosen as the latest stable patch in the line.

The validation gates this PR matches #682's ask: DNSMOS-based quality validation on a representative corpus, no audio-quality regression (the concern from the 2023 0.19 → 0.20 revert in #405), conservative caret pin (^0.21.15) so the minimum-version bound stays in 0.21.x.

Caveats

  • API breaks within a patch series: the two source patches are required because tract introduced API renames inside 0.21.x without a minor-version bump. The diff is small and mechanical; happy to split into one commit per concern (ndarray refactor / symbol_table rename / Cargo.toml + lockfile bump) if you prefer that shape for review.
  • Cargo.lock: included since libDF tracks it. Lockfile churn is dependency-resolution only — no logic changes.
  • 0.22.x not attempted in this PR. A future bump to 0.22.x is a larger conversation (additional API surface changes, kernel-kit work in flight at sonos/tract). Keeping this PR scoped to staying within the 0.21.x line.

Refs #682.

Bumps libDF's tract pin from ^0.21.4 to ^0.21.15, picking up the
WASM f32 4x4 kernel (0.21.6), MMM kits (0.21.8), reduce optimisations
(0.21.10), slice-bubbling improvements (0.21.11), and the
multithread-mm feature flag (0.21.12).

Two minimum-viable libDF source patches accompany the manifest bump
because tract introduced two non-semver-compatible API changes within
the 0.21.x patch line:

  * Graph::symbol_table -> Graph::symbols (introduced 0.21.6)
    — 3 call sites in libDF/src/tract.rs.

  * tract-core re-exports a newer ndarray than the standalone ndarray
    crate at libDF's current pin. Fixed by routing the ndarray import
    through tract_core::ndarray (with the `self` alias) in five files,
    keeping libDF aligned with whatever ndarray version tract-core
    chooses internally. Avoids E0308 type-mismatch errors at the libDF
    ↔ tract API boundary (Axis, prelude::*, ShapeError).

Validated against the 0.21.4 baseline on a 30-clip VoiceBank+DEMAND
subset:

  * DNSMOS P.835 scores BIT-IDENTICAL across native + WASM
    (SIG / BAK / OVR / P808 all match to all reported decimals)
  * Native CLI mean RTF: 0.184 (0.21.15) vs 0.195 (0.21.4) — modest
    native gain
  * WASM size delta: 8.28 MiB -> 9.13 MiB (+10.3%, expected — MMM
    kits + first WASM SIMD kernel codegen)

Refs Rikorose#682.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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