Skip to content

book: the synchronous engines, and the framing for three - #68

Merged
tap merged 3 commits into
mainfrom
claude/sample-rate-expansion-strategies-ezqzu6
Oct 8, 2026
Merged

tap merged 3 commits into
mainfrom
claude/sample-rate-expansion-strategies-ezqzu6

Conversation

@tap

@tap tap commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

What this changes

Three commits.

1. Part VI — The bridge engine (book/src/part6/, four chapters, about 6,400 words):

  1. The degenerate case: 44.1 ↔ 48 as a type — the two asymmetric directions, the rate scale K and its bit-identity, the spec-relaxation argument (nothing folds below 20.1 kHz going down), the profile ladder with its pinned counts and the 38-not-40 quirk, the per-branch normalization that kills the f_out / L spurs.
  2. The phase table and the schedule — the compile-time schedule, the table without the ASRC's blend and extra row, the symmetry halving and why its quantization is canonical over the stored half, the storage budgets.
  3. The converter, and the campaign that made it fast — the contract and call shapes; the three measured codegen levers (superblock walk, committed trip counts, the halving's per-target inlining gate) with their numbers per target; the construction-share finding.
  4. Three legs, and the bridge to the ASRC — scipy, exhaustive phases, the pinned-eps cross-validation relocated from the brief (and why the result not moving between L = 512 and 1024 is the evidence), the Q15 pairing, bluetooth_bridge run on this tree (locked at +200.1 ppm, 997.000 Hz, 72.8 dB, 1.93 ms), the C ABI and the ten-workload ratchet.

2. Part VII — The rational engine (book/src/part7/, six chapters, about 12,000 words): the ratio as a type, the Nyquist design, the two machines of stage.h, chains and the 182-row matrix, the fixed-point ladder with the two lifted Q15 limits and the host-versus-target table traced to the designer, and the proof system, C ABI and levers.

3. The framing for three engines:

  • Title: SampleRateTap: The Story of a Sample Rate Converter Family; the description names the three converters.
  • Introduction: opens on three converters built on one substrate by one method; the honesty clause covers the two new figures; the epilogue's place is stated.
  • Epilogue moves after Part VII, so the book closes on the letter (its chapter count reads thirty-one).
  • Part 0 ends with The rule the family runs on: the three engines as the three clock topologies, and why none has an (in_hz, out_hz) lookup. Part VI opens by pointing back at it.
  • Appendix A gains section 19: the five C++ decisions the synchronous engines added, in the log's own format (the ratio as a type; if constexpr selecting the machine; exact rationals over doubles; quantize once and let symmetry carry the rest; the per-target noinline with its numbers).
  • Glossary: eight entries (commutator, coverage matrix, design divisor, L-th-band filter, mirrored phase, rate scale, structural zero, superblock). Bibliography: Mintzer 1982, Vaidyanathan 1993.
  • Two figures from scripts/book_figures.py, generated from the sources the text cites: alias-zone.svg (bridge's rate arithmetic drawn to scale: the 20.1–22.05 kHz landing zone) and coverage-matrix.svg (the 14 × 14 matrix at economy, read from the rational engine's own generator, the 38 dipping rows marked). The script now takes figure names so these can be re-rendered without the trace tool.
  • Two attributed epigraphs replaced with sourced ones (Dijkstra, EWD 498; Pike, Notes on Programming in C).

Also: anchors (comment-only) in rational's ratio.h, stage.h, chain.h; book-pages.yml rebuilds on rational/include/** and the submodule pointer; rational/README.md's workload count reads fourteen.

Why

The family plan listed the book's engine chapters as follow-up work since the migration. Once the two parts existed, the book's own framing — its title, its opening sentence, its appendices and its honesty clause about figures — described one engine; the third commit makes it describe three. The parts read in the order the machinery was inherited: bridge first, then rational.

Verification

  • mdbook 0.4.40 builds the book with zero warnings (the CI gate); every {{#include}} resolves; CI's image-reference check passes with the two new SVGs.
  • The two figures were rendered and inspected; the matrix's extremes and flag count in the caption (7.8, 551, 38) are read from the generator.
  • The rational battery passes 113/113 on the host (the anchors are comments); clang-format clean.

Notes for the reviewer

  • Not done, deliberately: per-part title pages (mdBook has no part-level page; each part's first chapter carries its problem statement) and chapters for the async-side figures of Parts VI–VII beyond the two above.
  • Part VII's fixed-point chapter describes the DspTap mirror fix that landed this morning, so that chapter and nyquist.h's contract agree.

🤖 Generated with Claude Code

https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA

claude added 2 commits October 8, 2026 12:16
Six chapters in the book's form, header by header with the excerpts
included live by anchor: the ratio as a type and the charter
(ratio.h), the Nyquist design and the profiles (DspTap's nyquist.h,
design.h), the two machines of stage.h, chains and the coverage matrix
(DspTap's chain.h, chain.h), the fixed-point ladder per stage with the
two lifted Q15 limits and the host-versus-target table traced to the
designer's mirror branches, and the proof system, the C ABI and the
levers measured and declined. Each closes with the commands that back
it.

Anchors added to ratio.h, stage.h and chain.h (comment-only; the DspTap
ones came with tap/DspTap#56). SUMMARY and the introduction gain the
part; book-pages.yml rebuilds on rational/include and the submodule
pointer; the README's workload count reads fourteen, the table's.

mdbook 0.4.40 builds the book with no warnings.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA
Four chapters on bridge in the book's form, the excerpts included live
from its headers' anchors: the direction as a type and the rate scale K,
the spec-relaxation argument (nothing folds below 20.1 kHz going down)
and the profile ladder with its pinned counts (the 38-not-40 quirk), the
per-branch normalization that kills the f_out / L spurs; the compile-time
schedule and the phase table without the ASRC's blend and extra row, the
symmetry halving and why its quantization is canonical over the stored
half; the converter's contract and the three measured codegen levers
(the superblock walk, the committed trip counts, the halving's
per-target inlining gate) with the construction-share finding; the
three proof legs, the pinned-eps cross-validation relocated from the
brief, the Q15 pairing, bluetooth_bridge run and measured (1.93 ms,
+200.1 ppm, 72.8 dB), the C ABI and the ratchet.

The rational chapters move from part6/ to part7/ so the parts read in
the order the engines were built and the machinery was inherited;
Part V's bridge section now points at Part VI instead of saying the
code lives in another repository. The introduction describes both.

mdbook 0.4.40 builds the book with no warnings.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA
@tap tap changed the title book: Part VI, the rational engine book: the synchronous engines — Part VI bridge, Part VII rational Oct 8, 2026
…dices, two figures

The title is now the family's (The Story of a Sample Rate Converter
Family); the introduction opens on three converters built on one
substrate by one method, keeps the honesty clause true for the two new
figures, and says where the epilogue sits. The epilogue moves after
Part VII so the book closes on the letter (its chapter count reads
thirty-one). Part 0 ends with the rule the family runs on: the three
engines as the three clock topologies, the lookup that none of them
has. Part VI opens by pointing back at it.

Appendix A gains section 19, the five C++ decisions the synchronous
engines added in the log's own format (the ratio as a type, if
constexpr selecting the machine, exact rationals over doubles,
quantize once and let symmetry carry the rest, the per-target noinline
with its numbers); the glossary gains eight entries (commutator,
coverage matrix, design divisor, L-th-band filter, mirrored phase, rate
scale, structural zero, superblock); the bibliography gains Mintzer
1982 and Vaidyanathan 1993.

Two figures, generated by scripts/book_figures.py from the sources the
text cites: alias-zone.svg, bridge's rate arithmetic drawn to scale
(the 20.1–22.05 kHz landing zone, Part VI chapter 1), and
coverage-matrix.svg, the 14 x 14 matrix at economy read from the
rational engine's own generator with the 38 dipping rows marked
(Part VII chapter 4). The script takes figure names so the two can be
re-rendered without the trace tool. Two attributed epigraphs are
replaced with sourced ones (Dijkstra EWD 498; Pike, Notes on
Programming in C).

mdbook 0.4.40 builds the book with no warnings; CI's image check
passes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA
@tap tap changed the title book: the synchronous engines — Part VI bridge, Part VII rational book: the synchronous engines, and the framing for three Oct 8, 2026
@tap
tap merged commit cdf486d into main Oct 8, 2026
28 checks passed
@tap
tap deleted the claude/sample-rate-expansion-strategies-ezqzu6 branch October 8, 2026 18:30
tap pushed a commit that referenced this pull request Oct 10, 2026
The comparison plan (#73, #75, #76, #77) and its follow-up (#78) closed;
this is the plan for what the family's plans and ledgers still carry
open, sequenced into twelve weeks in three blocks, with "production-ready"
defined as a thirteen-row checklist per engine so the verdict can be
checked rather than believed.

Drafted and then audited by two independent adversarial reviews (one
against the trees' facts and settled decisions, one against engineering
judgement). The audit changed the draft materially: the book's bridge
chapters are done (#68), so they are off the list; rational has no
cross-engine validation by design (scipy and decimate.h are its legs);
TSan runs async only; four host compilers and three QEMU targets, not the
draft's counts; the +1.9 % M55 ratio23_q15_eco drift is ab8fea3's stated
move, not a DspTap bump, and the chain rows sit +926/+1,102; the hardware
block never ran bridge or rational on silicon; nothing builds with
-fno-exceptions; TSan has never seen the converter with two threads; no
footprint, stack or worst-single-call figure exists; Setup 1's "< 1 ppm"
criterion tests the counting, not the servo, and cheap USB dongles may not
own a crystal; the timestamp servo is a four-to-five-week extension, not an
overload, and must not be frozen in the release that adds it; "C ABIs
frozen" needs a reconciled NULL model, an extension rule, SOVERSION and a
compat test. Section 7 holds the six decisions the maintainer takes before
week 1, each with a recommendation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3HxzEGiZp7jStoMuYNuBK
tap pushed a commit that referenced this pull request Oct 10, 2026
The comparison plan (#73, #75, #76, #77) and its follow-up (#78) closed;
this is the plan for what the family's plans and ledgers still carry
open, sequenced into twelve weeks in three blocks, with "production-ready"
defined as a thirteen-row checklist per engine so the verdict can be
checked rather than believed.

Drafted and then audited by two independent adversarial reviews (one
against the trees' facts and settled decisions, one against engineering
judgement). The audit changed the draft materially: the book's bridge
chapters are done (#68), so they are off the list; rational has no
cross-engine validation by design (scipy and decimate.h are its legs);
TSan runs async only; four host compilers and three QEMU targets, not the
draft's counts; the +1.9 % M55 ratio23_q15_eco drift is ab8fea3's stated
move, not a DspTap bump, and the chain rows sit +926/+1,102; the hardware
block never ran bridge or rational on silicon; nothing builds with
-fno-exceptions; TSan has never seen the converter with two threads; no
footprint, stack or worst-single-call figure exists; Setup 1's "< 1 ppm"
criterion tests the counting, not the servo, and cheap USB dongles may not
own a crystal; the timestamp servo is a four-to-five-week extension, not an
overload, and must not be frozen in the release that adds it; "C ABIs
frozen" needs a reconciled NULL model, an extension rule, SOVERSION and a
compat test. Section 7 holds the six decisions the maintainer takes before
week 1, each with a recommendation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3HxzEGiZp7jStoMuYNuBK
tap pushed a commit that referenced this pull request Oct 15, 2026
The roadmap's A10. Each claim below had gone stale against the tree:

- Root PLAN.md: the layout said the book's bridge chapters were
  follow-up work. Part VI, the bridge engine, landed in #68 on 2026-10-08,
  and the rational engine is Part VII. The migration record's "bringing
  async's workloads under clang-tidy is follow-up work" now notes that A2
  did it on 2026-10-12.
- bridge/PLAN.md section 9: the "degenerate case" chapter, "explicitly
  deferred", is struck through and points at Part VI, which was written
  from the ANCHOR: comments the code carried from day one.
- async/PLAN.md: the status line said v0.4.0, but the family is at 0.6.0
  (D13). Roadmap item 1, construction as a ratcheted scenario, is marked
  done: construct_q15 landed on 2026-10-09 in 43f3e29. Item 3, tail
  latency, is marked done in part: A6 gates the worst single pull() in the
  QEMU ratchet, and the host p99/max is Block B's.
- docs/AUDIT_2026-10_PLAN.md: "execution in progress" now reads executed.
  All 35 disposition rows are closed, and S0 to S5 are on main.
- The comparison records: docs/COMPARISON.md ("The shared tooling") and
  each engine's COMPARISON.md (first caveat) state that the competitors are
  frozen by policy at their 2026-10-09 pins. Those are libsamplerate 0.2.2,
  r8brain-free-src 7.6 and SpeexDSP 1.2.1; async's host rows also use the
  Ubuntu 24.04 packages, soxr 0.1.3 among them. A newer competitor release
  is not tracked, and moving a pin re-runs compare.yml and the notebooks
  and re-dates the tables. The generated tables are untouched:
  update_compare_docs.py reproduces them as committed.

The roadmap marks A10 landed. Prose only, so no code, count or ceiling
moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016GKzq1VSdcMYCRMhddiMaf
@tap tap mentioned this pull request Oct 15, 2026
tap pushed a commit that referenced this pull request Oct 15, 2026
The roadmap's A10. Each claim below had gone stale against the tree:

- Root PLAN.md: the layout said the book's bridge chapters were
  follow-up work. Part VI, the bridge engine, landed in #68 on 2026-10-08,
  and the rational engine is Part VII. The migration record's "bringing
  async's workloads under clang-tidy is follow-up work" now notes that A2
  did it on 2026-10-12.
- bridge/PLAN.md section 9: the "degenerate case" chapter, "explicitly
  deferred", is struck through and points at Part VI, which was written
  from the ANCHOR: comments the code carried from day one.
- async/PLAN.md: the status line said v0.4.0, but the family is at 0.6.0
  (D13). Roadmap item 1, construction as a ratcheted scenario, is marked
  done: construct_q15 landed on 2026-10-09 in 43f3e29. Item 3, tail
  latency, is marked done in part: A6 gates the worst single pull() in the
  QEMU ratchet, and the host p99/max is Block B's.
- docs/AUDIT_2026-10_PLAN.md: "execution in progress" now reads executed.
  All 35 disposition rows are closed, and S0 to S5 are on main.
- The comparison records: docs/COMPARISON.md ("The shared tooling") and
  each engine's COMPARISON.md (first caveat) state that the competitors are
  frozen by policy at their 2026-10-09 pins. Those are libsamplerate 0.2.2,
  r8brain-free-src 7.6 and SpeexDSP 1.2.1; async's host rows also use the
  Ubuntu 24.04 packages, soxr 0.1.3 among them. A newer competitor release
  is not tracked, and moving a pin re-runs compare.yml and the notebooks
  and re-dates the tables. The generated tables are untouched:
  update_compare_docs.py reproduces them as committed.

The roadmap marks A10 landed. Prose only, so no code, count or ceiling
moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016GKzq1VSdcMYCRMhddiMaf
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