Skip to content

🐛 Store the tetrahedral circuits of the solver-test fixture - #968

Open
lsschmid wants to merge 1 commit into
mainfrom
fix/deterministic-solver-fixture
Open

lsschmid wants to merge 1 commit into
mainfrom
fix/deterministic-solver-fixture

Conversation

@lsschmid

@lsschmid lsschmid commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Description

Since #965, the Ubuntu x86 test job on main fails in the minimums-3.12 session. Every case of test_solver_proposals_are_valid fails in setup. The designs fixture of test_solvers.py asserts:

low2 = proposals(_FirstChecksBlock(), _code_design("tetrahedral", 2), (), ctx)[0][1]
assert check_ft(low2.circuit(), low2.root.state, 1).ok

The fixture built this t = 2 tetrahedral design from two synthesized circuits:

  • the heuristic preparation circuit of the code;
  • an ancilla circuit that circuit_choices picked from several greedy and random syntheses.

In that one session, the result was not FT at t = 1. All other sessions, the other runners, and the same session on another x86 Linux machine passed. So the synthesized circuits depend on the environment.

This pull request stores both circuits in the test:

  • _tetrahedral_design() builds the design from the stored preparation circuit.
  • _FirstChecksBlock.propose adds a Z block on the first five checks with the stored ancilla circuit.

The fixture then needs neither circuit synthesis nor a cover ILP, so the design is the same in every environment. The stored circuits are the ones the synthesis produces on the machines where the test passed. The fixture's assertions (FT at t = 1, not FT at t = 2) still hold.

Coverage of test_solvers.py in CI mode loses no line; it covers 10 more lines than before.

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

AI assistance: Claude Opus 5.5 via Claude Code wrote the test change and this description.

🤖 Generated with Claude Code

The designs fixture of test_solvers.py built a t = 2 design from the heuristic
preparation circuit of the tetrahedral code and a synthesized ancilla circuit,
and asserted that a block on the first five checks leaves only second-order
failures. In the minimums-3.12 session on the Ubuntu x86 runner, the assertion
failed, so every solver test failed in setup. The fixture now builds the design
from stored circuits, so it does not depend on the circuit synthesis.

Assisted-by: Claude Opus 5.5 via Claude Code
@lsschmid

lsschmid commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 AI text below 🤖

@coderabbitai review

Copilot AI balanced review requested due to automatic review settings December 2, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated solver test coverage for tetrahedral circuit synthesis, including checks of a distance-2 design built from a prepared circuit.

The solver tests now build the distance-2 tetrahedral design from a stored preparation circuit. _FirstChecksBlock proposes a block using the first five rows of the node’s Z-check basis and a stored ancilla circuit.

Changes: Tetrahedral solver fixture

Layer / File(s) Summary
Build and wire the tetrahedral fixture
tests/circuit_synthesis/ft_search/test_solvers.py
The tests add circuit and verification helpers, define stored Stim circuits, and build a distance-2 tetrahedral design. _FirstChecksBlock now proposes a block using the node’s Z-check basis and stored ancilla preparation. The fixture uses the new design helper.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to f16fd

This change only swaps the solver-test fixture over to stored circuits to fix an environment-dependent test setup failure. It does not affect production behavior, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "🐛 Store the tetrahedral circuits of the solver-test fixture" matches the main change. The PR replaces synthesized tetrahedral circuits in the test_solvers.py fixture with stored circuits. T…
Description check Passed The description follows the template. It has a Description section that explains the failing CI session, the cause (environment-dependent synthesis), and the fix (stored preparation and ancilla circui…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "🐛 Store the tetrahedral circuits of the solver-test fixture" matches the main change. The PR replaces synthesized tetrahedral circuits in the test_solvers.py fixture with stored circuits. The title has a leading emoji, which the guidelines discourage, but the title is otherwise specific and accurate.

Full details: Description check

Explanation

The description follows the template. It has a Description section that explains the failing CI session, the cause (environment-dependent synthesis), and the fix (stored preparation and ancilla circuits). It includes a Fixes line with a placeholder issue number that is not filled in, and the template's checklist is present. Two checklist items are left unchecked: CI checks pass and self-review. The AI disclosure is present. The Fixes line is still the template placeholder, which the author should either fill in or remove.

Resolution

Replace or remove the template placeholder line "Fixes #(issue)". If no issue is fixed, delete that line. Complete or explain the unchecked items, namely that CI checks pass and the self-review is done, before merge.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the circuit’s trace,
Then builds a tetrahedral place.
Five checks guide the block’s design,
Stored ancillas join the line.
The solver tests now hop in time.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: ae581310-d502-494b-8b87-5db9445fd8c8
Commits

Reviewing files that changed from the base of the PR and between 7bd424d and f16fd24.

Files selected for processing: 1

  • tests/circuit_synthesis/ft_search/test_solvers.py

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
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.

2 participants