Skip to content

Add cancellable execution contexts, deadlines, budgets, and progress events #13

Description

@Super-Genius

Problem

The processor interface is a synchronous StartProcessing() call with an atomic percentage value. It has no cancellation token, deadline, resource budget, checkpoint, structured progress event, or partial-result callback.

This makes long GCS, inference, compute, and render jobs hard to stop safely, monitor by pass, or limit when a branch is no longer needed.

Scope

Introduce an execution context passed through ProcessingManager and every executor with:

  • Execution, attempt, pass, and subtask identifiers.
  • Cooperative cancellation token.
  • Overall and per-pass deadlines.
  • CPU, GPU, RAM/VRAM, disk, network, runtime, and output-size budgets where enforceable by the executor.
  • Structured progress events with pass ID, stage, completed work, total work, and message.
  • Partial-result and checkpoint callbacks for processors that support them.
  • Clear terminal states for completed, cancelled, timed out, budget exceeded, and failed.
  • Safe cleanup of Vulkan resources, MNN sessions, loaded artifacts, and pending asynchronous saves.

Do not duplicate SuperGenius queue locking or task ownership. This issue defines the SGProcessingManager execution-control contract that SuperGenius can drive.

Acceptance criteria

  • A running MNN or Vulkan test job can be cancelled without leaking resources or publishing a successful result.
  • Deadline and output-size limits produce distinct typed failures.
  • Progress events identify the active pass and stage rather than only exposing one float.
  • Checkpoint-capable tests can resume from a saved checkpoint; processors without checkpoint support report that clearly.
  • Existing processors remain usable through an adapter during migration.

Supports GCS early cancellation and long-running compute/render workloads.

Base implementation and review work on the branch consumed by SuperGenius/develop.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions