Skip to content

Preserve empty ChainBlock in chsubblocks - #592

Open
GiggleLiu wants to merge 2 commits into
masterfrom
automanage/fix-empty-chsubblocks
Open

GiggleLiu wants to merge 2 commits into
masterfrom
automanage/fix-empty-chsubblocks

Conversation

@GiggleLiu

@GiggleLiu GiggleLiu commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

chsubblocks(chain(3), Any[]) previously returned a curried LegibleLambda instead of a chain. Rebuilding empty generic inputs now preserves both the original register size and qudit level; nonempty inputs retain the existing parsing and size checks.

The empty fallback explicitly preserves D, so a qutrit chain remains a qutrit chain instead of silently becoming a qubit chain. Regression coverage exercises empty vectors, tuples and generators for levels 2, 3 and 4, including zero-size chains.

Validation: the regression reproduced 30 failures before the follow-up fix; all 188 assertions in lib/YaoBlocks/test/composite/chain.jl pass afterwards on Julia 1.12.4, including 108 new dimension and matrix checks. git diff --check passed. Remote CI for the revised head and independent critical review are recorded separately.

@codecov

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.22%. Comparing base (8f17bfb) to head (180c428).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #592   +/-   ##
=======================================
  Coverage   89.22%   89.22%           
=======================================
  Files          89       89           
  Lines        5855     5855           
=======================================
  Hits         5224     5224           
  Misses        631      631           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant