Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion python/aisim/src/aisim/capacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ def finish_lowering(value):
finally:
model.close()
if diagnostics.get("readiness") != "ready":
from .estimator_readiness import unready_estimator_message
from .estimator_readiness import reject_unlisted_estimator_version, unready_estimator_message

reject_unlisted_estimator_version(diagnostics)
raise ValueError(unready_estimator_message(diagnostics))
canonical_result = dict(raw)
resolved = diagnostics["provenance"]["config"]
Expand Down
26 changes: 26 additions & 0 deletions python/aisim/src/aisim/estimator_readiness.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,32 @@ def perf_data_missing_message(error: BaseException | str) -> str | None:
)


def reject_unlisted_estimator_version(diagnostics: dict[str, Any]) -> None:
"""Preserve a version-slot input refusal before formatting an unready estimator."""

provenance = diagnostics.get("provenance") or {}
if not provenance.get("selection_failures") and not diagnostics.get("last_warning"):
# Explicit regression identities need not use an op-data version slot.
return
config = provenance.get("config") or {}
if not all(config.get(key) for key in ("system", "backend", "backend_version")):
return
from aisim_core.sdk.perf_database import UnlistedQueryVersionError, resolve_query_version

try:
resolve_query_version(
config["system"],
config["backend"],
config["backend_version"],
systems_paths=config.get("systems_paths") or None,
)
except UnlistedQueryVersionError:
raise
except ValueError:
# Other lookup failures retain the existing missing-data diagnostic.
pass


def _unavailable_version_message(
system: str | None,
backend: str | None,
Expand Down
7 changes: 6 additions & 1 deletion python/aisim/src/aisim/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from typing import Any

from aisim_core.sdk.errors import UnsupportedVisionFamilyError
from aisim_core.sdk.perf_database import UnlistedQueryVersionError
from aisim_core.sdk.utils import get_model_config_from_model_path

from .compiler import prediction_to_replay_spec
Expand Down Expand Up @@ -110,6 +111,8 @@ def run_prediction(
spec, and raw runner report.

Raises:
UnlistedQueryVersionError: If timing preparation rejects a backend version
outside its queryable slots. Propagates unchanged as an input error.
UnsupportedVisionFamilyError: If native VL replay cannot support the
requested image processor. This ValueError subtype propagates unchanged.
PredictionExecutionError: If the runner fails with another execution error.
Expand Down Expand Up @@ -147,11 +150,13 @@ def run_prediction(
try:
try:
report = runner.run(spec, output_requirements=output_requirements)
except (KeyboardInterrupt, ResourceLimitError, UnsupportedVisionFamilyError):
except (KeyboardInterrupt, ResourceLimitError, UnsupportedVisionFamilyError, UnlistedQueryVersionError):
Comment thread
Harrilee marked this conversation as resolved.
Resolved
# ResourceLimitError from a guarded runner must reach the caller
# unwrapped so it can be handled distinctly from execution failures.
# A known unsupported vision family is likewise an input rejection,
# even though its geometry is resolved while preparing the runner.
# Version-slot refusals discovered during timing preparation also
# retain their configuration-error type and complete repair guidance.
raise
except Exception as exc:
raise PredictionExecutionError(
Expand Down
Loading