Fix #61: resolve the pinned driver name through driverAlias() - #109
Open
corgab wants to merge 2 commits into
Open
Fix #61: resolve the pinned driver name through driverAlias()#109corgab wants to merge 2 commits into
corgab wants to merge 2 commits into
Conversation
circuit() and batch() re-implemented the null-to-default half of driverAlias() inline as $driver ?? $this->getDefaultDriver(). Both now call driverAlias(), so one method knows how an absent driver name resolves. Closes #61
…s ask the manager for the default circuit() and batch() resolve the driver name first and hand the same string to driver(), so the pinned name and the resolved device agree by construction. SubmitQuantumCircuit and PollQuantumTask no longer repeat the 'local' literal: they take the default from QuantumManager::getDefaultDriver(). The pinning tests now set a non-default driver so a hardcoded fallback could not pass them.
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
QuantumManager::driverAlias()already resolves a driver argument to its string alias, falling back to the default when none is given.circuit()andbatch()re-implemented the null-to-default half of that inline as$driver ?? $this->getDefaultDriver(). Both now delegate, so one method in the manager knows how an absent driver name resolves, and the queue jobs ask the manager for the same answer instead of repeating the'local'literal.Plan
circuit()andbatch(), resolve the alias once and hand the same string todriver(), so the pinned name and the resolved device agree by construction.SubmitQuantumCircuitandPollQuantumTaskatQuantumManager::getDefaultDriver()for the fallback they used to compute themselves.driverAlias()docblock to name its callers.Changes
src/QuantumManager.php:circuit()andbatch()calldriverAlias()once and pass the result todriver(); docblock updated. The parameters stay?string, as the issue notes the enum half of the alias is not reachable through these two methods today.src/Jobs/SubmitQuantumCircuit.php,src/Jobs/PollQuantumTask.php:$this->driver ?? $manager->getDefaultDriver().tests/Feature/QuantumManagerTest.php: circuit and batch pinning tests resolve the default from config (aws), not the shippedlocal.Overlap
#104 (#57) replaces the same two job lines with
AetherConfig::defaultDriver(); whichever merges second takes either form, both remove the literal.Tests
vendor/bin/pint --testpasses.vendor/bin/pest --compact: 792 tests, 1 skipped (791 before: +1).Closes #61