Repository navigation
ROCMAI-215: extract engine/runtime selection and HTTP readiness polling into engine_runtime_select.rs - #756
Draft
jussielo-amd wants to merge 1 commit into
Conversation
…ng into engine_runtime_select.rs Signed-off-by: Jussi Elo <jussi.elo@amd.com>
8 tasks done
There was a problem hiding this comment.
🔵 Needs a closer look
Integration with prerequisite #752 remains unverified, and build/test results were not independently validated in this review environment.
No open issues 🎉
What changed in this PR
Continues the main.rs modularization by moving engine/runtime selection and HTTP readiness polling into a dedicated module, with no intended behavior change.
Changes:
- Relocates selection, managed-child environment, argument-building, and readiness helpers into
engine_runtime_select.rs. - Updates caller imports and moves 11 existing tests alongside the extracted code.
- Documents the module’s responsibilities and shared crate-root helpers.
| File | Description |
|---|---|
docs/architecture.md |
Documents the extracted module and its callers. |
apps/rocm/src/service_launch.rs |
Updates launch-helper imports, preserving platform gates. |
apps/rocm/src/serve_cmd.rs |
Imports runtime selection from the new module. |
apps/rocm/src/runtimes_cmd.rs |
Updates the runtime-selector test import. |
apps/rocm/src/main.rs |
Registers the module and removes relocated helpers and tests. |
apps/rocm/src/engines_cmd.rs |
Updates selection and environment-helper imports. |
apps/rocm/src/engine_runtime_select.rs |
Houses extracted helpers and 11 existing tests. |
apps/rocm/src/engine_ipc.rs |
Updates helper imports and module documentation. |
apps/rocm/src/chat.rs |
Updates environment and model-name helper imports. |
Review effort: Balanced
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
Phase 6f-8 of the
main.rsmodularization (epic ROCMAI-27) — the last sub-phase before the file's sharedmod testsblock. Mechanical relocation, no behavior change: moves engine/runtime selection and HTTP readiness-polling logic out ofapps/rocm/src/main.rsinto a newapps/rocm/src/engine_runtime_select.rs.resolve_engine_selection/validate_engine_selection_runtime(plusstruct EngineSelection, their return type, not named in the ticket but part of the cluster),single_ready_runtime_key,resolve_runtime_selector_to_exact_key,optional_arg,engine_recipe_json_arg/parse_engine_recipe_json_arg,app_path_env_vars/app_path_env_var_values/app_path_env_var_refs,daemon_run_argv,managed_service_launcher_path,apply_app_path_env,wait_for_service_http_ready(_with_progress),service_http_readiness_paths,http_get_local_service/http_post_local_service_json,service_http_readiness_response_ready,lemonade_health_ready_for_model,model_list_ready_for_model,service_model_gpu_ready/service_model_reports_rocm_backend/service_model_names_matchmoved.const fn status_for_readinesssits physically inside the span but has external callers (service_launch.rs,main.rs) and stayed behind, same treatment as earlier PRs'device_policy_name/ROLLBACK_RECOVERY_HINT.treat_as_natural_language, immediately following this cluster, is confirmed out of scope and untouched — dispatch-adjacent routing logic from ROCMAI-87, staying inmain.rspermanently.chat.rs,engine_ipc.rs,engines_cmd.rs,serve_cmd.rs,service_launch.rs, andruntimes_cmd.rs's own test module.dispatch()confirmed byte-identical (independently re-verified by SHA-256).docs/architecture.mdupdated with this module's entry.Test plan
cargo build --workspacecargo clippy --workspace --all-targets -- -D warningscargo fmt --all -- --checkcargo xtask manifest --checkcargo xtask check-crate-edgespython scripts/smoke_local.py --profile debug --skip-buildcargo test --workspace --no-fail-fast— 4322 passed, 0 failed, 17 ignored (independently re-run, matches baseline exactly)dispatch()call sites confirmed byte-identical (SHA-256 of the function body)Depends on #752 (ROCMAI-210) — sixth PR in the ROCMAI-86 (Phase 6f) stack.
Part of Jira ROCMAI-215 / epic ROCMAI-27.
🤖 Generated with Claude Code