You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gpu-config [4/13]: parse the GPU configuration document - #3250
Part of #3246 (4/13). Depends on: none. Review only the last commit.
Adds internal/gpuconfig/config: parsing and validation of the
configuration document, matching GPUs to entries, and the document hash. go.yaml.in/yaml/v2 becomes a direct dependency. Not used yet.
The changes add GPU configuration parsing, validation, hashing, and matching. They also add driver load identification and readiness checks, a locked file-backed store for apply and gate state, and a function that compares the applied configuration hash with the current hash to determine synchronization status.
Merge Risk: Low · up to 9708e
This change adds GPU configuration parsing, node-local state, and sync-status packages that nothing calls yet. Two edge cases should be fixed before the packages are wired in. A crafted YAML merge can silently drop a GPU entry and hide an overlap. A state file with conflicting key spellings can become unreadable after a write. Both need unusual input, so the merge risk is low.
Security architecture risk: Minimal · up to 9708e
The new contracts are not yet connected to running GPU configuration or allocation behavior. The inspected change establishes no material new risk to security, failure containment, rollback, or ownership guarantees.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The contracts concern node-local GPU configuration and coordination, but the reviewed head does not connect them to an independently reachable configuration endpoint, privileged GPU operation, or allocator gate. Wider tenant, service, or environment exposure is not established by the exported Go symbols or test fanout.
Trust Boundaries and Controls
observed — Source represents caller-supplied ConfigMap data. Parsing validates document structure, and Hash provides a content fingerprint; neither function authenticates the ConfigMap writer or authorizes GPU changes. No production source-to-sink integration is present to evaluate those future authority checks.
Resilience and Maintainability Implications
observed — A missing state file produces an empty state, malformed or unsupported-version state returns an error, and writes refuse to proceed without a successful read. Missing apply state, unknown decisions, mismatched load identifiers, and mismatched hashes do not satisfy the in-sync predicate.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
Other comments: 1
internal/gpuconfig/statefile/state.go: 1
91-91: Minor · Data Integrity & Integration · Quick win
Reject conflicting JSON field aliases before accepting state.
For {"version":2,"Version":1}, parse accepts version 1 but retains both raw keys. Go 1.26.3 matches struct fields case-insensitively and sorts map keys during encoding. A gate write therefore emits "Version":1 before "version":2. (pkg.go.dev)
write replaces the state file before reparsing those bytes. The write then returns ErrParse, and subsequent reads cannot recover. Reject conflicting aliases before accepting the file. Add a parse → gate-write → read regression test.
Reviewing files that changed from the base of the PR and between 246a9ca and 9708e14.
Files selected for processing: 15
go.mod
internal/gpuconfig/config/document.go
internal/gpuconfig/config/document_test.go
internal/gpuconfig/config/match.go
internal/gpuconfig/config/match_test.go
internal/gpuconfig/config/schema.go
internal/gpuconfig/loadid/driver.go
internal/gpuconfig/loadid/loadid.go
internal/gpuconfig/loadid/loadid_test.go
internal/gpuconfig/statefile/file.go
internal/gpuconfig/statefile/file_test.go
internal/gpuconfig/statefile/state.go
internal/gpuconfig/statefile/state_test.go
internal/gpuconfig/status/sync.go
internal/gpuconfig/status/sync_test.go
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 8 remain after this review.
henry118
changed the title
gpu-config: parse the GPU configuration document
gpu-config [4/13]: parse the GPU configuration document
Nov 19, 2026
This branch has not been deployed
No deployments
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
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.
Part of #3246 (4/13). Depends on: none. Review only the last commit.
Adds
internal/gpuconfig/config: parsing and validation of theconfiguration document, matching GPUs to entries, and the document hash.
go.yaml.in/yaml/v2becomes a direct dependency. Not used yet.