Skip to content

Various Enhancements for CBC Vector Search - #616

Open
sou-cheng-choi wants to merge 15 commits into
lattice_kroneckerfrom
lattice_kronecker_choi
Open

Various Enhancements for CBC Vector Search#616
sou-cheng-choi wants to merge 15 commits into
lattice_kroneckerfrom
lattice_kronecker_choi

Conversation

@sou-cheng-choi

@sou-cheng-choi sou-cheng-choi commented Sep 3, 2026

Copy link
Copy Markdown
Member

Main improvements in decreasing order of impact:

  1. Deterministic Lattice Vector Search: Replaced np.argmin on WSSD scores with a best_index() helper, which finds the lowest index among scores within rtol=1e-13 of the minimum, ensuring consistency across platforms (ARM vs x86).
  2. Memory Optimization for Discrepancy Calculation: The expected_squared_periodic_discrepancies function now uses O(n) memory. The dense frequency matrix (log₂ n_max, n_max) was replaced by a row-sum collapse. Memory usage drops significantly from ~12.5 GiB to ~1 GiB at n_max = 2²⁵, while maintaining algebraic exactness.
  3. Kronecker Search Edge Case Fixes: Fixed a crash when running kronecker_vector_search_mobius_transform with d_max=1.
  4. Lattice WSSD Kernel Parameterization: The Lattice.wssd method gains a kernel= parameter that allows custom kernels to be accessed through the public method, forwarding them to expected_squared_periodic_discrepancies.
  5. Improved Input Validation and Error Handling: Added a length check for sample_weights (< n_max vs != n_max) in lattice.py, which changes the failure mode from a cryptic np.dot shape error to a clear ValueError. The Missing-sympy hint print() is now handled via a filterable UserWarning, reducing noise.
  6. Code Refactoring and Cleanup: Replaced k_const list-comprehension with np.arange for efficiency. Also removed the unreferenced file kron_vector_d-100_N-2exp20_26_06_01.txt and its associated packaging line.
  7. Documentation: Added the notebook to mkdocs.yml.
  8. MPMC stack: Installed in CI tests successfully on every OS with or without pyg_lib.
  9. Merged in develop branch.

sou-cheng-choi and others added 4 commits September 3, 2026 10:23
* Min Python version

* Pass Python version to environment

* Pre-release tests

* Get more info

* Security Fix

* requires-python = ">= 3.9" in pyproject.toml

* Python 3.9 Compatibility

* Fix versions

* Fix windows test failures

* Installs the missing l3backend MiKTeX package
* Update demo notebook initialization cells

* Notebooks have been moved

* Add Colab dependency install cells

* Fix Colab notebook install cells

* Fix spelling in Colab notebooks

* Remove unused os import from Colab cells

* Use capture for Colab install output

* Automating Colab/notebook consistency

* Update

* Update makefile

* Add make target for Colab bootstrap classification

* Debugged `harden_colab_notebook.py` and add unit tests for badge handling

* Add branch notebook execution script

* Skip Colab bootstrap during branch notebook execution

* Download Dakota Genz points in notebook

* Remove Dakota Genz generation fallback

* Use gdown for Dakota Genz data download

* Add local notebook execution script

* Comment out gdown in Dakota notebook

* Fix Windows notebook CI LaTeX setup

* Address Colab readiness review feedback

* Reconcile Colab tooling with develop

* Refresh safe Colab bootstrap cells

* Preserve notebook serialization during hardening

* Better Colab notebook handling:  more dependencies support and improved smoke tests

* Fix CodeQL check errors

* Add title to notebook and update kernel name and version

* Fix errors after manually testing in Google Colab

* Fix problems after manually running in Google Colab

* Minor enhancements

* Fix colab error

* Fix typo

* Simplify Colab smoke tests: drop dead PR scoping, fix diagnostics

* Add harden_colab_notebook to format target

* Add tools to open in Colab (for developers)

* Attempt to fix Colab errors

* Correct Colab notebook manifest and build process

* Fix unit test failure

---------

Co-authored-by: sou-cheng-choi <sou.cheng.choi@stanfordalumni.org>
@sou-cheng-choi sou-cheng-choi self-assigned this Sep 3, 2026
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