Add boundary-aware overloads for canonicalize_for_rounds and sliding window decoder#656
Merged
Merged
Conversation
… window decoder Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
eliotheinrich
marked this pull request as ready for review
July 7, 2026 17:35
eliotheinrich
marked this pull request as draft
July 7, 2026 20:33
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
bmhowe23
reviewed
Jul 10, 2026
eliotheinrich
marked this pull request as ready for review
July 10, 2026 19:57
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
18 tasks
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
kvmto
reviewed
Jul 13, 2026
kvmto
reviewed
Jul 13, 2026
kvmto
reviewed
Jul 13, 2026
Collaborator
|
The rest seems good! :) |
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
Signed-off-by: Eliot Heinrich <38039898+eliotheinrich@users.noreply.github.com>
Signed-off-by: Eliot Heinrich <eheinrich@nvidia.com>
eliotheinrich
force-pushed
the
pr-boundary-alignment
branch
from
July 14, 2026 00:20
6cea65d to
fa1a05e
Compare
bmhowe23
approved these changes
Jul 14, 2026
bmhowe23
left a comment
Collaborator
There was a problem hiding this comment.
Thanks, @eliotheinrich!
bmhowe23
enabled auto-merge (squash)
July 14, 2026 03:46
bmhowe23
added a commit
to bmhowe23/cudaqx
that referenced
this pull request
Jul 14, 2026
Resolve conflicts from PR NVIDIA#656 (num_boundary_syndromes) against the declarative decoder-schema refactor: - decoding_config.h / config.cpp: keep the schema-based machinery; the typed per-decoder config structs (incl. main's num_boundary_syndromes field on sliding_window_config) stay removed. - sliding_window.cpp: integrate num_boundary_syndromes into the sliding_window parameter schema (uint64) so the framework accepts the key the constructor already reads, and mirror the constructor's num_boundary_syndromes <= num_syndromes_per_round constraint in the schema validate hook. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Ben Howe <bhowe@nvidia.com>
bmhowe23
added a commit
to bmhowe23/cudaqx
that referenced
this pull request
Jul 15, 2026
…ridge branch Main landed the squashed PR 670 plus NVIDIA#656/NVIDIA#673/NVIDIA#674/NVIDIA#678/NVIDIA#680/NVIDIA#683/NVIDIA#688/ NVIDIA#690/NVIDIA#691/NVIDIA#692. Resolution keeps this branch's design and ports main's content into it: - Naming: main's GpuRoce{Transceiver,Factory,LinkCheck} map 1:1 onto this branch's DeviceGraph* files (the de-transport-ing follow-up requested in the PR 670 review). Main's post-review fixes are ported into the renamed files: ring-size overflow + host-page-size alignment validation, gpu_id resolved from the decoder's cuda_device_id instead of an env var, the factory taking pinned_cuda_device, and the linkcheck exercising the new factory signature. - Schema: per-decoder 'dispatch: host|device_graph' plus the top-level transport section stay; main's per-decoder 'transport:' key does not return. cuda_device_id is adopted as a per-decoder placement knob (config struct + YAML trait), and the hsb script now injects 'dispatch: device_graph' + cuda_device_id and drives the server with QEC_DEVICE_GRAPH_* env and the device_graph READY sentinel. - Features adopted from main: decoder CUDA-device pinning (worker-thread pin via promise, graph-capture pin, hardware_guards.h), per-session decode counters + print_session_stats + QEC_DECODING_SERVER_STATS server-side stats printing, DecodingServer ctor exception safety, virtualized realtime decoder API (NVIDIA#674), CMP0126 fix, CUDA::cudart on the core lib, and the cudevice-archive dedup in the server link. - DecodingSession combines main's set_graph_capture_device with this branch's reserved-SMs decode-graph capture (QEC_DEVICE_GRAPH_RESERVED_SMS). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Ben Howe <bhowe@nvidia.com>
anjbur
added a commit
to anjbur/cudaqx
that referenced
this pull request
Jul 16, 2026
…sliding window decoder (NVIDIA#656)" This reverts commit 131c4d0. Signed-off-by: Angela Burton <angelab@nvidia.com>
anjbur
added a commit
to anjbur/cudaqx
that referenced
this pull request
Jul 16, 2026
Signed-off-by: Angela Burton <angelab@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #649
The addition of boundary detectors offsets the syndromes output by memory circuit experiments by introducing
num_boundary_syndromesat the beginning and end of the syndrome block. The means thatcanonicalize_for_roundsstraddles the new boundaries between rounds, leading to error mechanisms being associated to incorrect rounds when the boundary syndromes have a different length than the inter-round syndromes. This is a cosmetic error for PCMs representing entire memory circuits, but is incorrect when followed up withget_pcm_for_roundsfor the purpose of, i.e., the sliding window decoder.This PR adds round-aware overloads to
canonicalize_for_roundsand the sliding window decoder, bringing them up-to-date with syndrome format.canonicalize_for_roundshas a new overload which acceptsnum_boundary_syndromes, which appropriately treats the first and lastnum_boundary_syndromescolumns as distinct rounds for the purpose of round-based topological sorting.The sliding window decoder now takes an additional parameter
num_boundary_syndromes(default 0). The PCM of the decoder is zero-padded to have uniform widthnum_syndromes_per_round. Syndromes passed to the decoder are automatically padded to the uniform length. Ifnum_boundary_syndromesis 0, then the boundary syndromes are presumed to be the same width as the interior syndromes (as is the case in X/Z-only experiments).New tests:
test_qec.cpp:PCMUtilsTester.checkGetSortedColumnIndicesWithBoundary: Verifies the boundary-aware column sort orderstest_qec.cpp:DetectorErrorModelTest.CanonicalizeBoundaryRejectsWideBoundary: Assertrscanonicalize_for_rounds(S, B, ...)throws when the boundary is wider than the interior (B > S).test_decoders.cpp::SlidingWindowDecoder.PreparePcmRejectsBadBoundaryLayout: Confirms the sliding-window decoder throws during construction for inconsistent boundary layouts (B > S, or a row count that can't fit[B | K·S | B]).test_qec_stim.cpp::QECCodeTester.checkDemFromMemoryCircuitShor9: Checks the Shor [[9,1,3]] full DEM has the expected non-uniform shape, consistent column counts, and correct round ordering.test_qec_stim.cpp::QECCodeTester.checkSlidingWindowShor9Boundary: A single all-rounds window decoding the Shor boundary DEM must match a full decoder for every DEM column.test_qec_stim.cpp:QECCodeTester.checkSlidingWindowShor9Streaming: Streams variable-width detector layers for X(Z) (6(2) at boundaries, 8 interior) through a sliding config (window=2, step=1) and requires results to match a full decoder.test_sliding_window.py::test_sliding_window_boundary_layout: Parametrized over 3 codes × 3 window counts; injects errors over 300 shots and asserts sliding-window observable predictions match a single_error_lut full decoder.Runtime / performance impact
N/A
Self-review checklist
Please confirm each item before requesting review. Check
[x]or strikethrough and explain.
Before requesting review
Scope and size
(if so, an issue has been raised).
Tests
just when it is missing.
EXPECT_*/assertchecks areinsufficient for algorithmic correctness.
Documentation
tracked.
Code style
snake_casevscamelCase) forthe area being modified.
Dependencies
OSRB tickets filed.