Skip to content

Tighter LP lower bounds#230

Open
noajshu wants to merge 26 commits intomainfrom
ftl
Open

Tighter LP lower bounds#230
noajshu wants to merge 26 commits intomainfrom
ftl

Conversation

@noajshu
Copy link
Copy Markdown
Contributor

@noajshu noajshu commented Mar 31, 2026

An LP relaxation of the decoding problem is:
minimize \sum_e w_e x_e
such that for all activated detectors d: sum_{e incident to d} x_e >= 1.

The detcost is a specific feasible solution to the dual LP. This is:
maximize \sum_{activated detectors d, errors e} a_d
such that for all errors e: \sum_{activated d incident to e} a_d <= w_e.

The detcost feasible point provides an admissible lower bound that is fast to compute and fast to incrementally update, while still generally predictive. However it is suboptimal and we can consider using better solutions to the dual LP to derive tighter lower bounds on remaining cost.

One issue with many LP relaxations is they have one variable per error mechanism. These LPs are prohibitively expensive to solve naively since our error models have 100s of errors per detector. However, it can be seen that the dual LP above only cares about the distinct overlap sets of errors with the activated detector set. This makes it more lightweight to solve in practice. Using this technique along with some lazy evaluation tricks, we can decode 1000 shots of the gross code in about 2000s, with an effectively infinite beam, with only 1 low-confidence outcome:

bazelisk build src:tesseract_ftl && time ./bazel-bin/src/tesseract_ftl --circuit testdata/bivariatebicyclecodes/r\=12\,d\=12\,p\=0.001\,noise\=si1000\,c\=bivariate_bicycle_X\,nkd\=\[\[144\,12\,12\]\]\,q\=288\,iscolored\=True\,A_poly\=x\^3+y+y\^2\,B_poly\=y\^3+x+x\^2.stim --sample-seed 23443587 --sample-num-shots 1000   --threads 5  --print-stats --beam 1000  --pqlimit 1000000  --det-order-index --subset-detcost-size 1 --no-revisit-dets --det-order-seed 347534 --detector-choice-policy fewest_incident_errors

num_shots = 1000 num_low_confidence = 1 num_errors = 0 total_time_seconds = 2294.621702000004 lp_calls = 7508448 lp_reinserts = 1523422 projected_nodes_generated = 16312516 projected_nodes_refined = 1592743 child_candidates = 16312516 children_generated = 16312485

I'm not sure whether it is genuinely faster than Tesseract but I thought it was interesting to be able to decode the Gross code without heuristic cutoffs, ensembling, or beams.

There are related ideas in these papers, with the general idea being called 'operator cost partitioning':
https://cdn.aaai.org/ICAPS/2008/ICAPS08-022.pdf
https://arxiv.org/pdf/1401.3853
https://cdn.aaai.org/ojs/9668/9668-13-13196-1-2-20201228.pdf

noajshu and others added 9 commits March 28, 2026 16:59
… color codes in about 5 mins / shot without any beam cutoffs whatsoever using operator cost partitioning approach to improve over detcosts with naive LP implementation.
…ow_supports / rhs vectors before simplex solves.

  - Reused a single local_hits buffer while building deduplicated active supports.
  - Removed an unnecessary sort of local_hits; the local detector order was already stable.
  - Reused a monotone warm-start cursor when reading detector budgets from the parent exact solution, instead of restarting the search for every
    component.
… search behavior on the full 100-shot benchmark.

  Kept changes:

  - Avoid rebuilding detector parity from the full error chain on pop by caching each node’s residual detector bitset.
  - Speed up exact-refinement LP setup by reusing buffers, avoiding unnecessary temporary row/rhs copies, removing an unnecessary local-hit sort, and using
    a monotone warm-start cursor when pulling detector budgets from the parent exact solution.
  - Replace full-error scans during component construction with candidate-error gathering from the active detectors’ incidence lists.
  - Simplify union-find component assignment by mapping roots directly to component indices.
  - Add detailed FTL timing/stat counters for chain replay, component build, simplex, projection, and component-build subphases to guide further
    optimization.
…olicy order, fewest_incident_errors, --error-order-policy, --root-det-order-count, --root-det-order-depth, --exact-child-refine-count
@noajshu noajshu requested a review from a team as a code owner March 31, 2026 16:21
@noajshu noajshu requested review from LalehB and oscarhiggott and removed request for a team March 31, 2026 16:21
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