Skip to content

native inference: restore authoritative full-value faithfulness gates before FIFO fusion #170

Description

@sydneyrenee

Problem

The production graph is native, Candle-free, and capable of real speech generation, but its strongest component-level numerical evidence is disconnected:

  • crates/liquid-audio/native/tests/fixtures/{mel,resample,conformer} have no live consumers;
  • designs 05 and 06 cite tests/native_frontend_parity.rs and tests/native_conformer_parity.rs, but neither file exists;
  • the real-checkpoint E2E compares native runs to deterministic native runs, not to an authoritative independent trace;
  • detokenizer_payload_math_is_owned_by_paired_assembly proves symbol hygiene, not numerical parity or register chaining.

Deterministic, intelligible audio can still hide formula, rounding, layout, state, or sampling drift. Register-FIFO fusion must not proceed without executable full-value evidence.

Contract

  • Do not restore a Rust/Candle production model, Rust safetensors loader, tensor bridge, or competing inference path.
  • Generate/reference traces offline from the authoritative model implementation, then consume immutable fixtures from native-only tests.
  • A “tensor” in fixture metadata is only a typed byte/shape/stride description.
  • Tests must compare complete values at semantically meaningful boundaries, not only final tokens or PCM.
  • Each fixture records checkpoint revision, source implementation revision, dtype, shape, strides/layout, input digest, output digest, tolerances, and precision/reduction contract.
  • Faithfulness and bit-exactness are distinct: every boundary declares which is required.

Required traces

Frontend

  • resampler output;
  • preemphasis/window input;
  • STFT/power rows;
  • mel rows before and after log;
  • per-feature statistics;
  • normalized BF16 output and valid frame count.

Conformer and adapter

  • subsampling output;
  • positional embedding;
  • every layer output;
  • representative first-layer FFN, attention, and convolution intermediates;
  • adapter output and valid-row geometry.

Backbone and recurrence

  • embeddings/modality assembly;
  • every layer hidden output;
  • KV append and ShortConv carry;
  • logits;
  • cursor/state after prefill and consecutive decode passes.

Sampler and Depthformer

  • top-k threshold and tie order;
  • lane maxima/sums/prefix intervals;
  • draw target and PRNG before/after;
  • selected text/audio token;
  • every Depthformer layer/codebook output and feedback embedding.

LFM2.5 audio detokenizer

  • fused code embedding;
  • each nearest-exact/operator/FFN block boundary;
  • terminal spectral representation;
  • polar complex spectrum;
  • overlap-add/envelope state;
  • full PCM over consecutive frames.

Work

  1. Inventory the provenance of every existing fixture; do not delete unexamined evidence.
  2. Reject fixtures whose generator/checkpoint/layout cannot be proven.
  3. Add native fixture readers that validate manifests before comparison.
  4. Wire mel/resample/Conformer fixtures into executable native tests.
  5. Capture missing backbone/sampler/Depthformer/detokenizer traces from the authoritative implementation outside the production graph.
  6. Rename the detokenizer symbol-hygiene test to describe only what it proves.
  7. Correct design 05/06 status headers and every claim citing nonexistent gates.
  8. Run these gates before and after every numerical/FIFO tranche under native inference: remove residual C++ numerical fallbacks and materialized scratch #158.

Acceptance

  • Every retained fixture has complete provenance and a validated manifest.
  • Existing mel, resample, and Conformer fixtures are consumed or explicitly rejected with rationale.
  • Full-value native tests cover frontend, Conformer, backbone, sampler, Depthformer, detokenizer, and retained recurrence.
  • Tests fail on intentional layout, rounding, state, and token-selection perturbations.
  • No Rust/Candle inference path enters production or the test execution graph.
  • The real-checkpoint gate remains green after fixture wiring.
  • Designs claim only gates that exist and run.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions