Add the shared FIR substrate carried from SampleRateTap - #5
Merged
Conversation
Five headers under include/tap/dsp/, extracted so RatioTap (the second
consumer) and SampleRateTap share one implementation of the layer above
the converter engines:
- kaiser.h: Kaiser prototype design (bessel_i0, kaiser_beta,
estimate_taps, design_prototype, design_prototype_compensated with
zeros at k*fs and droop pre-compensation), plus solve_dense.
- sample_traits.h: the sample-format core for float/Q15/Q31 FIR
datapaths (coefficient Q formats, exact int64 accumulation, single
saturating rounding) and the tap::dsp::sample_type concept. Format
core only: engine-specific extensions (e.g. SampleRateTap's
inter-phase blend) derive from these and refine the concept.
- fir_kernels.h: dot_row (with the SMLALD dual-MAC Q15 path for
DSP-extension Arm cores), dot_tile_frame_major/dot_rows_frame_major
(register-blocked channel-parallel kernels, bit-exact vs planar),
target gates renamed SRT_* -> TAP_DSP_*.
- quantize.h: row-sum-preserving coefficient quantization
(largest-remainder), refactored out of SampleRateTap's bank ctor.
- analysis/{sine,multitone}_analysis.h: the measurement instruments
(LS sine fit + tracked variant; pink tone comb, joint multitone fit,
program-weighted SNR) promoted from tests/support.
Contract batteries ported and extended (45 new tests): prototype specs
pinned at SampleRateTap's shipping preset numbers plus a non-power-of-two
L=147 design, Q-format/rounding/saturation contracts, planar vs
channel-parallel bit-exactness across the 8/4/2/1 tiling, exact row sums
over a designed prototype, and instrument floors on exact synthetic
tones.
README gains the substrate section (including the fixed-point roadmap:
Q15/Q31 as first-class embedded profiles for M33/M55-class targets,
traits over raw sample types rather than wrapper classes) and the
second-consolidation provenance note; CLAUDE.md's discipline clause is
extended to cover the fixed-point profiles. Also deletes a stray
committed a.out.
Behavioral change: none — every function is carried verbatim from
SampleRateTap apart from namespaces, macro prefixes, and comment
provenance; SampleRateTap adopts this via submodule in a follow-up PR
whose icount gates prove the move costs nothing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ldeq57sBySx2nFTQsGcQB6
The solve_dense verification loop indexed the saved matrix with an int: clang's -Wconversion implies -Wsign-conversion (GCC's does not in C++), so the macos-vdsp job failed under -Werror while linux-ooura passed. Index with std::size_t. Verified locally with a clang -Werror build of the full test suite, which also covers the TUs the failed CI run never reached. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ldeq57sBySx2nFTQsGcQB6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M0 of the RatioTap plan (Appendix A): DspTap gains the shared layer that sits above the converter engines, extracted from SampleRateTap at the moment RatioTap became its second consumer — the same extract-on-second-consumer rule that created this repo.
What moves in
Five headers under
include/tap/dsp/, each with a ported/extended contract battery (45 new tests; suite runs 96):kaiser.hbessel_i0,kaiser_beta,estimate_taps,design_prototype,design_prototype_compensated(zeros at k·fs, droop pre-compensated),solve_densesample_traits.htap::dsp::sample_typeconceptfir_kernels.hdot_row(planar; SMLALD dual-MAC Q15 path on DSP-extension Arm),dot_tile_frame_major/dot_rows_frame_major(register-blocked channel-parallel). Macro gates renamedSRT_*→TAP_DSP_*quantize.hquantize_row_preserving_sum(largest-remainder row-sum preservation), refactored out of SampleRateTap's bank constructor into a free functionanalysis/sine_analysis.h(LS fit, tracked variant,snr_db) andmultitone_analysis.h(pinktone_comb, joint multitone fit,program_weighted_snr_db) fromtests/support/What deliberately does not move
blend_factor,blend_factor_from_q64,blend): mu-interpolation machinery coupled to the ASRC's Q0.64 phase accumulator. It stays in SampleRateTap as a refinement layered on this core (RatioTap has no blend at all — exact phases are its point).Docs and policy
a.out.Behavior change: none
Every function is carried verbatim apart from namespaces,
TAP_DSP_macro prefixes, and comment provenance.ANCHOR:markers are preserved where regions moved wholesale, so SampleRateTap's book can repoint its includes at the submodule path in the follow-up adoption PR — whose unchanged icount baselines (±3% CI gate on M33/M55/Hexagon) will prove the relocation costs nothing on the hot path.Verified locally: full suite green (96/96) with
-DTAP_DSP_WERROR=ON,scripts/tidy.shclean over the new TUs, clang-format pre-commit clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ldeq57sBySx2nFTQsGcQB6
Generated by Claude Code