Skip to content

Handling of trailing enqueues on realtime paths - #784

Draft
eliotheinrich wants to merge 1 commit into
NVIDIA:mainfrom
eliotheinrich:pr-enqueue-trailing
Draft

Handling of trailing enqueues on realtime paths#784
eliotheinrich wants to merge 1 commit into
NVIDIA:mainfrom
eliotheinrich:pr-enqueue-trailing

Conversation

@eliotheinrich

Copy link
Copy Markdown
Collaborator

Description

The current realtime path is inconsistent when the trailing measurements are not referenced by any detectors. Decoders fire once num_msyn_per_decode syndromes are accumulated, but if further syndromes are enqueued after this point, the syndrome buffer is corrupted, depending on the realtime path followed.

On the decoding server, any enqueue while shot_state == rseult_ready immediately reset the state to colleting, discarding pending correction result before the client can retrieve it.

On the in-process path (i.e. decoder::enqueue_syndrome), the decoder firing sets msyn_buffer_index = 0, so trailing measurements were written into the syndrome buffer at index 0. If reset_decoder is not called, the next shot is silently corrupted.

This PR fixes the decoding server path by introducing a total_circuit_measurements field to the decoder class, allowing for the decoder to absorb trailing measurements without disturbing the corrections result. The budget defaults to num_msyn_per_decode (i.e. no trailing measurements), and the caller can set it higher when circuits produce trailing syndromes. The total number of measurements is available as a field of the decoder context.

Runtime / performance impact

N/A

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.

…g enqueues

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.

1 participant