Skip to content

Add cancellation semantics to decoder - #833

Open
eliotheinrich wants to merge 8 commits into
NVIDIA:mainfrom
eliotheinrich:pr-cooperative-cancellation
Open

eliotheinrich wants to merge 8 commits into
NVIDIA:mainfrom
eliotheinrich:pr-cooperative-cancellation

Conversation

@eliotheinrich

@eliotheinrich eliotheinrich commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds a cancellation_source containing shared cancellation state for ensemble decoders, which can be queried via a cancellation_token. This will be used for orchestrating ensembles of decoders under deadlines. Decoders gain an overloaded decode(syndrome, token) call, allowing them to provide an appropriate behavior for polling the token and aborting early, returning a nullopt. Default behavior is to ignore the token and delegate to decode(syndrome).

The trt_decoder inference does not provide an interface for cancellation, but it does pass the cancellation token to the global decoder. The sliding_window decoder does the same.

Self-review checklist

Please confirm each item before requesting review. Check [x] or strike
through and explain.

Before requesting review

  • I reviewed my own full diff in GitHub or my editor.
  • PR is in Draft if it is not yet ready for review.
  • Temporary / debugging changes have been removed.
  • Local test logs reviewed; no unexplained warnings or errors.
  • CI logs reviewed; no unexplained warnings or errors.
  • Full CI has been run.

Scope and size

  • PR is under ~1000 lines, or an exception is justified in the description.
  • Refactoring-only changes are isolated in their own PR(s).
  • No existing tests were disabled or modified just to make this PR pass
    (if so, an issue has been raised).

Tests

  • New functionality has new tests.
  • Tests fail if the new functionality is broken (including crashes), not
    just when it is missing.
  • Negative tests added where exceptions are expected.
  • Truth data added where simple EXPECT_* / assert checks are
    insufficient for algorithmic correctness.
  • CI runtime impact considered; team notified if significant.

Documentation

  • Public-facing APIs have Doxygen docs.
  • User-visible behavior changes have public docs, or a follow-up is
    tracked.

Code style

  • Naming follows the existing convention (snake_case vs camelCase) for
    the area being modified.

Dependencies

  • No new third-party dependencies, or the team has been notified and
    OSRB tickets filed.

@copy-pr-bot

copy-pr-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@eliotheinrich
eliotheinrich force-pushed the pr-cooperative-cancellation branch from 2599c6b to 92ee650 Compare September 16, 2026 22:46
…for trt_decoder and sliding_window

Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
@eliotheinrich
eliotheinrich force-pushed the pr-cooperative-cancellation branch from 92ee650 to a21505d Compare September 16, 2026 22:51
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
@eliotheinrich
eliotheinrich force-pushed the pr-cooperative-cancellation branch from b370c45 to a27907b Compare September 17, 2026 00:51
eliotheinrich and others added 3 commits September 16, 2026 19:07
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
@eliotheinrich
eliotheinrich marked this pull request as ready for review September 17, 2026 15:21
Comment thread libs/qec/lib/decoders/sliding_window.cpp
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
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.

2 participants