Repository navigation
feat(ep): report staleness per (factor, variable) and record reverted variables in ep_history.csv - #1576
Merged
Conversation
…riables in ep_history.csv (#1575) #1574 made a fully reverted projection count as skipped, so a factor that never moves is named by STALE FACTORS. A partial revert — one variable reverted on every projection while the factor's other variables update — was still invisible, which is the #1405 stale-scatter state on the hierarchical graph. update_factor_mean_field now computes the per-variable changed mask on both branches and carries it on Status.changed; EPOptimiser accumulates seen / changed variables per factor across sweeps (serial and parallel runs) and _stale_factor_warnings names every (factor, variable) pair that never changed. Pairs are keyed by factor name so a decomposed factor's per-dataset members count as one group. ep_history.csv gains a reverted_variables column so the workspace referee can read the signal. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gu4YysuvpQ4k6zkQjiwabd
Collaborator
Author
|
Workspace PR: PyAutoLabs/autofit_workspace_test#98 (merges after this one — library-first gate). |
This was referenced Sep 8, 2026
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.
Closes #1575. Follow-up to #1574 (umbrella #1405; graphical-ep epic, Codex phase-2 review finding 2, second half).
Problem
#1574 made a fully reverted projection count as skipped, so a factor that never moves is named by STALE FACTORS. A partial revert was still invisible: one variable reverted on every projection while the factor's other variables update. On the hierarchical graph that is the #1405 stale-scatter state — the scatter's reported posterior is the hyper-prior it started with while the factor counts as updated.
Change
Status.changed: the per-variable changed mask fromMeanField.check_changed, computed on both branches ofupdate_factor_mean_field(afterupdate_invalidon the invalid branch) and threaded through everyStatusreconstruction. Not part ofStatus.__iter__, so the existing 4-tuple unpack is unchanged.EPOptimiseraccumulates seen / changed variables per factor name across sweeps (serial and parallel runs), so a decomposed factor's per-dataset members count as one group;_stale_factor_warningsnames every (factor, variable) pair no member of the group ever moved, with theSTALE FACTORStoken so referee scripts keep matching.ep_history.csvgainsreverted_variables(;-joined names of the variables an update did not move; a fixed point lists every variable, so readers must test "on every row of a factor", not "on any row").API Changes
Status(changed=...)new optional keyword;ep_history.csvnew trailing column (existing readers by name unaffected;test_diagnostics.pycolumn lists updated).Tests
reverted_variablesrecorded inep_history.csv;Status.changedsurvivesfactor_step; group keying (one member moving the variable clears the group).test_autofit/graphical275 passed,test_autofit/messages95 passed, fulltest_autofit/2469 passed / 2 skipped.analytic_gaussian_collapse.py:RECOVER 5/5, BIASED-TIGHT 0/5, PATHOLOGICAL 0/5, STALE 0/5; inside [q05, q95] on 5/5 seeds—COLLAPSE CONFIG: PASS (5/5 seeds); no seed carries a per-variable line, because on every seed at least one member of the HierarchicalFactor group moved sigma (seed 0 has SUCCESS=1);ep_deterministic.pyPASS.🤖 Generated with Claude Code
https://claude.ai/code/session_01Gu4YysuvpQ4k6zkQjiwabd