Skip to content

fix(qec): correct PyMatching merged-edge mapping and realtime observable output - #799

Draft
vedika-saravanan wants to merge 2 commits into
NVIDIA:mainfrom
vedika-saravanan:vedika/pymatching-o-matrix-bug-fix
Draft

fix(qec): correct PyMatching merged-edge mapping and realtime observable output#799
vedika-saravanan wants to merge 2 commits into
NVIDIA:mainfrom
vedika-saravanan:vedika/pymatching-o-matrix-bug-fix

Conversation

@vedika-saravanan

@vedika-saravanan vedika-saravanan commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix two PyMatching issues in the realtime decoding path:

  • Make parallel-edge error output map back to the H-column retained by the configured merge strategy.
  • Pass the observable matrix to top-level realtime PyMatching construction so it uses native decode_to_obs output instead of decoding to error bits followed by observable projection.

Adds regression coverage for keep_original, independent, smallest_weight, and replace, plus realtime observable-output construction.

Runtime / performance impact

GB200, surface code d=7 / r=7, 1,000 decode-triggering shots per run:

Metric Before After
PyMatching decoder_call average 5.09–5.47 µs 3.35–3.70 µs
Final syndrome arrival to corrections ready average 13.78–14.09 µs 12.09–12.31 µs

All three post-change server runs passed with zero residual logical errors.

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. No new exception path.
  • Truth data added where simple EXPECT_* / assert checks are
    insufficient for algorithmic correctness.
    The small explicit graph has exact expected outputs.
  • CI runtime impact considered; team notified if significant.

Documentation

  • Public-facing APIs have Doxygen docs. No public API was added or changed.
  • User-visible behavior changes have public docs, or a follow-up is
    tracked.
    This is an internal correctness and performance fix.

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.

…y retains after a parallel-edge merge, matching the behavior of each merge strategy

Signed-off-by: vedika-saravanan <vsaravanan@nvidia.com>
…le output

Signed-off-by: vedika-saravanan <vsaravanan@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