Repository navigation
Raise test coverage, fix two numerical bugs, and halve test-suite time - #66
Merged
Merged
Conversation
…rage tests Co-authored-by: Cursor <cursoragent@cursor.com>
…ed tensors, batched entropies Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…-pass tree splits in mu1_vertex, closed-form 3x3 vertex solves Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…g= to dit 2.4 Co-authored-by: Cursor <cursoragent@cursor.com>
…tion Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Raises test coverage, fixes two numerical bugs surfaced by failing tests, and roughly halves the wall-clock time of the default test suite by speeding up the hot numerical paths in
soficitself. Test budgets, tolerances and Hypothesis example counts are unchanged.Results
Full default suite (coverage on),
mainvs this branch, run back to back on an idle 10-worker machine:mainpython-sat/pymc)Bug fixes
renyi_entropy_ratenear α = 1:pressure(α) / (1 − α)cancels catastrophically within ~1e-8 of 1 (Hypothesis foundα = 0.9999999999999999). Inside a 1e-7 window the Shannon rate is returned, where truncation and rounding error balance.topological_entropy_from_matrix: strongly connected components joined by transient edges make the leading eigenvalue defective, soeigvalsresolved it only to ~eps ** (1/multiplicity)(up to ~1e-5 for three chained unit cycles). The spectral radius is now the largest over the strongly connected components, whose Perron roots are simple. This madetest_properties_shifts.py::test_adding_transient_states_changes_nothingfail onmain.Speedups
Each change is checked against the previous implementation, kept in
tests/oracles.py, by a property test. Times are the affected test alone, without coverage,main→ branch._LiftedProblem: two-operand matrix products instead of 4-operandeinsum, tensors cached between SLSQP's constraint and Jacobian calls, all three conditional mutual informations in one entropy passtest_odd_process_wyner_model_generatestest_generative_gap_rll_two_infinitynp.isclosesemantics and first-match order)test_survey_explosion_code_may_build_with_ladder_column_box_lp: Cramer's-rule solves for the 3×3 vertex systems instead of batched LAPACKdet+solvetest_hyperplane_cap_brackets_planted_rank_two_mass_tighten: exact outward rounding withmath.fsuminstead ofFraction(bit-identical, so certified caps are unchanged);mu1_vertex: every tree edge's split from one rooted traversal plus one maskedargminper tree (bit-identical)test_lifted_bound_separates_lifted_generators_from_gpytest now uses
--dist=worksteal(requirespytest-xdist>=3.2).Not changed: the line-split / coupled-generator searches are dominated by ~90k small HiGHS solves (~0.85 ms each); building the LP matrices is ~4% of each call and sparse input is slower.
Coverage
dfasat,pymc_backend,trapdoor_code,channel_coding) and filled their remaining paths; tests stayimportorskip-guarded.bayesian/markov,transducers, language operations and residuals,stationary,pfa,papni, CSSR counts,properties,examples/processes, viz edge specs and I-diagram legend layout,idfa, modular VPA minimization, and the bidirectional-construction and generative-search helpers.CI
test-without-symbolichas been failing onmain: four test modules importsympyat module level and one sympy test had no guard. Those tests now skip individually withpytest.importorskip("sympy"); with sympy blocked, the suite gives 2794 passed, 50 skipped.Dependencies
dit>=2.4(lockfile updated), so the channel-coding and trapdoor tests run in CI instead of skipping. Calls into dit now passrng=instead of the deprecatedprng=._strategyinfunctional_markov_chain, whichfunctional_generative_model(strategy=...)passes through. Removing or deprecating that public argument is left for a follow-up.