Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Bugfix Update 2.0.1 #10

Merged
merged 48 commits into from
Apr 27, 2021
Merged

Bugfix Update 2.0.1 #10

merged 48 commits into from
Apr 27, 2021

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Apr 20, 2021

This PR addresses some of the bugs and obstacles that came up when integrating the new package version into our QFR library.

  • ⚑/🍎 all hash functions are refactored so that hashing is platform and standard library independent again (fixing slow performance on macOS)
  • ⚑ improve memory handling by reverting from using stack and forward_list to dedicated next pointers that are pre-allocated with the entries
  • ⚑ only clear compute tables if anything has been collected by the garbage collection
  • ⚑ adjust garbage collection limit depending on the number of remaining entries
  • ⚑ reduce initial garbage collection limits
  • ⚑ introduce additional 1/sqrt(2) static member in complex table
  • ⚑ always check 0, 1/sqrt(2), and 1 first upon accessing the respective buckets in the complex table
  • πŸ› add nullptr checks in reference counting methods
  • ♻️ moved generation of special DDs (e.g., SWAP) from QFR to DD Package
  • πŸ› fix bug in colorFromPhase when a negative phase was encountered
  • πŸ› fix misaligned access on ComplexTable::Entry
  • πŸ”₯ remove unused GC_INCREMENT
  • βœ… allow for some up and downs in code coverage
  • ⚑ complex table hash now rounds instead of truncates the calculated value
  • 🎨 number printing code moved from Complex to ComplexValue
  • 🐧 disable LTO in case clang is used under linux as some versions of the linker under Ubuntu do not work with Clang's ThinLTO

⬆️ benchmark

Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
⚑ reference instead of copy on getting nodes from any table

Signed-off-by: Lukas Burgholzer <[email protected]>
…d for by a `dd::Qubit` alone

Signed-off-by: Lukas Burgholzer <[email protected]>
✨ formatted matrix printing

Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
@codecov
Copy link

codecov bot commented Apr 20, 2021

Codecov Report

Merging #10 (a1b81f3) into master (6fc1e37) will increase coverage by 0.0%.
The diff coverage is 95.5%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #10   +/-   ##
======================================
  Coverage    96.1%   96.1%           
======================================
  Files          16      17    +1     
  Lines        2220    2262   +42     
======================================
+ Hits         2134    2175   +41     
- Misses         86      87    +1     
Impacted Files Coverage Ξ”
include/dd/Edge.hpp 100.0% <ΓΈ> (ΓΈ)
include/dd/Export.hpp 98.6% <50.0%> (-0.4%) ⬇️
include/dd/ComplexCache.hpp 97.8% <87.5%> (-2.2%) ⬇️
include/dd/UniqueTable.hpp 97.2% <90.9%> (-2.8%) ⬇️
include/dd/ComplexTable.hpp 96.0% <94.7%> (-0.1%) ⬇️
include/dd/Package.hpp 92.5% <95.6%> (+0.8%) ⬆️
include/dd/Complex.hpp 100.0% <100.0%> (+2.3%) ⬆️
include/dd/ComplexNumbers.hpp 100.0% <100.0%> (ΓΈ)
include/dd/ComplexValue.hpp 97.0% <100.0%> (-0.2%) ⬇️
include/dd/ComputeTable.hpp 90.4% <100.0%> (-5.2%) ⬇️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update 6fc1e37...a1b81f3. Read the comment docs.

Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
…n using (Apple)Clang under macOS

Signed-off-by: Lukas Burgholzer <[email protected]>
…d_list` to explicitly batch-allocated `next` members in the respective table entry classes

🎨 optimize header includes

Signed-off-by: Lukas Burgholzer <[email protected]>
⚑ if any unique/complex table needs to be garbage collected, collect all of them at once in order to minimize compute table invalidations
⚑ adjust garbage collection limit depending on the number of remaining entries
⚑ reduce initial garbage collection limits
πŸ”₯ remove unused GC_INCREMENT

Signed-off-by: Lukas Burgholzer <[email protected]>
βœ… small coverage increase

Signed-off-by: Lukas Burgholzer <[email protected]>
…endence. llvm stdlib used IEEE FP representation as hash for double, which turns out to be a bad idea. So is hashing floating points in general.

⚑ further tweak garbage collection
⚑ reduce default size of some compute tables in order to conserve space
🍎 revert to using Clang for CI

Signed-off-by: Lukas Burgholzer <[email protected]>
πŸ’‘ documentation for hash functions

Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
@burgholzer burgholzer changed the title [WIP] Bugfix Update 2.0.1 Bugfix Update 2.0.1 Apr 25, 2021
@burgholzer burgholzer marked this pull request as ready for review April 25, 2021 17:48
@burgholzer burgholzer requested a review from hillmich April 25, 2021 17:48
@burgholzer burgholzer added bug Something isn't working enhancement New feature or request labels Apr 25, 2021
⚑ complex table hash now rounds instead of truncates the calculated value
⚑ introduce additional 1/sqrt(2) static member in complex table
βš‘πŸ› always check 0, 1/sqrt(2), and 1 first upon accessing the respective buckets in the complex table

Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
πŸ‘Œ change garbage collection limit calculation to avoid overflow
πŸ‘Œ renaming `needsCollection` to `possiblyNeedsCollection`
⬆️ googletest
⬆️ benchmark
⚑ toffoli table and identity table need not be cleared when complex numbers have been collected as the just consist of edges with weight 1

Signed-off-by: Lukas Burgholzer <[email protected]>
@burgholzer burgholzer requested a review from hillmich April 27, 2021 08:22
@burgholzer burgholzer merged commit 3e339f9 into master Apr 27, 2021
@burgholzer burgholzer deleted the new_package_fixes branch April 27, 2021 08:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants