Skip to content

CC engine: MRV branching and seed-anchored reversed-BFS row order (GH-183, opt-in; do not merge before PI says merge) - #204

Merged
guluchen merged 6 commits into
mainfrom
experiment/gh-183-cc-roworder
Oct 30, 2026
Merged

guluchen merged 6 commits into
mainfrom
experiment/gh-183-cc-roworder

Conversation

@guluchen

@guluchen guluchen commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Experiment record for #183 (hub #15). Stacked on #162 / PR #180 (tiebreak, not merged). Do not merge before the PI says merge.

What changed

  • New opt-in flag -cc-roworder=index|bfs (default index, byte-identical to the current output).
    • bfs renumbers the rows of H inside each half search. It runs a BFS over the Tanner graph from the rows of the first seed qubit, restarts it from the lowest unreached row until every row is reached, and then reverses the order.
    • The internal index drives the greedy packing scan and the mrv tie-break.
    • It is a pure row permutation, the same kind of change as the -cc-seed row shuffle.
  • Test variant -cc-tbbase=desc|asc (default desc): the base order of the tiebreak rule's per-seed qubit orders.
  • Part A (no code): mrv composed with overlap,tiebreak. The token already existed. cc_half.h (2) and every rule's argument, including tiebreak's (A)-(C), keep an arbitrary fixed target reachable whichever odd row is branched on, so mrv composes soundly.
  • Soundness write-up in MODIFICATIONS.md ([Mac agent] CC engine: MRV branching and BFS row order on top of tiebreak #183). Credit in NOTICE / MODIFICATIONS / README: the reversed-BFS row ordering idea is from Qubitserf 04b9349 (S. Cercelescu, MIT), re-implemented, no code copied.
  • Test-only mutants:
    • 19: the bfs order drops a row.
    • 20: no BFS restart, so rows unreachable from the seed are lost.

Validation (Tier 0, PASS)

  • make test-cc (default sizes): CC_ENGINE_TESTS PASS.
    • New Part R: 300 halves, 384,000 ladders, 0 bad. It covers 64 rule subsets x {-, overlap, overlap+tiebreak} x 4 seeds with roworder bfs, plus tbbase asc under both orders, against brute force with GF(2) witness checks.
    • Every bfs order uses every row.
    • bfs changes the node count on 66 instances.
    • Mutant 19: 9,088/28,800 ladders wrong. Mutant 20: 4,656/28,800 wrong.
    • Part B / H driver configurations with bfs / asc: 0 bad.
  • Part R at 2,000 instances: 2.56M ladders, 0 bad. Mutant 19: 53,568 wrong; mutant 20: 29,448 wrong.
  • Identity: tier0+1 -v logs vs [Mac agent] CC engine: orbit-compatible even-weight overlap tie-break #162 97c8629 are identical in 12 configurations (MaxSAT -no-card / -card-mto; CC default, -ub-search=off, -cc-stats, -cc-aut=off, tiebreak, tiebreak+mrv; defaults given explicitly). The one exception is a known timing-dependent ub-pre line (BB_108 -card-mto), which also differs between two base runs.
  • Answers: 23 tier0-3 codes x 10 variants (bfs / asc / mrv, seeds, dual off, aut off, index rule, old rules), 230 runs, all correct. 134 FOUND / UB witnesses verified by an independent GF(2) script.
  • make test-cc-flags: PASS.

Tier 1-4 seed panel

Setup: yfclab2, 5 seeds, pinned cores 29-32 and 34-43, 4 GB cap. Arms:

  • main = main 6083e66 with CC defaults;
  • tb = excl,pack,orbf,parity,leaf,overlap,tiebreak;
  • tbmrv = tb + mrv;
  • tbmrvbfs = tbmrv + -cc-roworder=bfs;
  • tbmrvbfsa = tbmrvbfs + -cc-tbbase=asc.

Geomean of median wall ratios (max cell):

Tier tbmrv vs main tbmrvbfs vs main tbmrvbfs vs tb tbmrvbfsa vs main
1 (2 cells, process floor) 1.083 (1.222) 1.083 (1.222) 1.006 (1.043) 1.011 (1.111)
2 (6) 0.677 (0.974) 0.611 (0.974) 0.655 (0.974) 0.612 (1.000)
3 (2) 0.643 (0.861) 0.593 (0.831) 0.590 (0.838) 0.596 (0.836)
4 (1) 0.428 0.400 0.436 0.409
  • Tier 1 is at the process floor. Wall times are 20-35 ms with 6-14 ms user time, and single runs flip between about 0.026 and 0.034 s. A re-measurement with 11 round-robin repetitions per (code, seed, arm) on one core gives every arm 1.014-1.020 vs main, tb included (1.017), and 0.996-1.003 vs tb. The CC nodes fall 13-16 %.
  • BB: BB_144 0.62, BB_288 0.49, GB_144 0.75 vs main. Nodes at equal levels: BB_144 L13 3.55M → 1.77M, BB_288 L16 695k → 363k vs tb.
  • TN (panel): TN_108 0.45, TN_144 0.42, TN_200 0.52, TN_250 0.40 vs main. Almost all of this comes from mrv.

Tier 5 (6 h, default seed)

Candidate arms: tbmrvbfs, and tbmrvbfsa on the BB codes. Cores 29-32, 34-39, 41-43; 28, 33 and 40 were taken by other users at the start.
Reference arms main and tb: GH-162's Tier 5 runs (same server, 2026-10-29); TN_252 and TN_288 get main and tb arms in this run.
Tables: optimization/experiments/GH-183/S1/tier5_table.md.

Code main tb tbmrvbfs tbmrvbfsa
BB_360_12_24 d=24 @ 169 s d=24 @ 67 s d=24 @ 28 s d=24 @ 26 s
BB_756_16_30to34 lb 30 (30 @ 15928 s) lb 30 (@ 5893 s) lb 32 (30 @ 1777, 32 @ 10437 s) lb 32 (32 @ 10525 s)
BB_864_4_30to40 lb 30 (@ 11793 s) lb 30 (@ 4294 s) lb 32 (32 @ 9951 s) lb 32 (32 @ 8941 s)
BB_1080_4_30to48 lb 30 (@ 13518 s) lb 32 (32 @ 19378 s) lb 32 (32 @ 7127 s) lb 32 (32 @ 6739 s)
LP_1020 / 1054 / 1122 0 / 2 / 5 s 0 / 2 / 5 s 0 / 2 / 6 s -
LP_1428_184_24 121 s 120 s 193 s -
LP_1768_224_22 16 s 16 s 24 s -
LP_2610_744_16 3 s 3 s 9 s -
TN_252_2_21 (row wt 9) d=21 @ 9749 s d=21 @ 9738 s d=21 @ 11388 s -
TN_288_2_22to24 (row wt 9) lb 22 (@ 19266 s) lb 22 (@ 18754 s) lb 21 -
TN_496_2_23to30 lb 23 (@ 12823 s) lb 23 (@ 9579 s) lb 24 (23 @ 3581, 24 @ 10807 s) -

Equal-level nodes and time vs tb (main in parentheses):

Code and level Nodes Time
BB_360 L22 0.38 (0.13) 0.40 (0.16)
BB_756 L28 0.27 (0.09) 0.29 (0.11)
BB_864 L28 0.36 (0.12) 0.39 (0.14)
BB_1080 L28 0.36 (0.08) 0.39 (0.09)
TN_496 L22 0.31 (0.22) 0.38 (0.28)
  • With asc, the BB rows are a further 0.95-0.98 in time.
  • The bold lower bounds are new (BB_756 >= 32, BB_864 >= 32, TN_496 >= 24). They were PLAUSIBLE when found. All three were later REPRODUCED by relabeled seeds 1-3 (see the cross-check section below). Stems are unchanged.
  • BB_1080: lb 32 in 2.7x less time than tb, but lb 34 is not reached in 6 h.

Watch items: LP and weight-9 TN codes

On the Tier 5 LP codes and on most row-weight-9 TN codes, the change is slower. LP and TN figures are back-to-back runs on one quiet pinned core (core 40): S2/lp_arms_core40.txt, S2/tn_arms_core40.txt.

Deepest common level, time vs tb:

Code (level) tb + mrv tb + bfs tb + mrv + bfs
LP_1054 (L18) 1.32 1.31 1.27
LP_1122 (L18) 1.21 2.14 1.37
LP_2610 (L14) 1.22 1.61 1.57
LP_1768 (L20) 1.28 3.12 1.57
LP_1428 (L22) 1.34 2.57 1.48
TN_180 (L16, both halves) 1.78 - 1.37
TN_216 (L16, both halves) 0.99 - 0.81
  • Nodes: mrv adds 1.1-1.2x on these LP codes. bfs additionally raises the cost per node.
  • The panel LP codes (LP_340 to LP_714) are neutral or better: LP_714 0.83 vs tb.
  • TN_180: mrv doubles the nodes of one half. TN_288 is slower on both halves (L20: Z 1.49x, X 1.20x nodes) and ends one lb lower. TN_252 takes 1.17x longer. TN_216 gains 0.81x.

Verdict and recommendation

  • Part A (mrv) and Part B (bfs) are sound and pass Tier 0.
  • Tiers 2-4: they pass clearly vs main and vs tb.
  • Tier 1: a process-floor tie, 1.7 % above main for every arm, including tb.
  • Large BB codes and TN_496: a 2.5-3.7x gain over tb at equal levels, and three new PLAUSIBLE lower bounds.
  • Tier 5 LP and three of four row-weight-9 TN codes: 1.2-3x slower, and TN_288 ends one lb lower.
  • Recommendation: do not adopt as an unconditional default. Merge the flags as opt-in at most; the PI decides.
  • Next round: a per-half probe, e.g. -cc-roworder=auto. At the first level that takes 1 s or more, re-run it with the other configuration (tb vs tb+mrv+bfs), aborting at the first run's time through the existing poll hook, and keep the faster one for that half. Every level is an independent exact search, so switching between levels is sound. The probe costs at most one extra level.
  • Cross-checks: the three new lower bounds need an independent search order, e.g. -cc-seed relabelled runs, before any stem change.

Cross-check (2026-10-30) of the PLAUSIBLE lower bounds: REPRODUCED (9/9 runs)

Setup:

  • Same frozen binary (d26070d) and configuration that found the bounds: -cc-rules=excl,pack,orbf,parity,leaf,overlap,tiebreak,mrv -cc-roworder=bfs.
  • Relabeled seeds -seed=1..3, which give a different qubit and row order and different orbit representatives.
  • 28800 s per run; yfclab2 cores 24-32, one pinned process per core, 4 GB cap.
Code Bound Seed 1 Seed 2 Seed 3 Verdict
BB_756_16_30to34 >= 32 12334 s 12360 s 12924 s REPRODUCED
BB_864_4_30to40 >= 32 10797 s 11645 s 11084 s REPRODUCED
TN_496_2_23to30 >= 24 12393 s 9640 s 11147 s REPRODUCED
  • Every level each run searched ended EMPTY, with no trap, withdrawn bound or science problem.
  • On the BB halves every column weight is odd, so the parity rule skips odd levels and level 30 EMPTY certifies 32.
  • This is an independent search order of the same implementation. Stems are not renamed; that needs the PI.
  • Records: optimization/experiments/GH-183/S3_xcheck/ (commit a8e4532).

Scientific semantics changed: no (opt-in flags; default output byte-identical).
PI action required: yes (adoption decision; Tier 1 process-floor judgement; family-dependent effect).

🤖 Generated with Claude Code

yfc and others added 3 commits October 29, 2026 22:38
…er) and -cc-tbbase=desc|asc, opt-in

The internal row index of each half search drives the packing scan order and the
mrv tie-break. bfs = BFS over the Tanner graph from the rows of the first seed,
restarted for unreached rows, then reversed; a row relabeling, so every verdict is
unchanged (proof in MODIFICATIONS.md). Default index: byte-identical output.
Tests: make test-cc Part R (64 rule subsets x {-, overlap, overlap+tiebreak} x 4
seeds, roworder bfs and tbbase asc vs brute force; rows-used check), driver configs
in Parts B and H, mutants 19 (a row dropped) and 20 (no BFS restart); flag checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and Tier 1-4 seed panel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s 1-3 (9/9 runs reproduce)

BB_756 >= 32, BB_864 >= 32, TN_496 >= 24 reproduced by every relabeled seed
(28800 s, every level EMPTY). Stems unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
guluchen pushed a commit that referenced this pull request Oct 30, 2026
…unds

PI decision 2026-10-31. Same matrices (git mv of Hx/Hz/Gx/Gz; only the
Gx/Gz header comment changes). Upper bounds unchanged.

  TN_360_4_17to24  -> TN_360_4_23to24   (GH-157)
  TN_396_4_17to26  -> TN_396_4_23to26   (GH-157)
  TN_504_2_17to34  -> TN_504_2_24to34   (GH-157)
  TN_648_10_9to32  -> TN_648_10_22to32  (GH-157)
  BB_1080_4_30to48 -> BB_1080_4_32to48  (GH-162, reproduced by GH-183)
  BB_756_16_30to34 -> BB_756_16_32to34  (GH-183)
  BB_864_4_30to40  -> BB_864_4_32to40   (GH-183)
  TN_496_2_23to30  -> TN_496_2_27to30   (GH-181)

Lower bounds: DistQLDPC's optional CC engine with opt-in rules that are
not on main (charge, PR #161; tiebreak with mrv / -cc-roworder=bfs,
PRs #180 / #204; sparse,sparseov,sparsemrv, PR #203), each reproduced
with a different search order or binary of the same engine (not an
independent second method).

Updated: data/matrices/README.md (tier5 list, rename history, open
items), NOTICE, README naming example, name columns of
optimization/baselines/SERVER.md and main_server_reference.json. The
upper-bound witnesses for these eight stems are copied under the new
stems to optimization/experiments/GH-146/witnesses/renamed-2026-10-31/
(VERIFY.txt: 8/8 VALID). Historical experiment records are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
guluchen pushed a commit that referenced this pull request Oct 30, 2026
…unds

PI decision 2026-10-31. Same matrices (git mv of Hx/Hz/Gx/Gz; only the
Gx/Gz header comment changes). Upper bounds unchanged.

  TN_360_4_17to24  -> TN_360_4_23to24   (GH-157)
  TN_396_4_17to26  -> TN_396_4_23to26   (GH-157)
  TN_504_2_17to34  -> TN_504_2_24to34   (GH-157)
  TN_648_10_9to32  -> TN_648_10_22to32  (GH-157)
  BB_1080_4_30to48 -> BB_1080_4_32to48  (GH-162, reproduced by GH-183)
  BB_756_16_30to34 -> BB_756_16_32to34  (GH-183)
  BB_864_4_30to40  -> BB_864_4_32to40   (GH-183)
  TN_496_2_23to30  -> TN_496_2_27to30   (GH-181)

Lower bounds: DistQLDPC's optional CC engine with rules that were
opt-in when the bounds were found (charge, default on main since
PR #161; tiebreak with mrv / -cc-roworder=bfs, PRs #180 / #204, and
sparse,sparseov,sparsemrv, PR #203, not on main), each reproduced with
a different search order or binary of the same engine (not an
independent second method).

Updated: data/matrices/README.md (tier5 list, rename history, open
items), NOTICE, README naming example, name columns of
optimization/baselines/SERVER.md and main_server_reference.json. The
upper-bound witnesses for these eight stems are copied under the new
stems to optimization/experiments/GH-146/witnesses/renamed-2026-10-31/
(VERIFY.txt: 8/8 VALID). Historical experiment records are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…H-183

Conflicts resolved by keeping both sides:
- HalfSearch takes the GH-183 row order / tbbase arguments; the driver also
  passes the GH-157 charge settings. DriverOptions keeps both field sets.
- -cc-mutant accepts 0..15, 17..20; header mutant list and MODIFICATIONS
  file table merged; cc_half.h doc keeps the row-order and charge notes.
- tests/test_cc_engine.cc: ladder_ok takes the GH-157 arguments first, then
  the GH-183 ones (Part R calls updated); Part B Cfg has lbminr, lbgap, ro,
  asc; the bfs/asc driver configs that stand for the candidate use the new
  default rules (with charge) + tiebreak; new "charge-mrv-bfs-minr1";
  Part R runs charge on seeds 1 and 3.
- tests/test_cc_flags.sh: default rules + tiebreak,mrv with bfs accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@guluchen
guluchen changed the base branch from experiment/gh-162-overlap-tiebreak to main October 30, 2026 18:10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@guluchen
guluchen merged commit 7d91569 into main Oct 30, 2026
3 checks passed
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