feat: configurable track insertion fill strategies#160
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-sample tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add `insertion_fill` field to `Tracks`, `with_insertion_fill` method, and prune fills in sync with `with_tracks`. Defaults to `Repeat5p` for every active track. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Dataset.with_insertion_fill() to configure per-track insertion fill strategies, re-export all InsertionFill strategy classes from the top-level package, and add e2e tests for the full plumbing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
165144e to
dbdaca4
Compare
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.
Summary
Repeat5p(default, byte-identical to prior behavior),Repeat5pNormalized,Constant,FlankSample, andInterpolate(linear/quadratic/cubic Lagrange).Dataset.with_insertion_fill(strategy_or_dict)lets users set a strategy globally or per active track. Returns a new lazy view; original dataset unchanged.shift_and_realign_track_sparse.FlankSampleuses an inline xorshift64 hash of(base_seed, query, hap, out_idx)— parallel-safe, nonp.randomglobals.deterministic=Truederives a reproducible base_seed from theidxarray.Design + Plan
docs/superpowers/specs/2026-05-11-track-insertion-options-design.mddocs/superpowers/plans/2026-05-11-track-insertion-options.mdTest Plan
tests/dataset/test_insertion_fill.py)Repeat5pproduces byte-identical output to pre-change behaviorFlankSampledeterminism across calls + sensitivity to(query, hap)distinguishing seedsRepeat5pfor unspecified trackswith_tracksprunesinsertion_fillto active tracksDataset[...]with the dummy datasetHapsTrackstests/dataset/suite — 381 passed, 5 skipped, 1 xfailed, no regressionsFollow-ups (non-blocking, called out in final review)
base_seedusesbitwise_xor.reduce(idx), which is permutation-invariant. The per-position(query, hap, pos)mixing in the kernel mitigates this for fills, but a position-sensitive hash would be stronger._REPEAT_5Parm inside_apply_insertion_fillis unreachable from the outer kernel (which short-circuits) and is commented as such.🤖 Generated with Claude Code