Skip to content

Resolve compute references and hydrate task results generically - #408

Draft
amirabbas-jalali-bentley wants to merge 2 commits into
SeequentEvo:validate-compute-task-parametersfrom
amirabbas-jalali-bentley:resolve-compute-references-and-outputs
Draft

amirabbas-jalali-bentley wants to merge 2 commits into
SeequentEvo:validate-compute-task-parametersfrom
amirabbas-jalali-bentley:resolve-compute-references-and-outputs

Conversation

@amirabbas-jalali-bentley

@amirabbas-jalali-bentley amirabbas-jalali-bentley commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

Part 3 of 6 in the generic compute engine series (stacked on #395 -> #407, targeting validate-compute-task-parameters).

With discovery (#387), execution (#395), and schema validation (#407) in place, ComputeClient still required callers to build wire-level URL strings and JMESPath expressions by hand and returned raw dict payloads. This PR adds generic input reference resolution and output hydration driven by the task schemas' reference annotations, plus parity suites comparing the generic engine against the existing typed task runners.

Changes

  • ReferenceResolver (evo.compute.resolution, exported from evo.compute):
    • Resolves reference_to: geoscience-object (typed BaseObject, DownloadedObject, ObjectMetadata, ObjectReference, URL, or UUID), reference_to: attribute (typed attribute, JMESPath expression, or bare attribute name placed into the owning object family's attribute_path via attribute_from), reference_to: file (File API URL or handle exposing .url / .metadata.url), and target: attribute (create/update specs or typed existing/pending attributes).
    • Reuses the conversion helpers in tasks/common/source_target.py so generic calls and hand-written runners serialize references identically, and passes already-resolved wire values through unchanged.
    • Enforces supported_schemas (check_schemas, defaulting to validate and configurable independently on ComputeClient or per arun call), caching metadata lookups per reference and downgrading unloadable objects to a warning.
    • Runs between shallow required-field checks and deep Draft 2020-12 validation in ComputeClient.arun, so deep validation inspects the resolved wire payload.
  • TaskResult and ResultNode (evo.compute.outputs, exported from evo.compute):
    • dict subclasses that preserve raw dictionary indexing/equality while exposing attribute access and await node.load() / await node.to_dataframe() on output: geoscience-object and output: attribute nodes (with attribute_path container self-healing when a multi-family task writes to a different object family).
  • Unknown-annotation warning on DiscoveryClient: warns once per unrecognised schema annotation key when a live catalogue moves ahead of the installed SDK, without blocking execution.
  • Runner/engine parity suites (test_payload_parity.py, test_behavior_parity.py): verify concrete wire-payload and invalid-input parity across declustering, kriging, conditional simulation, and location-wise tasks, pinning intentional differences explicitly.
from evo.compute import ComputeClient

client = ComputeClient(manager)
result = await client.geostatistics.declustering.run(
    source=pointset,
    grid=block_model,
    target=pointset.attributes["IDW declus"],
    neighborhood=neighborhood,
    preview=True,
)

updated_pointset = await result.target.load()
weights_df = await result.target.attribute.to_dataframe()

No breaking changes to existing evo.compute.tasks runners. ComputeClient runs now return TaskResult (a dict subclass).

Testing

  • Unit and integration tests in test_resolution.py (42 tests), test_outputs.py (24 tests), test_discovery.py (4 unknown-annotation warning tests), test_payload_parity.py (19 tests), and test_behavior_parity.py (32 tests).
  • evo-compute tests: 722 passed, 1 skipped (132 new). ruff check, ruff format --check, and pre-commit hooks pass.

Checklist

  • I have read the contributing guide and the code of conduct

Add ReferenceResolver to convert typed geoscience objects, attributes,
files, and parameter models into wire references using each task's
published schema annotations, with configurable supported_schemas checks.

Add TaskResult and ResultNode dict subclasses so output references can be
loaded back into typed objects or DataFrames, warn once per unrecognised
catalogue annotation in DiscoveryClient, and add payload/behavior parity
tests comparing the generic engine against the typed task runners.
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.

1 participant