controls: make the port-level map_control_to_01 overload reachable#144
Merged
Conversation
Its constraint called map_control_to_01(t.value) without the explicit
template argument, but T is non-deducible in every value-level overload, so
the constraint was unsatisfiable: avnd::map_control_to_01(ctl) never
resolved and every guarded caller silently got `false` from
`requires { map_control_to_01(ctl); }`. Concretely, vintage's
Controls::read() never initialized the atomic parameter mirror, so VST2
hosts read 0 for every parameter's initial value.
Pass T explicitly in the constraint, matching the body.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Zm2k4dsLp2jMa47zyLcSZ
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.
The port-level convenience overload
constrained itself with an unqualified
map_control_to_01(t.value)— butTis non-deducible in every value-level overload, so that expression can never resolve and the constraint is unsatisfiable. Consequences:avnd::map_control_to_01(ctl)never participated in overload resolution, and every caller guarding withrequires { map_control_to_01(ctl); }silently gotfalse.vintage::Controls::read()never initialized the atomic parameter mirror: VST2 hosts read 0 as the initial value of every parameter.Fix: pass
Texplicitly in the constraint, matching what the body already does. Verified with a minimal reachability check (static_assert(requires(halp::knob_f32<...> c) { avnd::map_control_to_01(c); })fails before, passes after) plus the full build and 100-test suite on main. Found via the VST2 editor host test on theavendish-uibranch, wheregetParameterreturned 0 for a control initialized to 0.25.🤖 Generated with Claude Code
https://claude.ai/code/session_014Zm2k4dsLp2jMa47zyLcSZ