Skip to content

Flaky: test_refit_l0_selection_threads_l2_lambda_to_refit ESS comparison at 1e-5 margin #307

Description

@MaxGhenis

packages/populace-calibrate/tests/test_solve.py::test_refit_l0_selection_threads_l2_lambda_to_refit fails intermittently on a strict effective-sample-size comparison with a margin of ~1e-5:

E       assert 44.92098676684213 > 44.92099428536288

Observed 2026-07-04 on PR #306's wheels (3.13) and wheels (3.14) jobs (run 28716998027) — a branch that does not touch populace-calibrate — and both passed unchanged on rerun. Main's own run for "Thread L2 into the L0 refit stage" (28640352415, 2026-07-03) also failed, so the flake shipped with the test.

The assertion checks that threading L2 into the refit raises ESS, but the realized ESS difference at this fixture size sits at the noise floor of run-to-run nondeterminism (torch/BLAS reduction order), so the strict > flips sign intermittently.

Possible fixes, for whoever owns the L0 refit stage: seed/deterministic-mode the refit in this test, enlarge the fixture or the L2 lambda so the expected ESS gap clears the noise floor by orders of magnitude, or assert with an explicit margin (ess_l2 > ess_no_l2 + eps with eps chosen from measured run-to-run spread). A tolerance chosen to be just-big-enough would only hide the flake.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions