• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DrudgeCAS / gristmill / 31896575864
91%
master: 92%

Build:
Build:
LAST BUILD BRANCH: ci/release-0.9.0
DEFAULT BRANCH: master
Ran 15 Aug 2026 04:52PM UTC
Jobs 1
Files 4
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Aug 2026 04:49PM UTC coverage: 91.249%. Remained the same
31896575864

push

github

chenpeizhi
fix: Stop unordered iteration deciding the optimization result

Two containers with unspecified iteration order were feeding the result.

`_optimize_prod` built its dimension-to-factor map by looping over
`factor.atoms(Symbol)`, a set.  That order set the insertion order of
`factors_with`, then of `involv_dims`, then the order the dimension chunks
were built in and the order of dimensions within each chunk, and finally
the index order of the intermediates.  `dim_chunks.sort()` does not repair
it, since `Tuple4Cmp` compares on its first element alone.  Fingerprinting
the CCSD energy evaluation over eight `PYTHONHASHSEED` values gave eight
different answers.

The memoir from libparenth arrives as a dictionary built from a C++
`std::unordered_map`, whose iteration order is implementation defined.
libstdc++ and libc++ disagree, so `for k, v in res.items()` visited the
subproblems in a different order on Linux and on macOS.

The second one was not cosmetic.  The order the intermediates are formed
in decides which get matched against each other, and macOS was landing on
a worse answer than Linux for the same input.  On Linux the effective T of
the CCSD energy equation was found and both matrix factorizations worked;
on macOS none of the three did.  Everything previously recorded about
these being broken was measured on macOS.

Loop over the dimensions in their own order, which is deterministic and
also the natural one, and sort the memoir before walking it.  Eight hash
seeds now give one answer.

With that, the `> 0` assertion in `test_ccsd_energy` holds again, and both
xfails in the matrix tests pass, so all three markers come off.

Note the descending sort is a choice, not a formality: ascending loses the
effective T.  That the answer depends on the order at all is a weakness of
the greedy constriction, and is left as it is.

Also import `Symbol` in the matrix tests.  It is used by
`test_factorization_needing_canonicalization`, which had been dying on a
`... (continued)

1 of 1 new or added line in 1 file covered. (100.0%)

1783 of 1954 relevant lines covered (91.25%)

0.91 hits per line

Jobs
ID Job ID Ran Files Coverage
1 31896575864.1 15 Aug 2026 04:52PM UTC 4
91.25
GitHub Action Run
Source Files on build 31896575864
  • Tree
  • List 4
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 03db803d on github
  • Prev Build on master (#31896274029)
  • Next Build on fix/deterministic-optimization (#31896635431)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc