Repository navigation
Conversation
Treat omitted constraints as empty during BestFit scoring. Cover both scoring helpers and multi-candidate public selection. Signed-off-by: Zhenyu Zhu <25193860+gbwzzy218@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe BestFit memory and compute scoring helpers now handle nil constraints. Tests cover scoring and candidate selection when constraints are omitted or empty. ChangesBestFit nil-constraint handling
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The supplied changes show no actionable merge-blocking risk; merge after normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
gbwzzy218
marked this pull request as ready for review
October 7, 2026 20:28
gbwzzy218
requested review from
Huang-Wei,
fanyang-real and
slin1237
as code owners
October 7, 2026 20:28
Signed-off-by: Zhenyu Zhu <25193860+gbwzzy218@users.noreply.github.com>
This branch has not been deployed
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 PR does
Treats omitted constraints the same as an explicitly empty constraints object during BestFit scoring. This prevents nil-pointer panics in the memory and compute scoring helpers without changing scoring weights, candidate filtering, precision fallback, or tie handling. The caller’s configuration is not modified.
Adds regression tests for both helpers and the public GetAcceleratorClass path with multiple candidates, covering omitted and empty constraints with and without performance data.
Why we need it
BestFit selection without constraints panics when multiple candidates reach scoring. Zero- and single-candidate paths return before scoring and do not reproduce the issue.
Fixes #627
How to test
Run the selector tests and static checks:
go test -race -count=1 ./pkg/acceleratorclassselector go vet ./pkg/acceleratorclassselectorTestBestFitWithoutConstraintsexercises the public selection path with multiple candidates, omitted and empty constraints, and both missing and positive performance data. The helper regression tests reproduce the memory and compute nil-pointer panics on the base revision.For full CI validation, run
make testandmake coveragewith the required Rust/Xet and envtest dependencies installed.Validation:
make testpasses locally on macOS arm64 with Go 1.26.0, Rust 1.99.0, and Kubernetes 1.30.3 envtest binaries, including the Xet-dependentcmd/ome-agenttests. Xet was built from the existing Cargo.lock revisiondb2a0e722bcd80ea7f5cf339a0b550d01e6321b2.make coveragepasses the default 50% gate: CMD 40.8%, PKG 83.8%, Internal 71.1%; average 65.23%.Checklist
make testpasses locallySummary by CodeRabbit