Mesh Scheduler Design

The mesh scheduler in InfraMind is not a single point of logic or infrastructure. It is a distributed coordination mechanism designed to assign AI inference jobs across an open network of independently operated nodes. Its goal is to optimize for latency, reliability, and execution integrity—without centralized orchestration. InfraMind’s scheduler is structured to operate in partial state, be tolerant of node churn, and enable near-instant routing of workloads regardless of geography or load volatility.

At its core, the scheduler is a stateless node assignment engine. It receives a job request from an endpoint invocation, queries its current index of registered nodes, filters for eligibility, ranks candidates by proximity and availability, and dispatches the job to the best match. The system does not wait for consensus or quorum and assumes imperfect global visibility. Instead, it relies on local heuristics, node declarations, and job retries to maintain liveness and throughput.

Proximity-based assignment is the first routing layer. When a job is created, the scheduler parses the caller’s IP or origin signature, matches it to a geolocation zone, and narrows the candidate set to nodes with low ping latency to that region. Nodes include a region_hint in their heartbeat, but the scheduler maintains its own active ping map by performing low-frequency active tests against each registered node.

Example latency profile:

{
  "job_origin": "fr-par",
  "latency_map": {
    "node_a": 22,
    "node_b": 109,
    "node_c": 38,
    "node_d": 340
  }
}

The first filter is applied to remove any node with average latency above a protocol-defined threshold (e.g., 150ms). Remaining nodes are sorted.

Node capability matching is then applied. Each job includes a manifest of required runtime properties:

{
  "cpu": 2,
  "memory": 2048,
  "gpu": true,
  "runtime": "python3.10",
  "entrypoint": "serve.py"
}

Each node’s heartbeat includes a declaration of current available resources, container engine state, and GPU presence. Nodes that cannot fulfill the job spec are removed.

This logic is locally evaluated and deterministic. Scheduler replicas are allowed to differ slightly in ordering but must agree on eligibility. This allows the mesh to scale horizontally, avoid bottlenecks, and perform intelligent partial routing under load.

Load balancing is performed by ranking the eligible set by a scoring function:

score = w1 * (1 / latency) +
        w2 * (success_rate_rolling) +
        w3 * (stake_weight) +
        w4 * (recent_load_penalty)

Each weight (w1 to w4) is adjustable via protocol parameters. The result is a ranked set of candidates, and the top node is assigned the job.

For high-value jobs or batch workloads, the scheduler may assign multiple nodes and await the fastest valid proof. This allows redundancy and prevents single-node tail latency from degrading global SLA.

Redundancy fallback is activated under several conditions:

  • Node does not respond within t_ack_timeout (default 500ms)

  • Node begins job but fails to return proof within t_exec_max (e.g., 2000ms)

  • Job returns an error or invalid schema output

In all cases, the job is retried with the next-best node, and the failed node receives a penalty against its reputation score. Optionally, proofs of failed execution may be submitted for dispute or arbitration.

The full scheduler loop is executed within 30–70ms on average.

Job assignment pseudocode:

def assign_job(job):
    candidates = filter_by_proximity(job.origin)
    capable = filter_by_capability(candidates, job.requirements)
    scored = rank_nodes(capable)
    for node in scored:
        if node.is_ready():
            send_job_to_node(job, node)
            return
    fallback_to_queue(job)

Schedulers themselves are registered and discoverable via the node registry. Each node connects to the closest scheduler by latency and performs heartbeat synchronization, job polling, and peer sharing. Schedulers gossip node state between each other using a compact delta protocol over UDP or QUIC.

All jobs include a unique job_id, input payload, model reference, and assignment signature. Each scheduler signs its assignments to prevent forgery and to allow job tracing across the mesh.

Scheduler identity payload:

{
  "scheduler_id": "0x12F3...",
  "epoch": 1457123,
  "signature": "0xabcd...",
  "routing_decision": {
    "job_id": "7b3a-e1ff",
    "assigned_node": "0xB81d..."
  }
}

This data is submitted to the job oracle for optional auditing and payment finalization.

In case of regional failure, nodes can register themselves with fallback schedulers and resume operation without user intervention. Jobs are always routed to the best available node, even under degraded network conditions.

The scheduler is designed to be decentralized but not consensus-bound. It prioritizes speed, regional autonomy, and tolerance of temporary inconsistencies. Execution proofs, not assignment logs, are the source of truth.

In the event of scheduler isolation, nodes can accept job broadcasts directly and vote on assignment. This ensures continuity even under partial network partition.

The mesh scheduler is not a control plane. It is a coordination mechanism. It replaces provisioning logic with stateless job routing. It transforms the execution of AI models from a cloud-bound activity to a mesh-native system that performs in milliseconds, across borders, without a centralized gate. It is designed to vanish — and to work.

Last updated