Skip to content

Refactor: hoist _ensure_prepared and unify prepared-callable docs#751

Merged
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
poursoul:cleanup/pr710-follow-up
May 12, 2026
Merged

Refactor: hoist _ensure_prepared and unify prepared-callable docs#751
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
poursoul:cleanup/pr710-follow-up

Conversation

@poursoul
Copy link
Copy Markdown
Collaborator

@poursoul poursoul commented May 12, 2026

Summary

  • Hoist _ensure_prepared out of the two chip-child loops (_chip_process_loop / _chip_process_loop_with_bootstrap) in python/simpler/worker.py into a single module-level helper so the lazy/eager prepare branches stay in sync.
  • Add a UT (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.
  • Unify the prepared_callable_path_used_ field comment across all four device_runner.h headers (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 skipped
  • pre-commit run --files <changed> → all hooks pass
  • CI green

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.
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@ChaoWao ChaoWao merged commit cf15368 into hw-native-sys:main May 12, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants