Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
57 changes: 57 additions & 0 deletions .github/workflows/extropic-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Extropic Preview

on:
pull_request:
paths:
- ".github/workflows/extropic-preview.yml"
- "docs/guides/extropic-execution.md"
- "examples/python/extropic_torx_workload.py"
- "runtimes/python/pyproject.toml"
- "runtimes/python/src/vyral_runtime/integrations/extropic.py"
- "scripts/verify-python-extropic-torx.py"
- "scripts/verify-python-extropic-torx-live.py"
push:
branches:
- main
paths:
- ".github/workflows/extropic-preview.yml"
- "docs/guides/extropic-execution.md"
- "examples/python/extropic_torx_workload.py"
- "runtimes/python/pyproject.toml"
- "runtimes/python/src/vyral_runtime/integrations/extropic.py"
- "scripts/verify-python-extropic-torx.py"
- "scripts/verify-python-extropic-torx-live.py"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: extropic-preview-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
torx-local-proof:
name: Prove Torx workload packaging
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
cache: pip
cache-dependency-path: runtimes/python/pyproject.toml

- name: Install Vyral with the pinned Torx proof line
run: >-
python -m pip install --disable-pip-version-check
--editable "runtimes/python[extropic-torx]"

- name: Run local and clean-process proofs
run: |
python -m py_compile scripts/verify-python-extropic-torx-live.py
python scripts/verify-python-extropic-torx.py
32 changes: 26 additions & 6 deletions PUBLIC-EXPORT-MANIFEST.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"fileCount": 823,
"fileCount": 827,
"files": [
{
"mode": "644",
Expand Down Expand Up @@ -71,6 +71,11 @@
"path": ".github/workflows/execution-runtime-consumer.yml",
"sha256": "8d785b1fa0071a7c5a91ef7149ad9fc7618d22ab548464ab7613fa84301ffe29"
},
{
"mode": "644",
"path": ".github/workflows/extropic-preview.yml",
"sha256": "93c54dda7ffe6f206fb18795ba3bd54c68e742344bb8f6a960e83102f0a9f483"
},
{
"mode": "644",
"path": ".github/workflows/google-live-qualification.yml",
Expand Down Expand Up @@ -579,7 +584,7 @@
{
"mode": "644",
"path": "docs/guides/extropic-execution.md",
"sha256": "92fd151ebb3d6d198e7b8d94384b49c46eec9ba823eb71cd08947be6ffa47609"
"sha256": "09e9c18f2f54f28da367906c197abbd192699d686387a147fdf114feff51f656"
},
{
"mode": "644",
Expand Down Expand Up @@ -609,7 +614,7 @@
{
"mode": "644",
"path": "examples/README.md",
"sha256": "2524b7193da3804fafc8c527739c42fd9e7cdb9bc942ed821670c6e0b1cae6ce"
"sha256": "2163d0dd9b99a47e3f9dda60d4afc13cc6e80724dd7bfa3f2e2678afeeda94ae"
},
{
"mode": "644",
Expand All @@ -626,6 +631,11 @@
"path": "examples/python/consumer_workflows.py",
"sha256": "f0a752881fc16225df22b6b13da0a45eef6a6140e0f5a2906200bc38ca0a9cba"
},
{
"mode": "644",
"path": "examples/python/extropic_torx_workload.py",
"sha256": "2da52e7ae1d9770ac861091b56f91944c48bcee1d414edcfe23c53d2c4270497"
},
{
"mode": "644",
"path": "examples/python/prefect_receipt_flow.py",
Expand Down Expand Up @@ -664,7 +674,7 @@
{
"mode": "644",
"path": "runtimes/python/README.md",
"sha256": "2f89eedcacb8a7641ffec99cb106526b9891a3d1e6b3b1dd7c9f4ae0c3c15eaa"
"sha256": "f74eeb84a7bb500e7bfab63279a68737b0d0315d2e68fd2197b03a3996e407f2"
},
{
"mode": "644",
Expand All @@ -684,7 +694,7 @@
{
"mode": "644",
"path": "runtimes/python/pyproject.toml",
"sha256": "a11bad821329f41857e22cea0f254737ce4a8cbe97e81ef6c0e48ce567e65bdf"
"sha256": "7c0de06cbfc930e2b7b3cb05804f97ff9c040d43561dbb0225f583bb175e9aae"
},
{
"mode": "644",
Expand Down Expand Up @@ -1726,6 +1736,16 @@
"path": "scripts/verify-python-extropic-live.py",
"sha256": "b33ff4b37582f669dddaa3170d048050514ffb13389cfa5ab795703e0acfa1c7"
},
{
"mode": "755",
"path": "scripts/verify-python-extropic-torx-live.py",
"sha256": "1de7729c6298580a8a44947d42e04b6a2c71a1a92de5362bcbbec807eae655b0"
},
{
"mode": "755",
"path": "scripts/verify-python-extropic-torx.py",
"sha256": "8c9212515cfc9bff073e6555b0b92df806d2773c27d4864b0a2ce100a8299920"
},
{
"mode": "755",
"path": "scripts/verify-python-runtime-external-worker.sh",
Expand Down Expand Up @@ -4119,5 +4139,5 @@
],
"schemaVersion": 1,
"sourceDirty": false,
"treeSha256": "ff7ab50f4fe171ffefd459c0abfbe314126dc3b5cfc32fd36045af32fb71efe7"
"treeSha256": "6ede7d4303711c80c351578da49700971ce01b18baa4729cf9566bc6e4561649"
}
41 changes: 41 additions & 0 deletions docs/guides/extropic-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,32 @@ is useful for stochastic workloads whose results need an explicit replay and
evaluation input; it accepts an integer or string in the configured seed
field.

## Prove a real Torx workload locally

The repository includes a small parameterized stochastic circuit that uses
the [public Torx API](https://github.com/extropic-ai/torx) rather than a
placeholder compute function. It evaluates a two-wire circuit with an explicit
seed and returns a normalized JSON distribution through the same
registered-workload boundary.

Torx 0.0.1 requires Python 3.11 or newer. The proof extra pins the current Torx
and JAX compatibility line without changing Vyral's Python 3.10 baseline:

```bash
python3.12 -m venv .venv
. .venv/bin/activate
python -m pip install --editable "runtimes/python[extropic-torx]"
python scripts/verify-python-extropic-torx.py
```

The verifier executes
[`examples/python/extropic_torx_workload.py`](../../examples/python/extropic_torx_workload.py)
locally, prepares the exact Extropic cloudpickle envelope, removes the
application module from a clean child process, and executes the transported
function again. It creates no provider job and consumes no credits. This is
evidence for Torx API compatibility and workload packaging, not evidence for
the hosted sandbox or Z1.

## Lifecycle and recovery

Extropic 0.5 submission has three provider operations: create, upload, and
Expand Down Expand Up @@ -125,6 +151,9 @@ platform failures. Provider error detail is kept out of public results.

- Compatibility is pinned to `extro-sim >=0.5,<0.6`. The SDK and provider are
new enough that minor contract changes should be expected and reviewed.
- The optional local Torx proof pins `extro-torx ==0.0.1` and JAX 0.11.x. Torx
is not a Vyral runtime dependency and its Python 3.11 floor does not narrow
the base runtime's supported Python versions.
- Vyral serializes plain registered Python functions by value so the sandbox
does not need the host application's module. Imported packages must already
exist in the sandbox image. Callable objects and helpers imported from other
Expand Down Expand Up @@ -163,3 +192,15 @@ VYRAL_EXTROPIC_LIVE=1 EXTROPIC_TOKEN="..." \

The command consumes provider credits and leaves the terminal provider job in
the account's history. Review the receipt and account job list after every run.

After the dependency-free smoke succeeds, an operator can separately prove
that Extropic's current L4 sandbox contains the Torx/JAX workload dependencies:

```bash
VYRAL_EXTROPIC_TORX_LIVE=1 EXTROPIC_TOKEN="..." \
python scripts/verify-python-extropic-torx-live.py
```

This second command is intentionally absent from ordinary CI. It consumes L4
credits, never opens browser authentication, emits a redacted receipt, and
does not turn the prototype into an adapter-qualification or hardware claim.
17 changes: 17 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ requires API-key authentication. The key is resolved inside the task and is
not passed as a Prefect flow parameter. This is an optional composition recipe,
not a Prefect runtime adapter or a provider-qualification claim.

## Extropic and Torx

`python/extropic_torx_workload.py` places a real Torx parameterized stochastic
circuit behind Vyral's durable execution lifecycle. On Python 3.11 or newer,
install the isolated proof dependencies and run the deterministic local and
clean-process packaging check:

```bash
python -m pip install --editable "runtimes/python[extropic-torx]"
python scripts/verify-python-extropic-torx.py
```

That check does not contact Extropic or consume credits. The separately gated
live script is documented in the
[Extropic execution guide](../docs/guides/extropic-execution.md); it is not an
ordinary example command or a Z1 support claim.

## GraphRAG Recipes

GraphRAG works best when the record collection remains the retrieval source of truth and the graph is used to add bounded relationships, provenance, and review state around retrieved chunks.
Expand Down
103 changes: 103 additions & 0 deletions examples/python/extropic_torx_workload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
"""A real Torx program behind Vyral's durable execution boundary.

Install ``runtimes/python[extropic-torx]`` on Python 3.11 or newer, then run
this file directly for the local result. Remote dispatch remains an explicit,
credit-consuming operator action; see ``scripts/verify-python-extropic-torx-live.py``.
"""

from __future__ import annotations

import json
from typing import Any

from vyral_runtime import (
ExecutionRunContext,
ExecutionRunResult,
execution_plugin,
vyral,
)
from vyral_runtime.integrations.extropic import (
ExtropicAdapterOptions,
ExtropicExecutionAdapter,
)


WORKLOAD_ID = "example.extropic.torx-density.v1"
HANDLER_ID = "example.extropic.run-torx-density"
PLUGIN_ID = "example.extropic.torx"
EXAMPLE_PAYLOAD = {"seed": 7}


def torx_density_workload(payload: Any) -> dict[str, Any]:
"""Evaluate a two-wire parameterized stochastic circuit with Torx.

Imports stay inside the registered function: the remote Extropic sandbox
supplies Torx and JAX, while Vyral transports this application function by
value. The explicit seed makes parameter initialization replayable.
"""

if not isinstance(payload, dict):
raise TypeError("Torx workload payload must be an object.")
seed = payload.get("seed")
if isinstance(seed, bool) or not isinstance(seed, int):
raise TypeError("Torx workload seed must be an integer.")
if not 0 <= seed <= 2**31 - 1:
raise ValueError("Torx workload seed must be between 0 and 2^31 - 1.")

import jax
import jax.numpy as jnp
from torx import psc

circuit = psc.DiscretePCircuit(
[
psc.PNOT(0),
psc.PCNOT([0, 1]),
]
)
parameters = circuit.init_params(jax.random.key(seed))
simulator = psc.StateVectorSimulator()
compiled = simulator.build_circuit(circuit, parameters)
initial_state = jnp.array([1.0, 0.0, 0.0, 0.0])
density = simulator.density(compiled, initial_state)
distribution = [float(value) for value in density.tolist()]
return {
"seed": seed,
"distribution": distribution,
"normalization": float(sum(distribution)),
}


extropic_torx = ExtropicExecutionAdapter(
WORKLOAD_ID,
torx_density_workload,
options=ExtropicAdapterOptions(
tier="l4",
timeout_seconds=60,
require_seed=True,
),
)


@vyral(
HANDLER_ID,
plugin=PLUGIN_ID,
name="Run Torx density",
max_attempts=1,
tags={"provider": "extropic", "library": "torx"},
)
async def run_torx_density(
context: ExecutionRunContext,
) -> ExecutionRunResult:
return await extropic_torx.execute(context)


plugin = execution_plugin(
PLUGIN_ID,
name="Example Extropic Torx workloads",
version="0.1.0",
handlers=(run_torx_density,),
)


if __name__ == "__main__":
print(json.dumps(torx_density_workload(EXAMPLE_PAYLOAD), sort_keys=True))
5 changes: 4 additions & 1 deletion runtimes/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ reconnected and retried by id. The integration is a prototype, remains outside
the adapter qualification matrix, and makes no Z1 support claim. Registered
workloads should be self-contained plain Python functions; Vyral serializes
those functions by value, while third-party imports must exist in Extropic's
sandbox. See the
sandbox. A pinned `extropic-torx` extra and
[`examples/python/extropic_torx_workload.py`](../../examples/python/extropic_torx_workload.py)
provide a real, credit-free Torx packaging proof on Python 3.11 or newer. See the
[Extropic execution guide](../../docs/guides/extropic-execution.md) for the
complete lifecycle and current boundaries.

Expand All @@ -251,6 +253,7 @@ complete lifecycle and current boundaries.
| Talk to a running .NET or Python Vyral host | `vyral-client` |
| Run Vyral in-process without a server or .NET | `vyral-runtime` |
| Run a Python-hosted REST and MCP endpoint | `vyral-runtime[server]` |
| Rehearse the current Extropic/Torx proof locally | `vyral-runtime[extropic-torx]` (Python 3.11+) |

The existing `vyral-client` distribution remains the supported lightweight
client for a running Vyral server. `vyral-runtime` is a separate distribution
Expand Down
5 changes: 5 additions & 0 deletions runtimes/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ server = [
extropic = [
"extro-sim>=0.5,<0.6"
]
extropic-torx = [
"extro-sim>=0.5,<0.6",
"extro-torx==0.0.1",
"jax>=0.11,<0.12"
]
dev = [
"build>=1.2,<2",
"coverage==7.15.4",
Expand Down
Loading
Loading