Configurable canonical priority range (--priority-range)#22
Merged
Conversation
The interchange priority band was hardcoded to 0-1000, which caps how finely a native priority can round-trip: PBS's 2048-value range, for instance, cannot survive a pass through a 1001-value canonical band (e.g. -p 500 -> 501). Introduce splat.CanonicalScale (default 0-1000) that Normalize/Denormalize map through, and a `bammm convert --priority-range MIN:MAX` flag to set it. Widening the band (e.g. 0:100000) makes such round-trips lossless; the default is unchanged. splat.ParseRange validates the flag (MIN:MAX, MAX > MIN). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PnTz6Zxqa4jHocK8kCbyx
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
Make the canonical priority band a parameter instead of a hardcoded 0–1000.
Every scheduler's native priority is normalized onto a common interchange band
and denormalized back on emit. That band was fixed at 0–1000, which caps
round-trip precision: PBS's 2048-value native range can't survive a pass through
a 1001-value band.
splat.CanonicalScale(default{0, 1000}) is the bandNormalize/Denormalizenow map through.bammm convert --priority-range MIN:MAXsets it per run (default0:1000).splat.ParseRangevalidates the value (MIN:MAX,MAX > MIN).Goal: round-trip precision. Widening the band recovers fidelity for
schedulers with large native ranges; the default behavior is unchanged.
Demo
(A Slurm source shows no change from widening — Slurm's native 0–1000 range is
already coarser than the band, so there's no lost precision to recover. The
benefit applies when the source range is finer than the band.)
Testing
TestParseRange: valid/invalid flag values.TestPriority_WideCanonicalImprovesRoundTrip: the default band losesprecision across PBS's full range; a band ≥ the native range is lossless.
TestConvert_PriorityRangeFlag: the flag is validated and appliedend-to-end; omitting it restores 0–1000.
go vet,gofmtclean. SPEC.md updated.🤖 Generated with Claude Code