forked from lance-format/lance-graph
-
Notifications
You must be signed in to change notification settings - Fork 0
planner: fill the 5 default_modulation style families from canonical (TD-PLANNER-STYLE-DEFAULT-DRIFT-1 PAID) #713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+185
−4
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When callers use the public
plan_with_style(..., StyleFamily::Peripheral)path,api.rsconverts this modulation throughto_fingerprint(), which normalizesfan_outasfan_out as f64 / 20.0; with this new value that passes exactly1.0intothermometer_encode, where(1u8 << 8)panics in debug builds and encodes incorrectly in release builds. Peripheral previously fell back tofan_out = 6, so this change adds a new user-visible panic/wrong strategy-vector case unless the encoder is fixed or this value is kept below the saturation boundary.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed and fixed at the root cause in b3db4df. You're right that
Peripheral fan_out = 20→to_fingerprint→20/20.0 = 1.0→thermometer_encode(1.0)overflows. But the bug is in the encoder, not the value:thermometer_encodedid(1u8 << levels).wrapping_sub(1)withlevels = (value*8) as u8 ∈ 0..=8, and1u8 << 8overflows u8 (debug panic / release mis-encode to 0). It was already latent —Exploratory(exploration = 1.0,fan_out = 20) andFocused(depth_bias = 1.0) feed 1.0 through the same path, soplan_with_style(Exploratory)already panicked in debug; my Peripheral change just added another trigger on the reviewed line.Rather than keep Peripheral below the boundary (which would reintroduce the D-TSC-1b drift this PR fixes), I fixed the encoder:
((1u16 << levels) - 1) as u8, so the top bin is a correct0xFF(8 set bits) instead of overflowing. Addedto_fingerprint_never_panics_for_any_family(exercises the realplan_with_stylepath across all 12 families — would have caught the pre-existing bug) +thermometer_encode_saturates_at_full_scale. 220 planner lib tests green.Generated by Claude Code