Retire prob_state: flex PCA initializes every particle multi-state split¶
Date: 2026-10-06. Status: completed 2026-10-07 (Phases 0, 1 and 2 done; report beside this plan).
Why¶
refine=prob_state keeps each particle's previous projection direction and
in-plane angle, scores that pose against the reference of every state (with
shift refinement), and draws the state label by a balanced assignment over
states. It does not work (maintainer, 2026-10-06). It is today the only engine
of four places that turn a single-state refinement into a multi-state one:
- the split stage of docked
solve3Don particles (stage 6 by default); - the split stage of docked
solve3D_cavgs; - the initialization phase of
refine3D_statesfor state-0/1 input withflex=no; refine3D_states pose_policy=fixed(multivol_mode=input_oris_fixed), whose whole refinement and missing-update pass areprob_state.
Projection-aware flex PCA (flex_pca, the current default initializer of
refine3D_states) becomes the only way to split particles into states.
Class averages carry much more signal per image and keep a random balanced
partition.
Rulings (2026-10-06)¶
- Particle workflows initialize states with
flex_pca: the dockedsolve3Dsplit and state-0/1 input torefine3D_states. refine3D_states pose_policy=fixedis retired, together withmultivol_mode=input_oris_fixed. Fixed-pose classification isflex_pcaitself.refine3D_states flex=no(stochastic initializer plus theprob_stateinitialization phase) is retired; theflexkey goes with it (release 4 keeps no compatibility keys).- Docked
solve3D_cavgssplits the class averages intonstatesrandom balanced partitions (equal populations), reconstructs the state volumes, and runs its split stage with the ordinary post-split search mode. The maintainer's note was cut off after "There is much more signal so n"; read as "no flex orprob_stateis needed for class averages". - Flex-initialized runs require
nstates >= 3(dockedsolve3Don particles, state-0/1 input torefine3D_states);nstatesis a ceiling, because flex merges indistinct states. - Executed as an arun run on the Dell; the working tree is committed before launch.
- Flex inside
solve3Druns at the crop and low-pass of the pre-split stage (stage 5 by default) and on the cohort only. - When flex returns fewer states than requested, the run continues with the flex count, records it in the manifest, and stops with an error below 2.
- The class-average split gives every state partition the same number of class averages (within one).
- No large-dataset validation in this run; the maintainer tests on big datasets afterwards.
Ruling of 2026-10-06 during the run: solve3D keeps only the independent multi-state mode¶
Taken after the Phase 0 baseline showed that docked particle solve3D never
runs prob_state: at its split stage it gives a cohort of particles random
balanced state labels, reconstructs the state volumes, and hands the rest of
the run to refine3D_states (see Progress, Phase 0). This ruling replaces
rulings 1, 4, 7 and 8 above and the sections "Docked solve3D on particles"
and "Docked solve3D_cavgs" below; where they differ, it wins.
solve3Dandsolve3D_cavgslose themultivol_modekey.nstates=1is the single-state run;nstates>1is today's independent mode (every state refined from its own start), with its current defaults. Docked mode (one consensus model up to a split stage, then states) is removed with all of its code: the split checkpoint (src/main/solve/simple_solve3D_split_checkpoint.f90), the cohort pass, the handoff torefine3D_states, the docked stage rules in the solve3D controller (split stage, widened pre-split sample,PROB_NEIGH_MODE_DOCKED), thesplit_stageparameter, the docked fields of the solve3D manifest, and the docked-checkpoint input ofrefine3D_states.sticky_class_samplingand thesampled_onlypath ofsample4update_classlose their only producer and go too. Only docked multi-state code goes: "dock" and "docked" elsewhere (volume docking,solve3D_addondocking,dock_vols) are unrelated and stay.- Flex PCA is therefore not used inside
solve3D. It stays the initializer ofrefine3D_statesfor input without state labels (all particles in state 0 or 1).prob_state,pose_policy=fixedandflex=noare still retired as planned;nstates>=3applies to flex-initializedrefine3D_states. No balanced class-average partition is needed. multivol_modestays as an internal parameter only whererefine3D_statesandclassify3D_refsset it. Onceinput_oris_fixedis gone, Progress records whether the parameter has become removable; it is not removed in this run.- Validation is reduced to what the change can break; no new baselines are
run. The Phase 0 docked cases (A1, A2, C) stay in Progress as context only.
Phase 2 runs, on the new build with the Phase 0 execution settings and
inputs: the single-state
solve3D nsample=2500 cavg_ini_ext=yesfrom S once (it exercises theprob,prob_neighandbalance=cavgpaths the removals touch; final FSC 0.143 within 3 % of the Phase 0 value, 3.84 Å); B (refine3D_states) as in Phase 0 once (best-state FSC 0.143 within 3 % of its Phase 0 value);solve3D nsample=2500 cavg_ini_ext=yes nstates=3from S andsolve3D_cavgs nstates=3, once each, which must complete with every state populated (smoke tests of the now implicit independent mode, no resolution criterion). Plus the fast test gate, the unit suites of the touched areas andscripts/check_test_registry.py, as in Phase 1's exit. - File-table rows are added before editing files the removal touches beyond
the table (for example
src/main/ui/simple/simple_ui_solve3D.f90,src/main/strategies/search/simple_matcher_smpl_and_lplims.f90,src/main/ori/simple_oris_sampling.f90,src/main/sigma2/simple_sigma2_bootstrap.f90,doc/policies/3D/solve3D_addon_policy.md). Documents: the "Multi-state modes" section ofdoc/algorithms/solve3d.mdkeeps single and independent only; the docked sections ofdoc/policies/3D/solve3D_policy.md,doc/policies/3D/solve3D_cavgs_policy.mdanddoc/policies/importance_sampling_fractional_update_policy.mdgo.
What changes¶
refine3D_states¶
- State-0/1 input always runs
flex_pca(the present default path). Inputs with project multi-state labels and docked checkpoints are unchanged. pose_policybecomeslocal|global(defaultglobal);fixedis rejected as an unknown value.input_oris_fixeddisappears from the code.- The
prob_stateinitialization phase (l_init_state_assignment,init_sweep_iters, the init frequency march and stage) is removed: every run starts at theprob_neighfrequency march. - The stochastic state-volume startup for state-0/1 input in
initialize_state_volumesis removed; the branch that uses or reconstructs project state volumes for labelled input stays. - The final missing-update pass uses
refine=greedyonly (the present non-fixed path).
Docked solve3D on particles¶
Replaced by the ruling of 2026-10-06 during the run: docked mode is removed,
so this section no longer applies. Its description of today's code is also
incomplete: after the steps below, the split stage does not run prob_state
but hands off to refine3D_states (flex=no, pose_policy=local), which
skips its prob_state initialization phase because the particles already
carry state labels.
Today, at the split (build_solve3D_split_checkpoint): a cohort-forming
refine=prob pass, then random balanced labels (randomize_states), then a
post-split-sized subset restricted to the cohort reconstructs the state
volumes, and the split stage runs prob_state.
New: the random labels are replaced by flex_pca on the cohort with the
pre-split consensus map, at the crop and low-pass of the pre-split stage
(ruling 7). Flex sets the state labels of the cohort and seeds the state
volumes. If flex returns fewer states than requested, the run continues with
the flex count, writes it to the manifest and to the stage command lines, and
stops with an error below 2 (ruling 8). The split stage runs the ordinary
post-split mode (prob_neigh, prob_neigh_mode=geom). The cohort, the
sticky class sampling after the split, trailing from TRAILREC_STAGE_SINGLE,
and the terminal missing-update pass (refine=greedy) stay as they are.
nstates < 3 is rejected for docked particle runs before stage 1.
Docked solve3D_cavgs¶
Replaced by the ruling of 2026-10-06 during the run: docked mode is removed
and nstates>1 runs the independent mode, so no balanced partition is needed.
randomize_states gives every state the same number of class averages
(within one) by a random balanced partition (ruling 9); the split stage emits
the post-split mode instead of prob_state. nstates >= 2 stays allowed.
prob_state removal¶
solve/simple_solve3D_controller.f90: thedocked_split_stagebranch that emitsprob_state.strategies/parallelization/simple_refine3D_strategy.f90:l_prob_state_modeand its branches.strategies/search/simple_strategy3D_matcher.f90,simple_strategy3D_alloc.f90: theprob_statecases.strategies/search/probabilistic/simple_strategy3D_prob.f90: the fixed projection (l_fixed_projection).commanders/simple/simple_commanders_prob.f90: thel_state_onlybranches.strategies/search/probabilistic/simple_eul_prob_tab.f90:fill_tab_state_only,fill_tab_state_only_range,state_assign, and the state-only table storage if nothing else uses it;simple_eul_prob_tab_neigh.f90: theprob_statereference.params/:refineandpose_policychoices;ui/simple/simple_ui_refine3D.f90,ui/single/single_ui_nano3D.f90,ui/simple/simple_ui_heterogeneity.f90:prob_state,fixed, andflexremoved from the choices and help.
Phases¶
The run uses an out-of-tree Release build for workflow runs and the existing
test executables for unit tests. Data: the beta-galactosidase project after
2D clustering, /data2/bgal_addon/control/bgal_addon.simple (5,513
particles, mskdiam=180 pgrp=d2), a fresh copy per run. Every solve3D run
uses nsample=2500 and starts from one common solve3D_cavgs result with
cavg_ini_ext=yes. Beta-galactosidase is homogeneous, so these runs test that
the workflows complete and stay sane, not that they find real states.
Phase 0: baseline (no source change)¶
- S:
solve3D_cavgsonce; keep its project underscratch/keep/as the common start. - A:
solve3D multivol_mode=docked nstates=3 nsample=2500 cavg_ini_ext=yesfrom S, twice. - B:
refine3D_states nstates=3 nsample=1500 lpstart=12 lpstop=6 pgrp=d2 mskdiam=180(flex default,pose_policy=global) on the final project of a single-statesolve3Dfrom S, once. - C:
solve3D_cavgs multivol_mode=docked nstates=3once.
Record command lines, per-state populations, per-state FSC 0.143 resolutions, and wall times in Progress.
Phase 1: implementation, tests, documents¶
Implement "What changes". Tests: the balanced partition gives every state the
same number of class averages within one; a docked particle run with
nstates=2 stops with the documented message; existing unit suites of the
touched areas pass. rg gates: no prob_state,
input_oris_fixed, fill_tab_state_only, or state_assign in src/; no
flex=no path; pose_policy choices are local|global.
Update doc/policies/heterogeneity/refine3D_states_policy.md,
doc/policies/3D/solve3D_policy.md, doc/policies/3D/solve3D_cavgs_policy.md,
doc/policies/importance_sampling_fractional_update_policy.md, the
algorithms chapters refine3d.md, solve3d.md,
sampling_and_fractional_updates.md, heterogeneity_analysis/README.md,
heterogeneity_analysis/refine3d_states.md, the UI help, and the skills
simple-refine3d and simple-solve3d-importance-sampling with their
references.
Exit: Release and Debug builds without new warnings; the fast test gate and
the unit suites of the touched areas pass; scripts/check_test_registry.py
passes; the rg gates hold.
Phase 2: comparison runs and report¶
Replaced by item 4 of the ruling of 2026-10-06 during the run. Phase 2 runs,
with the command lines recorded in Progress (Phase 0) and the same
scratch/keep/ inputs: the single-state solve3D from S (final FSC 0.143 at
most 3.96 Å, i.e. within 3 % of 3.84 Å); B (best-state FSC 0.143 at most
4.15 Å, within 3 % of 4.03 Å); solve3D_cavgs nstates=3 and
solve3D nstates=3 (started from the solve3D_cavgs nstates=3 result, see
the open point in Progress, Phase 0) as smoke tests (complete, every state populated);
the fast test gate, the unit suites of the touched areas and
scripts/check_test_registry.py. Then the plan moves to
doc/refactoring_notes/completed/ with a self-contained report beside it.
The original text follows for reference.
Repeat A, B, and C on the new build (A twice). Acceptance: every run
completes; no state falls below the split population floor; in A, the flex
split reports its state count and the run continues with it; the best-state
FSC 0.143 resolution of A and B is no worse than the Phase 0 value by more
than the larger of the Phase 0 spread and 3 %; C completes with every state
populated. Then move this plan to doc/refactoring_notes/completed/ and
write a self-contained report beside it.
File table¶
| File | Change | Phases |
|---|---|---|
doc/refactoring_notes/completed/prob_state_retirement_flex_split.md |
plan and progress | each |
doc/refactoring_notes/completed/prob_state_retirement_flex_split.md |
plan moved, report beside it | 2 |
src/main/commanders/simple/simple_commanders_refine3D.f90 |
refine3D_states: flex only, no fixed policy, no init phase |
1 |
src/main/commanders/simple/simple_commanders_solve3D.f90, src/main/solve/simple_solve3D_split_checkpoint.f90, src/main/solve/simple_solve3D_utils.f90, src/main/solve/simple_solve3D_controller.f90, src/main/solve/simple_solve3D_manifest.f90 |
flex split, cavgs balanced split, nstates floor |
1 |
src/main/commanders/simple/simple_commanders_flex_pca.f90, src/main/flex/run/*.f90 |
only if running flex at the pre-split crop on the cohort needs an entry point or option | 1 |
src/main/commanders/simple/simple_commanders_prob.f90 |
l_state_only removed |
1 |
src/main/strategies/parallelization/simple_refine3D_strategy.f90 |
l_prob_state_mode removed |
1 |
src/main/strategies/search/simple_strategy3D_matcher.f90, simple_strategy3D_alloc.f90, simple_strategy3D_srch.f90 |
prob_state cases removed |
1 |
src/main/strategies/search/probabilistic/simple_eul_prob_tab.f90, simple_eul_prob_tab_neigh.f90, simple_strategy3D_prob.f90 |
state-only table and assignment removed | 1 |
src/main/params/simple_parameters.f90, simple_parameters_parse.f90, simple_parameters_phases.f90 |
choices, flex key |
1 |
src/main/ui/simple/simple_ui_refine3D.f90, simple_ui_heterogeneity.f90, src/main/ui/single/single_ui_nano3D.f90 |
UI metadata | 1 |
unit testers of the touched modules, src/main/ui/simple_test/*.f90 |
tests and registration | 1 |
doc/policies/heterogeneity/refine3D_states_policy.md, doc/policies/3D/solve3D_policy.md, doc/policies/3D/solve3D_cavgs_policy.md, doc/policies/importance_sampling_fractional_update_policy.md |
policies | 1 2 |
doc/algorithms/refine3d.md, solve3d.md, sampling_and_fractional_updates.md, doc/algorithms/heterogeneity_analysis/README.md, refine3d_states.md |
algorithms docs | 1 |
.github/skills/simple-refine3d/, .github/skills/simple-solve3d-importance-sampling/ |
skills and references | 1 |
src/main/ui/simple/simple_ui_solve3D.f90 |
solve3D and solve3D_cavgs lose the multivol_mode and split_stage inputs; help text says "nstates>1" instead of "independent" (ruling of 2026-10-06) |
1 |
src/main/strategies/search/simple_matcher_smpl_and_lplims.f90 |
the matcher stops passing the docked sticky-cohort flag to the sampler | 1 |
src/main/ori/simple_oris_sampling.f90, src/main/ori/simple_oris.f90, src/main/ori/simple_oris_tester.f90 |
sample4update_class loses its sampled_only (sticky cohort) argument, its only producer being docked mode; its unit test goes with it |
1 |
src/main/sigma2/simple_sigma2_bootstrap.f90 |
stops deleting the removed sticky_class_sampling key from its child command line |
1 |
src/main/solve/simple_solve3D_manifest_tester.f90 |
manifest unit test follows the removed docked fields | 1 |
src/main/flex/run/simple_flex_pca_state_service.f90, src/main/flex/run/simple_flex_pca_application.f90 |
comments that name the retired flex=yes key |
1 |
scripts/memory/benchmark_solve3d.py |
the solve3D memory benchmark stops passing multivol_mode on the solve3D command line |
1 |
doc/policies/3D/solve3D_addon_policy.md, doc/how2s/how2_process_heterogeneous_datasets.md, doc/policies/NU/nonuniform_filtering_policy.md |
living documents that mention docked mode, multivol_mode on solve3D, prob_state, pose_policy=fixed or flex=no |
1 |
Progress¶
Phase 0: baseline (2026-10-06, done)¶
No source file changed; this plan is the only file edited (the ruling of
2026-10-06 recorded above, the replaced sections marked, this entry). All
numbers come from an out-of-tree Release build with BUILD_TESTS=ON of the
unchanged base (commit 6914834d3, clean tree), built with GCC 15.2
(gcc-toolset-15), CMake 3.26.5 and USE_ARCHOPT=ON, the same configuration
as the maintainer's ~/src/SIMPLE/build. The build has no compiler
warnings and five linker warnings "requires executable stack"
(json_value_module.f90.o three times, simple_commanders_cavgs.f90.o,
simple_stream_stage_pool2D.f90.o); that is the warning baseline for
Phase 1.
Evidence is under /home/elmlundho/agent_runs/prob_state_flex/scratch:
build_release.sh, run_case.sh (the exact command lines), queue_phase0.sh
(the order), and in logs/ per run case_<name>.log (full output, each line
prefixed by its time in seconds, /usr/bin/time -v at the end),
summary_<name>.txt (populations, final resolutions, wall time, memory) and
table_<name>.md (per-iteration table). The runs ran one at a time on the
otherwise idle 24-core machine.
Inputs. Each run starts from a fresh copy of
/data2/bgal_addon/control/bgal_addon.simple: beta-galactosidase after 2D
classification, 5,513 particles, box 256 at 1.275 Å per pixel, 50 selected
class averages. Run S (solve3D_cavgs, single state) is the common start of
every solve3D run; its run directory is kept as scratch/keep/S/1_solve3D_cavgs.
The single-state solve3D from S is kept as scratch/keep/single/1_solve3D;
it is the input of case B. A project's output segment refers to its maps by
absolute path inside the directory that wrote them, so run_case.sh recreates
scratch/runs/S/1_solve3D_cavgs (and, for B, scratch/runs/single/1_solve3D)
from scratch/keep/ before each run that reads a kept project; a run depends
only on scratch/keep/.
Command lines. Every run sets SIMPLE_PATH to the Release build and puts
its bin first on PATH; the project file is the copy named bgal.simple
in the run directory scratch/runs/<name>. Phase 2 repeats these exactly.
| Run | Starts from | Command line |
|---|---|---|
| S | fresh copy of the input project | simple_exec prg=solve3D_cavgs projfile=bgal.simple mskdiam=180 pgrp=d2 nparts=4 nthr=6 |
| single | keep/S/1_solve3D_cavgs/bgal.simple |
simple_exec prg=solve3D projfile=bgal.simple mskdiam=180 pgrp=d2 nsample=2500 cavg_ini_ext=yes nparts=4 nthr=6 |
| A1, A2 | keep/S/1_solve3D_cavgs/bgal.simple |
simple_exec prg=solve3D projfile=bgal.simple mskdiam=180 pgrp=d2 nsample=2500 cavg_ini_ext=yes nparts=4 nthr=6 multivol_mode=docked nstates=3 |
| B | keep/single/1_solve3D/bgal.simple |
simple_exec prg=refine3D_states projfile=bgal.simple nstates=3 nsample=1500 lpstart=12 lpstop=6 pgrp=d2 mskdiam=180 nparts=4 nthr=6 |
| C | fresh copy of the input project | simple_exec prg=solve3D_cavgs projfile=bgal.simple mskdiam=180 pgrp=d2 nparts=4 nthr=6 multivol_mode=docked nstates=3 |
Results. Population is the number of particles with that state label in
the final project (state 0 means excluded). Resolutions are the Fourier shell
correlation (FSC) thresholds 0.5 and 0.143 of the final reconstruction of
each state, from its RESOLUTION_FINAL_STATE<nn> file; for S and C the half
sets are the even and odd class averages, not particles. Every run exited
with status 0.
| Run | Wall time | Peak memory | State: population, FSC 0.5 / 0.143 (Å) |
|---|---|---|---|
| S | 10:56 | 3.0 GB | 1: 5,513 particles (50 class averages), 7.77 / 6.80 |
| single | 14:38 | 3.2 GB | 1: 5,513, 4.35 / 3.84 |
| A1 | 55:56 | 5.4 GB | 1: 1,330, 7.25 / 4.35; 2: 1,146, 10.20 / 7.77; 3: 3,037, 4.47 / 3.80 |
| A2 | 56:01 | 5.4 GB | 1: 868, 9.07 / 6.40; 2: 3,777, 4.41 / 3.80; 3: 868, 10.20 / 7.59 |
| B | 18:55 | 4.8 GB | 1: 3,460, 5.02 / 4.03; 2: 726, 14.19 / 12.09; 0: 1,327 |
| C | 11:18 | 5.3 GB | 1: 1,316 (9 class averages), 8.82 / 5.26; 2: 2,688 (19), 8.82 / 6.94; 3: 1,509 (22), 20.40 / 9.07 |
What the runs did, read from their logs:
- single: entered at stage 4 (the stage after the symmetry search, because
cavg_ini_ext=yestakes the orientations of S), stages 4 to 8 at low-pass limits 9.1, 7.4, 7.3, 5.5 and 4.5 Å. - A1 and A2 (docked
solve3D, context only under the ruling): stage 5, the pre-split stage, ranrefine=probat a cropped box of 130 pixels and 7.6 / 7.4 Å. At stage 6 the split checkpoint formed a cohort with onerefine=probpass (4,962 of 5,513 particles), gave it random balanced labels, reconstructed three state volumes from the cohort, and handed the remaining 49 iterations torefine3D_states(pose_policy=local,flex=no), which skipped itsprob_stateinitialization phase because the particles already had labels and ran 17 frequency blocks ofrefine=prob_neighfrom 8.4 to 4.5 Å, then the final missing-update pass on the 549 particles never sampled.prob_statenever ran. This is the observation that led to the ruling of 2026-10-06 during the run. - B (
refine3D_stateson the single-state project): flex PCA initialized the states; it delivered 3, then its occupancy floor (at least 2,000 effective particles per state) dropped one state of 1,327 particles to state 0, so the run continued with 2 states (REFINE3D_STATES FLEX_PCA INITIALIZED NSTATES: 2). No initialization phase; 11 frequency blocks from 12 to 6 Å, 32 iterations at an update fraction of 0.27 (1,500 of 5,513 particles per iteration). - C (docked
solve3D_cavgs, context only): stages 1 to 5 single-state, then at stage 6 random labels and three iterations ofrefine=prob_state, then 12 iterations ofrefine=prob_neigh. It is the only Phase 0 run that ranprob_state.
Phase 2 limits (item 4 of the ruling): the single-state solve3D final
FSC 0.143 at most 3.96 Å (3.84 Å plus 3 %); B's best-state FSC 0.143 at most
4.15 Å (4.03 Å plus 3 %). For the record, the A pair's best states both
reached 3.80 Å.
Open point for Phase 2. The ruling's smoke test solve3D nsample=2500
cavg_ini_ext=yes nstates=3 from S cannot run as written: S carries one
state, and solve3D with cavg_ini_ext=yes and nstates>1 requires the
project's particles to carry exactly nstates populated states. On the base
build it stops at once with "cavg_ini_ext=yes with nstates>1 requires
matching existing ptcl3D state assignments" (logs/case_probe_indep.log).
Phase 1 does not change that check (it is not docked code), so Phase 2 starts
this smoke test from the final project of the solve3D_cavgs nstates=3 smoke
test, whose particles carry three populated states, with the rest of the
command line unchanged. That keeps the test on the independent mode with
class-average initialization, as the ruling intends.
Phase 1: implementation (2026-10-06)¶
Inventory of the base code, taken before editing¶
The base code was read in full for every name the run retires. The
design that applies is the ruling of 2026-10-06 during the run (docked mode
removed), so flex PCA inside solve3D and the balanced class-average
partition are not built; the questions the plan asked about them (can flex
run on a cohort at a crop, does gen_labelling(..., 'uniform') balance) no
longer arise.
refine=prob_state(keep the projection direction, score the pose against every state, draw the state). Emitted by three producers: the docked split stage of the solve3D stage controller (set_refine3D_mode_policyinsimple_solve3D_controller.f90, throughdocked_split_stage), the initialization stage ofrefine3D_statesfor input without state labels whenflex=no, and every stage plus the final missing-update pass ofrefine3D_states pose_policy=fixed. Consumed by: the parallel refine3D strategy (l_prob_state_mode, which only ever guards theprob_neighbranches, so removing it changes no other mode), the matcher and strategy allocator (prob_statecases), the probabilistic search (l_fixed_projectioninsimple_strategy3D_prob.f90, restoring the projection direction), the probability-table commanders (l_state_onlyinsimple_commanders_prob.f90), and the state-only table insimple_eul_prob_tab.f90(state_tabstorage,new_state,fill_tab_state_only,fill_tab_state_only_range,read_state_tab,write_state_tab, already without callers, andstate_assign); nothing else uses that storage.simple_eul_prob_tab_neigh.f90mentionsprob_statein a comment only. The parameter phases acceptrefine=prob_stateas a probabilistic-alignment mode; the UI ofrefine3Dand of SINGLE'snano3Dlist it as a choice.input_oris_fixed(the internalmultivol_modeofpose_policy=fixed): set and checked only inrefine3D_states; read in the sharedprep4probofsimple_strategy3D_srch.f90(which skips recording the projection index) and insimple_strategy3D_prob.f90. Retiring it withprob_stateis safe because it only ever ran withprob_state.pose_policy: parameter, parser, validation (fixed|local|global), therefine3D_statesUI, and therefine3D_statescommander, which maps it to the internalmultivol_modeandprob_neigh_mode. Also set tolocalby the docked handoff insimple_commanders_solve3D.f90.- The
flexkey: parameter, parser, yes/no validation, therefine3D_statesUI, therefine3D_statescommander (explicitflex=yes|no, otherwise derived from whether the project carries state labels and written back to the command line), the docked handoff (flex=no), and comments in two flex PCA files. The rule "flex initialization needsnstates>=3" already exists in the commander and inrun_flex_pca; only its messages, which suggestflex=no, change. l_init_state_assignment(theprob_stateinitialization phase): only inrefine3D_states, withinit_stage_cap,init_stage_minits, the init stage and its frequency march, the stochastic startup branch ofinitialize_state_volumes, and the state-0/1 branch ofset_refine3D_states_nstates. The variableinit_sweep_itersalso sets the automaticmaxits(four updates per particle times one sweep), so it stays under a neutral name.fill_tab_state_only,state_assign,l_state_only,l_prob_state_mode: as listed underprob_state; no other callers.docked_split_stage,randomize_states,build_solve3D_split_checkpointand the rest of docked mode: the docked branches ofexec_solve3D_cavgsandexec_solve3D, the handoff torefine3D_states, the split checkpoint module, the controller's docked rules (HET_DOCKED_STAGE,NSAMPLE_HET_SPLIT_CAP,PROB_NEIGH_MODE_DOCKED,solve3D_het_docked_stage,solve3D_docked_cohort_active,calc_docked_multistate_max_sampling, the docked case of the mode, trailing and stage-control policies, the 0.98frac_bestof multi-state stages 7 and 8), thecurrent_sample_onlyoption ofcalc_rec(used only by the checkpoint), thesplit_stageparameter and UI entries, and the manifest fieldsbase_multivol_modeandsplit_stage(plus the input keysmultivol_modeandsplit_stage).randomize_statesserves only docked mode;gen_labelling(..., 'uniform')stays, it labels independent multi-state starts.sticky_class_sampling: produced only by docked mode (the controller and the handoff); consumed by the matcher's sampling call (sampled_onlyofsample4update_class) and deleted from child command lines incalc_rec,calc_frozen_recand the sigma bootstrap.multivol_modeoutsidesolve3D:refine3D_statessetsinput_oris_refine(after this phase always),classify3D_refssetsindependent, andsimple_convergence.f90tests theinput_orisprefix to pick the state-overlap convergence rule. Nothing else reads its value. The solve3D memory benchmark script passesmultivol_modeon thesolve3Dcommand line.
Decisions taken from the inventory:
- With docked mode gone,
solve3Dandsolve3D_cavgsdecide bynstatesalone: one state is the single-state run, more is today's independent mode with its defaults (five stages and a 6 Å final low-pass for particles unless given,refine=shcin stages 1 and 2 for particles, stochastic sampling from stage 4, trailing reconstruction at the last stage only, the greedy missing-update pass and the final reconstruction always). Both commanders rejectmultivol_modeon their command line with a message that says so, because the parser accepts every known key for every program and a silently ignored mode would mislead. - The manifest reader keeps rejecting fields it does not know, as its unit
test requires for removed features under release 4; a manifest written by
an earlier docked or independent run therefore no longer reads, which
affects only
solve3D_addonreplays of runs made before this change. Project files (.simple) are untouched and read as before. - The generated Fortran indexes under
doc/code_overview/fortran-indexes/are not regenerated in this run; they are produced byscripts/gen_fortran_indexes.pland carry no hand-written content.
What changed¶
refine=prob_stateis gone from every layer: the solve3D stage controller no longer emits it, the parallel refine3D strategy, matcher and strategy allocator have no case for it, the probabilistic search no longer restores a fixed projection direction, the probability-table commanders always fill and read the full table, and the state-only table ofsimple_eul_prob_tab.f90(storage, constructor, fill, read, write and the balanced state draw) is deleted. The parameter phases no longer count it as a probabilistic-alignment mode; therefinechoices ofrefine3Dand SINGLE'snano3Dno longer list it. The multi-state minimum-population constant of the strategy, which applies to every probabilistic multi-state run, is renamed fromPROB_STATE_MIN_POPtoPROB_MULTISTATE_MIN_POP.refine3D_states: input without state labels (state 0 or 1) is always initialized by flex PCA and requiresnstates >= 3("state=0/1 input requires nstates >= 3 for flex_pca initialization"); labelled input refines its states and uses or reconstructs its state maps. Theflexkey, theprob_stateinitialization phase (its stage cap, minimum iterations, init frequency march and stochastic startup volumes) andpose_policy=fixedwithmultivol_mode=input_oris_fixedare removed;pose_policyislocal|globalin the parameter validation, the commander and the UI. Every run starts at theprob_neighfrequency march, trailing reconstruction is always requested, and the final missing-update pass isrefine=greedy. Thestartitoffset that only the docked handoff used is dropped. The variable that counts the draws of one sweep keeps setting the automaticmaxitsunder the namesweep_iters.- Docked mode is removed from
solve3Dandsolve3D_cavgs(ruling of 2026-10-06): the split checkpoint module is deleted, together with the cohort pass, the handoff torefine3D_states, the controller's docked stage rules and constants,randomize_states, the current-sample option ofcalc_rec, thesplit_stageparameter and UI entries, the manifest fieldsbase_multivol_modeandsplit_stageand the manifest input keysmultivol_modeandsplit_stage,sticky_class_sampling(parameter, derived flag, validation, controller emission and the deletes incalc_rec,calc_frozen_recand the sigma bootstrap) and thesampled_onlypath ofsample4update_class. The controller's mode, trailing and stage-control policies and the commanders now decide byparams%nstates(one state: single-state rules; more: the former independent rules, unchanged); both commanders refusemultivol_modeon their command line ("solve3D takes no multivol_mode: nstates>1 refines independent states");solve3Dstate continuation refusesnstates>1, as it did through the forced single mode before. The manifest replay ofsolve3D_addonno longer sets a mode. The UI help ofnstagesandlpstopsays "nstates>1" instead of "multivol_mode=independent". The solve3D memory benchmark script no longer passesmultivol_mode. - Unit tests: the manifest test now checks that a replay sets no
multivol_modeand that a manifest carrying the removedsplit_stagefield is refused; thesampled_onlycase of the sampler test is removed with the argument. The plan's two planned tests no longer apply under the ruling (there is no balanced class-average partition and no docked particle run); their place is taken by the command-line checks below. multivol_modeafter the change:refine3D_statesalways setsinput_oris_refineand refuses a user value,classify3D_refssetsindependent, and onlysimple_convergence.f90reads the value (theinput_orisprefix selects the state-overlap convergence rule ofrefine3D_states). The parameter has therefore become removable, but only together with a replacement for that convergence discriminator; it is kept in this run, as the ruling asks.- Documents: the
refine3D_states,solve3D,solve3D_cavgs, importance-sampling and fractional-update, NU-filtering andsolve3D_addonpolicies, the algorithm chaptersrefine3d.md,solve3d.md,sampling_and_fractional_updates.md, the heterogeneity-analysis overview andrefine3d_states.md, the heterogeneous-datasets how-to, and the skillssimple-refine3dandsimple-solve3d-importance-samplingwith their references describe the retired names as gone, or no longer mention them. The generated Fortran indexes are not regenerated.
Evidence¶
All paths are under /home/elmlundho/agent_runs/prob_state_flex/scratch.
- Builds. Base Debug build and fast gate (
logs/debug_base.log): 14 of 14 fast suites pass; no compiler warnings; six linker warnings "requires executable stack" (json_value_module.f90.othree times,simple_stream_stage_pool2D.f90.o,simple_commanders_cavgs.f90.o,simple_persistent_worker.f90.o). Phase 1 Debug build with the repository's./compile_debug.sh(logs/debug_p1_a.log, and the final tree inlogs/debug_p1_final.log): compiles, no compiler warnings with-Wunusedon, the same six linker warnings, fast gate 14 of 14. Phase 1 Release build (build_release.sh,logs/build_release_p1.log): the same five linker warnings as the Phase 0 base build, no compiler warnings. - Tests (
logs/tests_p1.log, Release tree): fast gate 14 of 14, including the ori suite (sampler) and the project suite (solve3D manifest, 68 checks); library testlib_heterogeneitypasses. The high-level testsolve3D_addonfails at its first basesolve3Dwith "balance=cavg needs selected class averages": its simulated particles carry no class averages. The same failure occurs on a Release build of the unchanged base (logs/build_base_addon.log), so it predates this run and is not caused by it; it is left for the maintainer. scripts/check_test_registry.pypasses (test registrations unchanged).- Text checks: no
prob_state,input_oris_fixed,fill_tab_state_onlyorstate_assigninsrc/(an unrelated helper whose name containedstate_assign,read_multistate_assignment_coverage, is renamedread_multistate_update_coverage); noflexkey orflex=nopath; thepose_policychoices arelocal|global; noTHROW_HARDcontinued with//&among the changed lines; no file mode changes. -
Command-line checks on the Release build with the kept single-state project (
logs/checks_p1/):refine3D_states nstates=2stops with "state=0/1 input requires nstates >= 3 for flex_pca initialization";pose_policy=fixedstops with "supports pose_policy=local|global";flex=noandsplit_stage=6are unknown arguments;solve3D multivol_mode=dockedstops with "solve3D takes no multivol_mode".refine3D refine=prob_stateis refused by the workers ("refinement mode: prob_state unsupported") but the distributed master keeps waiting; any unknownrefinevalue behaves the same way in the base code, and refusing it in the master would need a list of refine modes kept beside the matcher, a new contract this run does not add. Recorded for the maintainer. -
Independent review of the diff (a separate reviewer reading the code against this plan): no regression found. Replacing the mode tests by
nstatestests is exact, becausenstatesis set only from the command line and the old code refused every mode that disagreed with it. One behaviour changes for the better:solve3D cavg_ini=yes nstates>1used to fail, because the nestedsolve3D_cavgsinheritedmultivol_mode=independentwithoutnstates; it now runs a single-state class-average initialization and then labels the states, as intended. - Final trees: Debug (
logs/debug_p1_final.log) and Release (logs/build_release_p1_final.log, fast gate inlogs/fast_gate_release_final.log) built from the final working tree; the Release tree is the one Phase 2 uses.
Exit items¶
- Release and Debug builds without new warnings: met (see Builds).
- Fast test gate and the unit suites of the touched areas pass: met (Debug and Release, 14 of 14; the touched areas are covered by the ori, project, heterogeneity, parallel and alignment suites).
scripts/check_test_registry.pypasses: met.- Text checks hold: met.
- Open for Phase 2 (from Phase 0): the smoke test
solve3D nstates=3 cavg_ini_ext=yesneeds a start whose particles already carry three populated states; it starts from thesolve3D_cavgs nstates=3result.
Files changed in Phase 1¶
.github/skills/simple-refine3d/SKILL.md.github/skills/simple-refine3d/references/bayesian-model.md.github/skills/simple-solve3d-importance-sampling/SKILL.md.github/skills/simple-solve3d-importance-sampling/references/coupling-map.mddoc/algorithms/heterogeneity_analysis/README.mddoc/algorithms/heterogeneity_analysis/refine3d_states.mddoc/algorithms/refine3d.mddoc/algorithms/sampling_and_fractional_updates.mddoc/algorithms/solve3d.mddoc/how2s/how2_process_heterogeneous_datasets.mddoc/policies/3D/solve3D_addon_policy.mddoc/policies/3D/solve3D_cavgs_policy.mddoc/policies/3D/solve3D_policy.mddoc/policies/NU/nonuniform_filtering_policy.mddoc/policies/heterogeneity/refine3D_states_policy.mddoc/policies/importance_sampling_fractional_update_policy.mddoc/refactoring_notes/completed/prob_state_retirement_flex_split.mdscripts/memory/benchmark_solve3d.pysrc/main/commanders/simple/simple_commanders_prob.f90src/main/commanders/simple/simple_commanders_refine3D.f90src/main/commanders/simple/simple_commanders_solve3D.f90src/main/flex/run/simple_flex_pca_application.f90src/main/flex/run/simple_flex_pca_state_service.f90src/main/ori/simple_oris.f90src/main/ori/simple_oris_sampling.f90src/main/ori/simple_oris_tester.f90src/main/params/simple_parameters.f90src/main/params/simple_parameters_parse.f90src/main/params/simple_parameters_phases.f90src/main/sigma2/simple_sigma2_bootstrap.f90src/main/solve/simple_solve3D_controller.f90src/main/solve/simple_solve3D_manifest.f90src/main/solve/simple_solve3D_manifest_tester.f90src/main/solve/simple_solve3D_split_checkpoint.f90(deleted)src/main/solve/simple_solve3D_utils.f90src/main/strategies/parallelization/simple_refine3D_strategy.f90src/main/strategies/search/probabilistic/simple_eul_prob_tab.f90src/main/strategies/search/probabilistic/simple_eul_prob_tab_neigh.f90src/main/strategies/search/probabilistic/simple_strategy3D_prob.f90src/main/strategies/search/simple_matcher_smpl_and_lplims.f90src/main/strategies/search/simple_strategy3D_alloc.f90src/main/strategies/search/simple_strategy3D_matcher.f90src/main/strategies/search/simple_strategy3D_srch.f90src/main/ui/simple/simple_ui_heterogeneity.f90src/main/ui/simple/simple_ui_refine3D.f90src/main/ui/simple/simple_ui_solve3D.f90src/main/ui/single/single_ui_nano3D.f90
Phase 2: comparison runs (2026-10-07, done)¶
The runs follow item 4 of the ruling of 2026-10-06 during the run: no new
baselines, the single-state solve3D and case B compared with Phase 0, and
two smoke tests of the now implicit independent multi-state mode. They ran one
at a time on the otherwise idle machine (load 0.05 at the start), on the
Release build of the final Phase 1 tree, with the Phase 0 command lines and
the scratch/keep/ inputs unchanged. Evidence is under
/home/elmlundho/agent_runs/prob_state_flex/scratch: queue_phase2.sh (the
order), run_case.sh (the command lines; it gained the kind solve3D_C3 for
the second smoke test), and in logs/ the files case_<name>.log,
summary_<name>.txt and table_<name>.md for single_p2, B_p2, C3 and
I3, plus queue_phase2.log. Every run exited with status 0.
| Run | Command line (Phase 0 table, or as noted) | Wall time | State: population, FSC 0.5 / 0.143 (Å) | Acceptance |
|---|---|---|---|---|
single (single-state solve3D from S) |
as in Phase 0 | 14:31 | 1: 5,513, 4.35 / 3.80 | at most 3.96 Å: met (Phase 0: 3.84 Å) |
B (refine3D_states on the kept single-state project) |
as in Phase 0 | 18:58 | 1: 3,490, 5.02 / 4.03; 2: 723, 15.54 / 12.55; 0: 1,300 | best state at most 4.15 Å: met (Phase 0: 4.03 Å) |
C3 (solve3D_cavgs nstates=3) |
the S line plus nstates=3 |
14:49 | 1: 4,191 (30 class averages), 7.77 / 6.80; 2: 272 (5), 36.27 / 23.31; 3: 1,050 (15), 25.11 / 19.20 | completes with every state populated: met |
I3 (solve3D nstates=3 from the C3 result) |
the single line plus nstates=3, project from C3 |
37:19 | 1: 4,189, 4.66 / 3.93; 2: 471, 21.76 / 13.60; 3: 853, 14.84 / 10.53 | completes with every state populated: met |
What the runs did, read from their logs:
- single ran the same stages and low-pass limits as in Phase 0 (stages 4 to 8 at 9.1, 7.4, 7.3, 5.5 and 4.5 Å).
- B: "REFINE3D_STATES STATE INITIALIZATION BY FLEX PCA"; flex delivered three
states, its occupancy floor (at least 2,000 effective particles per state)
dropped one of 1,300 particles to state 0, and the run continued with
"REFINE3D_STATES FLEX_PCA INITIALIZED NSTATES: 2", then 32
prob_neighiterations in 11 frequency blocks from 12 to 6 Å ("STAGE ITERATIONS PROB_NEIGH/TOTAL: 32/32"), as in Phase 0 but without the empty initialization stage. - C3 ran stages 1 to 7 with
prob_neigh,probandprob_neighand noprob_statestage (Phase 0's docked C had threeprob_stateiterations at its split). - I3 was started from the C3 result rather than from S, as decided in Phase 0,
because
cavg_ini_ext=yeswith three states needs particles that already carry three populated states. It reported "SOLVE3D INDEPENDENT MULTI-STATE DEFAULT NSTAGES: 5" and "DEFAULT LPSTOP: 6.0 A", ran stages 4 and 5 withrefine=prob, and its coverage check found every active particle updated ("MULTISTATE ASSIGNMENT COVERAGE NSTATES=3 UPDATED/ACTIVE/MISSING: 5513/5513/0"), so no missing-update pass was needed. - Tests on the same tree: the fast gate passes 14 of 14
(
logs/fast_gate_p2.log) andscripts/check_test_registry.pypasses; no file mode changed. - Observation, not caused by this run: in B the sampling line "ACTIVE PARTICLES/SAMPLE TARGET/UPDATE_FRAC: 5513/1500/0.2721" counts the 1,300 particles flex dropped to state 0, so the realized update fraction over the 4,190 remaining particles is about 0.36, not 0.27; Phase 0 shows the same.
Bulky outputs were deleted after the numbers were recorded (runs/, and the
C3 result kept only for I3); scratch/keep/S and scratch/keep/single stay as
the inputs that reproduce these runs.
Files changed in Phase 2: this plan (status line and this entry), moved from
doc/refactoring_notes/planned/ to doc/refactoring_notes/completed/, and
the new report doc/refactoring_notes/completed/prob_state_retirement_flex_split_report.md.