bridge at 2× and 4× rates (follow-up 2.2) and the rational engine's plan draft - #53
Merged
Merged
Conversation
The reviewed-plan deliverable the family plan's "Next — rational" entry asks for: charter (synchronous L/M with L, M in 2^a·3^b, within one rate family, never routed to by rate), settled decisions R1–R12 (ratio as a type, one Nyquist filter per stage, stage factoring by MACs, the L-th-band Kaiser design and why its symmetric transition is coverage rule 2.1(a) with equality, bridge's profile vocabulary as fractions of the chain's lowest rate, the designer and chain<> in DspTap first), the generated 14 × 14 coverage matrix with every ordered pair's chain and the 2.1 arithmetic for the hard cases, layout, the three-leg test strategy, milestones M0–M6 with what waits for the bridge 2.2 follow-up, non-goals, risks and ten open questions for the maintainer. Every number marked est. is a harris/Kaiser estimate owed a measurement by M2 and M4; nothing is implemented. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA
ratio_traits<D, K> gains a rate scale K <= 2: every Hz value is the base pair's times 2^K (K = 1 is 88.2 <-> 96 kHz, K = 2 is 176.4 <-> 192), L and M unchanged. basic_phase_table and basic_converter carry K through to design_prototype<D, K>, which scales the profile's passband edge with the pair, so the normalized cutoff and every coefficient are bit-identical to K = 0 (power-of-two scaling is exact in double; kaiser_beta depends only on the dB). New aliases converter_to_96k / converter_to_88k2 / converter_to_192k / converter_to_176k4 with _q15 and _q31 forms. The profile table now states each passband edge as a fraction of the pair's lower rate; the stopband edge is the output Nyquist, so one profile serves every K. Pinned: RateScaledTraitsAreThePairTimesTwoToTheK, RateScaleIsBitIdentical (every direction x profile at K = 1 and 2 equals K = 0 to the bit), RateScaledEconomyMeetsSpecAtItsOwnRates (K = 2 measured at 176.4/192), BadProfilesThrow at every K, and RateScaledConvertersAreTheBaseMachine (output, accounting and latency bit-exact against the base converter in float, Q15 and Q31). The C ABI stays at K = 0 until a consumer asks. The shipped K = 0 path is unchanged: per-function attribution on Hexagon shows every hot-path function counting identically under its new mangled name, and design_prototype reads the scaled edge at each use rather than holding it in a local, which had moved the construction count by one instruction per phase on Hexagon and by one per workload on M55. The ratchet is exact (+0) on Hexagon and M55 for all 34 workloads of both engines. Host battery 172/172 under clang -Werror; clang-tidy clean. Charter prose in bridge/PLAN.md, bridge/README.md, bridge/CLAUDE.md, ratio.h, the family PLAN.md (2.2 marked done) and README.md updated. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA
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.
What this changes
Two commits, the next two items of
PLAN.md's "Next" entry, in the order the family plan sequences them:698af12—bridgeserves the pair at 2× and 4× rates (follow-up 2.2).ratio_traits<D, K>gains a rate scaleK ≤ 2(K = 1 is 88.2 ↔ 96 kHz, K = 2 is 176.4 ↔ 192); every Hz value is the base pair's times 2^K, L and M unchanged.basic_phase_tableandbasic_convertercarryKthrough todesign_prototype<D, K>, which scales the profile's passband edge with the pair. New aliasesconverter_to_96k/converter_to_88k2/converter_to_192k/converter_to_176k4with_q15and_q31forms. The profile table states each passband edge as a fraction of the pair's lower rate; the stopband edge is the output Nyquist, so one profile serves every K. The C ABI stays at K = 0 until a consumer asks. Charter prose updated inbridge/PLAN.md(§1, §9),bridge/README.md,bridge/CLAUDE.md,ratio.h, the familyPLAN.md(2.2 marked done, the section-2 row) andREADME.md.68fe752—rational/PLAN.md, v0.1 draft for review. The reviewed-plan deliverable: charter, decisions R1–R12, the generated 14 × 14 coverage matrix (all 182 ordered pairs with their chains and the 2.1 arithmetic for the hard cases), layout, three-leg test strategy, milestones M0–M6, non-goals, risks, and ten open questions for the maintainer (§9). Every number marked est. is a harris/Kaiser estimate owed a measurement; nothing is implemented.Why
2.2 is the follow-up the migration deferred: a 2×-rate design could not even be expressed (a 36 kHz passband threw "bad profile"), and the family plan sequences it before
rational, whose cross-family chains composebridgeat k = 1 and 2. The plan's claim — power-of-two scaling is exact in IEEE double andkaiser_betadepends only on the dB, so the scaled pair is the same table — is now pinned rather than asserted. The rational draft is where the maintainer's decisions on §9 are needed before M0 lands in DspTap; its matrix is also what answers the 2.1 rows the family plan left to it.Verification
bridge/tests/test_design.cpp,test_converter.cpp):RateScaledTraitsAreThePairTimesTwoToTheK(the Hz values and L/M at K = 1, 2, asstatic_asserts),RateScaleIsBitIdentical(every direction × profile at K = 1 and 2 equals K = 0 coefficient for coefficient, exactdouble ==),RateScaledEconomyMeetsSpecAtItsOwnRates(the K = 2 design measured at 176.4/192 kHz against its spec),BadProfilesThrowat every K, andRateScaledConvertersAreTheBaseMachine(output,outputs_for/frames_neededand latency bit-exact against the base converter in float, Q15 and Q31, both channels, transient included).-Werrorwith bothTAP_SR_*_WERROR;scripts/tidy.shclean;pre-commitclean.--exactagainst the committed baselines is +0 on all 51 measurements (Hexagon, M55, M33; both engines), on the local toolchains that match the baselines to the instruction. Per-function attribution on Hexagon shows every hot-path function (process_walk,process, the table and converter constructors) counting identically under its new mangled name.design_prototype; that re-allocated registers around the per-branch normalization loop and moved the construction count by one instruction per phase on Hexagon (−147 down, +160 up, economy workloads) and by one per workload on M55, with every hot-path function identical. Reading the edge at each use restored +0 everywhere; the comment indesign.hrecords why.Notes for the reviewer
directionenumerators keep theirup_to_48k/down_to_44k1names at every K; K says which rates the frames carry. Renaming them would be a D7-scale API change for no behavior and is not proposed.rational/PLAN.md§9 that shape the engine most: (1)bridgeplacement in 48 → 88.2 — the family plan's illustrative row vs the lowest-k rule, at 62 % of the MACs; (2) fewer stages when the MAC search wins by under 10 %; (4)chain<>in DspTap, below both engines.🤖 Generated with Claude Code
https://claude.ai/code/session_015VR1VC4SDGxHZQQsQvPBaA
Generated by Claude Code