Skip to content

Adopt the DspTap FIR substrate via submodule#40

Merged
tap merged 1 commit into
mainfrom
claude/ideas-discussion-w2z93w
Jul 23, 2026
Merged

Adopt the DspTap FIR substrate via submodule#40
tap merged 1 commit into
mainfrom
claude/ideas-discussion-w2z93w

Conversation

@tap

@tap tap commented Jul 23, 2026

Copy link
Copy Markdown
Owner

The adoption half of M0 in the RatioTap plan (Appendix B), following tap/DspTap#5: SampleRateTap now consumes the shared design/format/kernel/measurement layer from DspTap instead of carrying it privately. Net −820 lines. The MuTap fft.h re-export shim is the pattern throughout, so every historical include path and name keeps compiling.

What changed

  • Submodule: submodules/dsptap pinned at the substrate-extraction merge (98abb04); tap::dsp linked into the SampleRateTap::SampleRateTap INTERFACE target. All workflow checkouts now use submodules: recursive (the MuTap convention); the SessionStart hook already ran submodule init.
  • srt/detail/kaiser.h → re-export shim: tap::samplerate::detail names unchanged.
  • srt/sample_traits.h → refinement: each specialization derives from the tap::dsp format core and adds the ASRC-specific blend stratum (make_blend_factor, blend_factor_from_q64, blend — the mu-interpolation machinery a fixed-ratio converter has no use for, which is why it stays here). The sample_type concept states the full combined contract; detail::round_sat/clamp_sat re-exported.
  • srt/polyphase_filter.h → dot kernels consumed from tap::dsp via using-declarations (SRT_* macro names forwarded to the TAP_DSP_* gates, including the SRT_CP_MIN_CHANNELS override); the bank constructor's inline largest-remainder correction replaced by tap::dsp::quantize_row_preserving_sum. The bank, mu-blend functions, and fractional_resampler are untouched.
  • tests/support/ analysis headers → shims over tap::dsp::analysis; the srt_test names keep working.
  • Book: 21 anchor includes repointed to the submodule paths (Kaiser design, dot kernels, row-sum quantization, the moved sample-traits regions, the multitone/sine instruments). Every remaining {{#include}} verified to resolve against its anchors — the book CI's stale-anchor gate re-verifies. The sample-traits and optimization chapters now show the refinement/relocated code where their anchors moved; a prose pass over those chapters is deliberately out of scope here so the diff stays mechanical.

Behavior change: none — and how that's proven

  • Full test suite green under GCC and clang -Werror (73/73 both — includes the SNR quality suites, DC-gain exactness, and multichannel bit-exactness tests, which would catch any arithmetic drift).
  • scripts/tidy.sh clean over the affected TUs; clang-format clean.
  • The icount CI gates (±3% on Cortex-M33/M55/Hexagon) run on this PR and are the strongest proof the relocation costs nothing on the hot path: identical kernels, now included from the submodule, must land inside the committed baselines.

One reviewable nuance: the bank constructor now accumulates each row's exact sum in storage (tap-reversed) order rather than prototype order inside the shared utility. The per-tap quantization and largest-remainder scan are order-identical; only the llround input can differ in the last ulp, which the DC-gain and row-sum tests bound to the same one-LSB guarantee as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ldeq57sBySx2nFTQsGcQB6


Generated by Claude Code

SampleRateTap now consumes the shared design/format/kernel/measurement
layer from DspTap (submodules/dsptap, pinned at the substrate-extraction
merge) instead of carrying it privately — the M0 adoption step of the
RatioTap plan, following the MuTap fft.h re-export pattern throughout:

- submodules/dsptap + tap::dsp linked into the INTERFACE target; every
  workflow checkout now fetches submodules recursively.
- srt/detail/kaiser.h -> re-export shim (tap::samplerate::detail names
  unchanged for existing includes).
- srt/sample_traits.h -> refinement: each specialization derives from
  the tap::dsp format core and adds the ASRC-specific blend stratum
  (make_blend_factor, blend_factor_from_q64, blend); the sample_type
  concept states the full combined contract. detail::round_sat/
  clamp_sat re-exported.
- srt/polyphase_filter.h -> dot kernels consumed from
  tap::dsp::fir_kernels (SRT_ macro names forwarded to the TAP_DSP_
  gates); the bank constructor's inline largest-remainder correction
  replaced by tap::dsp::quantize_row_preserving_sum.
- tests/support analysis headers -> shims over tap::dsp::analysis.
- Book: 21 anchor includes repointed to the submodule paths (kaiser
  design, dot kernels, row-sum quantization, moved sample-traits
  regions, multitone/sine instruments); every remaining include
  verified to resolve.

Behavior change: none. Full suite green under GCC and clang -Werror
(73/73 both), clang-tidy clean; the icount CI gates (+-3% on M33/M55/
Hexagon) are the final proof the relocation costs nothing on the hot
path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ldeq57sBySx2nFTQsGcQB6
@tap
tap merged commit 5315689 into main Jul 23, 2026
32 checks passed
@tap
tap deleted the claude/ideas-discussion-w2z93w branch July 23, 2026 13:18
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.

2 participants