Skip to content

Synchronize feature branch - #238

Merged
jared321 merged 100 commits into
CorrPlotModifyfrom
main
Jul 16, 2026
Merged

Synchronize feature branch#238
jared321 merged 100 commits into
CorrPlotModifyfrom
main

Conversation

@jared321

Copy link
Copy Markdown
Contributor

main updated since this branch was based off of it.

jared321 and others added 30 commits May 22, 2026 09:05
This most important change was the removal of the classifier that specified the
license, which was causing tools to emit a license deprecation warning.
Reran script to confirm all tests still passing with no visualizations to close.
Progress!
Based on lessons learned from this bug, we now explicitly use loc/scale argument
names.  With this, the test suite runs through successfully.  The visualizations
and test output for the new tests now look good.  At least they are similar to
results for the MH/Normal step tests.
Not only does this test allow us to stress test the uniform step distribution in
MH is more than 1D, but it also allows us to confirm that our test tool does
work on 4D problems (albeit with boring target distributions).  My tests all
passed and the visualizations/logging for the new test look good.
All tests now running regression tests and passing.
Fix MH/uniform step distribution bug
Confirm that my test suite runs through successfully with no visualizations.
Most importantly, this moves the current if/else block outside the loop.  We are
also sampling the full vector in a single rvs call and computing the proposed
step in vectorized fashion.  An additional benefit of this is that we create the
proposal distribution once as a frozen distribution and draw from that at each
loop iteration, which reflects the static nature of the proposal distribution in
the algorithm.

Prior to these changes, the test suite ran in 167 seconds.  With this change,
the test suite runs through successfully with bitwise identical results (as
expected) and in 131 seconds.  Not a massive speedup, but I'll take it!
Previous changes to the computation/use of p_accept were leading to overflow
warnings being posted by the official package test suite.  They were not,
however, showing up with the test script's suite.  This commit expands out the
handling of how to choose the next theta point by precluding the possibility of
overflow and explaining how underflow can happen and how the algorithm deals
with it.  See comments in code for more benefits.

Official unit test suite and unofficial test script suite passing with no
warnings.  Since the new implementation is no longer drawing from Bernoulli with
p_accept=1, the results are different from previous benchmarks.  After updating
benchmarks to the new results, a rerun of the test script ran through
successfully.

Curiously, despite expanding the if/elif/else block within the MCMC loop,
performance appears to have improved slightly.
This is necessary to verify that all new results are sufficiently good for
converting into the next set of benchmarks.
Explicitly manage over/underflows in MH
Prefer initializing arrays to NaN so that any bugs in the code that result in
insufficient setting of all elements in the array will hopefully result in
someone finding NaNs.

The first few tests ran through with identical results, as expected.  However,
one test did fail with the new error since it was intentionally designed with a
start distribution that is disjoint from the support of the target distribution.
The test suite will be fixed in a subsequent commit so that reviewers can
check out this commit to confirm correct detection and reporting of failure.
Any draw from the start distribution should now yield a positive density.  Note
that after fixing this, the test still failed since the new results were started
from a new starting point.  After saving the new result as the new benchmark, a
rerun of the full test suite finished successfully.
First evaluation must yield positive density
This new version is causing issues, so I temporarily disallow it so that we can
proceed with unrelated development activities.

Running `tox -r -e nocoverage` before and after making this change revealed that
I could locally reproduce the related issues and avoid them with this change.
We again have a full set of benchmarks that should be sufficient for upcoming
refactoring work.
I set the burn-in rate to 100,000 for the Uniform4D test to see a clear
manifestation of the logging errors.  After making this change, that test runs
through with reasonable logging results.  The test is successful because the
logging bug did not affect the execution of the sampling nor the computation of
the final acceptance rate.
Now the configuration is not tied just to MH.  This percolated throughout the
test script code so that we open the door to testing LMC and PTLMC.

Test script ran through with no issues and the unit tests run through cleanly as
well.
The results do not look good and I don't see any parameters for me to adjust.
This fits with the fact that LMC is currently listed as research grade.  This
second set of tests fail because the sampler cannot yet be made deterministic.
That will be done on a later branch.
Homogenize the argument list of PTLMC with that of other samplers.  My test
execution fails due to an array sizing issues I suspect.  Moses should first
update this test setup to see if it's any good and then check the error.
update feature branch from main
mosesyhc and others added 26 commits July 13, 2026 15:32
(1) Ensure that no surmise RNG is used except within test functions
(2) Reduce redundancy in calling shared variables from shared_scenario.py
(3) Allow for fixtures to be called by test to ensure "no_rng" (RNG cleared), "seeded_RNG" (surmise RNG set properly)
As expected, the new results were not identical to the benchmark.  However, the
new results look reasonable.
Random draws not using the global RNG.  Internal tests probably shouldn't
override the underlying failure message, but rather only print more information
to help understand the context of the failure.

This should hopefully get actions passing again.
Last time this action ran it needed less than 5 minutes, so 10 should be a nice
conservative value that won't waste too much runner time on texlive failures.
@jared321 jared321 self-assigned this Jul 16, 2026
Don't let failed texlive installations run forever
@jared321
jared321 merged commit 3c2dda4 into CorrPlotModify Jul 16, 2026
61 checks passed
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