Refactor: hoist _ensure_prepared and unify prepared-callable docs#751
Merged
Merged
Conversation
Hoist `_ensure_prepared` out of the two chip-child loops into a single module-level helper so the lazy/eager prepare branches stay in sync. Add UT coverage for the lazy-prewarm fallback path, which previously had none. Unify the `prepared_callable_path_used_` comment across all four device_runner.h headers and note the legacy-path assumption it rests on. Clears the remaining follow-up items from PR hw-native-sys#710 / hw-native-sys#735.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
ChaoWao
approved these changes
May 12, 2026
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
_ensure_preparedout of the two chip-child loops (_chip_process_loop/_chip_process_loop_with_bootstrap) inpython/simpler/worker.pyinto a single module-level helper so the lazy/eager prepare branches stay in sync.tests/ut/py/test_worker/test_ensure_prepared.py) covering the four cases — lazy warn, eager silent, already-prepared short-circuit, missing-cid raise. The lazy-prewarm fallback path previously had zero coverage.prepared_callable_path_used_field comment across all fourdevice_runner.hheaders (a2a3/a5 × onboard/sim) and note the legacy-path assumption it rests on (no longer reachable, kept as a regression guard).Clears the remaining follow-up items from PR #710 / #735.
Test plan
pytest tests/ut/py/test_worker→ 70 passed, 1 skippedpre-commit run --files <changed>→ all hooks pass