Particle Sieve Policy¶
This document defines the behavioral policy for staged particle sieving in SIMPLE, implemented by simple_ptcl_sieve.f90.
The policy captures lifecycle, tiering, chunk state transitions, rejection,
completion, and change guardrails for ptcl_sieve.
1. Scope¶
ptcl_sieve is responsible for staged 2D chunk orchestration:
- coarse chunk generation from imported project records;
- optional fine chunk generation from coarse outputs;
- queue submission and completion polling;
- class-average rejection and compatibility filtering;
- per-tier completion accounting and final chunk combination;
- exposing latest CAVG visualization metadata for stream UI.
It is not responsible for stream file watching/import logic (owned by the stage types in
src/main/stream/stages) or low-level queue backend internals (owned by qsys_env).
2. Public Contract¶
Public API surface (type-bound methods on ptcl_sieve):
- lifecycle:
new,kill,set_final_ingestion,unset_final_ingestion,cancel - orchestration:
cycle,submit,collect_and_reject,hand_off_final_set - generation:
generate_chunks_coarse,generate_chunks_fine - integration:
combine_completed_chunks - status/query:
get_*family (get_finished, counters, latest JPEG payload) - restart recovery:
import_existing_chunks_coarse,import_existing_chunks_fine
Constructor policy (new):
new(params, settings, completedir, pre_chunked, optics_dir).settings(ptcl_sieve_settings) holds everything the sieve reads;paramsgives the sieve's queue environment only. The streaming stages fillsettingsthemselves (p05 with the mask diameter ofmoldiam.txt, p03 with the box default, coarse only, 4 chunks of 16 threads);sieve_settings(params)fills it from a parameters object (the standaloneparticle_sievingprogram, the tests).optics_dir=<dir>(optional) is where stream optics assignment publishes its optics maps; chunks handed tocompletedirthen carry the newest map's groups (section 9).settings%single_passenables coarse-only terminal semantics.settings%lpstartreaches the chunks'solve2Donly when it was given (sieve_lpstart); otherwise their command lines carry none andsolve2Dderives the starting limit from the mask diameter (min(max(mskdiam/12, 15), 20)Å). Parameter validation lifts an unsetlpstartto Nyquist (fny), so "given" means above Nyquist, not above 0.settings%use_modelenables learned class-average rejection in both tiers.settings%refspre-seeds coarse/fine compatibility models when the file exists; a missing file is warning-and-skip (non-fatal).- tier overrides (0: the default): the population thresholds (
pop_coarse,pop_fine, fromnptcls_coarseandnptcls_fine),lpstop_coarse,lpstop_fine,box_coarse,box_fine,nsample_coarse,nsample_fine,ncls_coarseandncls_fine. settings%nthris the chunk jobs' thread count, also given to the sieve's queue environment (qsys_nthr), andsettings%partitiontheir queue partition (empty: the environment's).- The chunks are classified and scored with
settings%mskdiam, or the box's disc when it is 0. Before 5 October 2026 scoring always used the box's disc; the sieve preset's weights were fitted with it, so p05's selections change and need a validation run before release.
Policy note: callers should use cycle and query methods as the normal
contract. Lower-level generation/submission calls are exposed for controlled
workflow composition and testing.
3. Tier Model¶
The sieve has two tiers:
- coarse (pass 1): broad chunking and first rejection
- fine (pass 2): refined chunking/rejection (optional)
Mode controls:
single_pass=yes: execution and terminal accounting stop at coarse tier.single_pass=no: fine tier is enabled when chunks are produced.pre_chunked=.true.: coarse chunks are imported from pre-existing project files rather than partitioned from a record list.
4. Chunk State Policy¶
Each chunk tracks:
- identity and paths:
id,folder,projfile - counts:
nptcls,nptcls_selected,nattempts(submissions of its 2D job) - lifecycle flags:
solve2D_runningsolve2D_completerejection_completecompletefailed
Sentinel files define state transitions:
SOLVE2D_FINISHED->solve2D_completeREJECTION_FINISHED->rejection_completeCOMPLETE-> terminalized chunkREJECTION_FAILED-> failed terminal chunk (written withCOMPLETE, section 12)FINAL_INGESTION-> a coarse chunk final ingestion staged (section 6.3):solve2D_completeandrejection_completeEXIT_CODE_solve2D-> the exit status the chunk job's script writes; with noSOLVE2D_FINISHED, the job failedEXIT_CODE_solve2D.job-> the job's record of itself (pid, host, scheduler and id), written when it starts; with no exit status, the job may still runchunk_input.simple-> the chunk's project as made, kept at its first submission for a retry<folder>_attempt1-> the folder of a failed first attempt: the chunk has used its retrychunk_mics.txt-> in a coarse chunk: the micrographs it took (chunked_mics.txtformat)consumed_coarse.txt-> in a fine chunk: the ids of the coarse chunks it merged
A chunk exists once its project is written, which is done by temporary and rename. What it took
is written to its folder first (chunk_mics.txt, consumed_coarse.txt, and FINAL_INGESTION for
a staged chunk); what follows its project (the coarse chunks' COMPLETE after a fine chunk,
chunked_mics.txt after a coarse chunk) is redone by a restart. A retried or renewed chunk keeps
its lists. Chunk ids continue past the highest chunk folder on disk (chunk_coarse_<id>,
chunk_fine_<id>), so a folder whose making was cut short is never reused.
Import policy from previous runs:
- sentinel files are authoritative for recovered state;
- incomplete non-failed chunks must regenerate command lines so they can be resubmitted;
- an incomplete chunk whose job recorded itself and wrote no exit status may
still run (a crashed stage leaves it): the job is cancelled, the folder set
aside to
<folder>_unfinished<k>, and the chunk made afresh fromchunk_input.simple, so a resubmitted job never shares its folder; - missing chunk project files are warning-and-skip, not hard stop; every chunk folder on disk is looked at, in id order, also past a missing one;
- the coarse chunks a fine chunk that exists merged (its
consumed_coarse.txt) are marked complete, also when the crash came before theirCOMPLETE, so they are not merged again; - the counters (section 11) are rebuilt from the imported chunks as the run counted them;
- the particle-sieving stage rebuilds
chunked_mics.txtfrom thechunk_mics.txtof the coarse chunks that exist before it reads it (rebuild_chunked_mics), so a crash between a chunk's project andchunked_mics.txtneither imports its micrographs twice nor loses them. Cleanup keeps the lists (section 8, item 2), so this holds for the whole run. While a chunk that exists has no list (pre_chunked, or made or cleaned before 2026-11-05), the file is kept as it is, with a warning.
cancel cancels the 2D jobs of the running chunks; the stage calls it when it
stops (p03 and p05). A cancelled chunk is resubmitted after a restart.
5. Cycle Policy¶
cycle(project_list) must execute in this order:
collect_and_rejectgenerate_chunks_coarse(project_list)generate_chunks_fine()when not coarse-onlysubmithand_off_final_set(project_list), when final ingestion is set (section 6.3)
This order is policy-significant and must not be rearranged without explicit contract updates, because downstream tier eligibility and counters depend on it.
6. Generation Policy¶
6.1 Coarse generation¶
Coarse chunk creation is driven by particle thresholds and record inclusion:
- consume non-included project records;
- build chunk projects under
chunks_coarse; - mark consumed records included;
- rewrite
chunked_mics.txt(by temporary and rename): one<project file> <micrograph index>line per included record, in record order. p05 reads it on restart (read_chunked_mics) to import every set it chunked from again with those micrographs marked included. The included records stay a prefix of the record list, which slicing by id relies on;generate_chunks_coarseandwrite_chunked_micsstop when they are not, before a slice puts a record in a chunk again.
In pre_chunked mode, coarse projects are copied from provided per-record
project files instead of repartitioning records.
6.2 Fine generation¶
Fine chunk generation is a merge/promote stage from eligible coarse outputs. Only coarse chunks that passed rejection and are not already terminalized are eligible inputs.
6.3 Final ingestion¶
Final ingestion flushes the particles left below the coarse threshold once no more input is expected. It is by design that they skip the coarse pass.
- Trigger: the driving stage calls
set_final_ingestiononce its upstream will hand on nothing more. Upstream says so with a marker in its folder (STREAM_IDLEorSTREAM_FINISHED,simple_defs_stream;upstream_done): preprocessing (p01) writesSTREAM_IDLEonce no new movie has come forMOVIES_IDLE_TIME_S(15 minutes) and its sets are done (the movies short of a set of five go as a partial set afterPARTIAL_SET_QUIET_S, 3 minutes, without a new movie), and reference picking (p04) once preprocessing is idle or stopped and its own sets are done; each writesSTREAM_FINISHEDwhen it stops. A marker counts once a watch made a settle time after it was first seen has found nothing new, so every project handed on before it has been taken. - The particle-sieving stage (p05) sets final ingestion on p04's marker. It
withdraws it (
unset_final_ingestion) when the marker goes or a new set arrives (retraction: preprocessing has new movies). - The initial analysis (p03) sets it once its "all" set is picked and every
extraction of it is collected, at
NMICS_PLAN(2)(500) picked micrographs, or with fewer once p01's marker counts and every imported micrograph is picked. It then cycles the sieve once more, so the leftover chunk exists before cycle 2 asksget_finished. It never withdraws it. - Staging:
generate_chunks_coarseputs every record not yet included into one more coarse chunk. It flags that chunksolve2D_completeandrejection_completewithout running 2D or rejection, and writesFINAL_INGESTIONin its folder, so a restart restores the flags (section 4) instead of submitting the chunk for a coarse 2D run. - Two-tier mode: the staged chunk feeds the fine tier with all its particles, so they get the fine 2D and rejection only. Once final ingestion is set and every coarse chunk is complete or failed, the last fine chunk is flushed below the fine threshold. No chunk is marked final: fine chunks end in any order, so a flag on the last one made could reach the 2D pool before an earlier chunk still running, and the pool would publish its final result (and 3D start its final run) without that chunk's particles. The end of the intake is the empty final set of step 5.
- Coarse-only mode (
single_pass=yes, the initial analysis): the staged chunk is handed off as it is, with no screening. The initial analysis classifies and selects over the combined set in its cycle 2. - The final signal is the only one, and always sent: once final ingestion is
set and every particle is through (no record left to chunk, every coarse
and fine chunk complete or failed),
hand_off_final_sethands on an empty project withsieve_final=yes(sieve_final_c<ncoarse>_f<nfine>.simple), once per chunk count. It is written in the cycle that hands off the last chunk (collect_and_rejectruns before it), so it follows every chunk's hand-off and costs no extra cycle; the pool takes final sets after every other (pool2D_policy.md, section 3). It also covers nothing pending at final ingestion, a last chunk that failed, and a coarse chunk finished with nothing selected after the last fine chunk. - Retraction reaches the pool: the pool takes back its final note when a set
with particles and without the flag arrives after it (
pool2D_policy.md).
7. Submission and Scheduling Policy¶
Submission policy:
- enforce
nparallelrunning limit; - prioritize fine chunks over coarse chunks;
- skip failed, running, or already completed chunks;
- submit asynchronously via queue environment;
- restore original working directory after submission pass.
Queue partition override policy:
SIMPLE_STREAM_CHUNK_PARTITION(simple_defs_environment) overrides the queue partition of the coarse chunks and the merged fine chunks; it is the variable the particle-sieving stage's queue reads. The initial analysis (p03) gives its sieve's chunksSIMPLE_STREAM_REFGEN_PARTITIONinstead. The former nameSIMPLE_CHUNK_PARTITIONis no longer read.
Worker server: the sieve's queue reuses the persistent-worker server of the process that drives
it. Reusing a server never turns its warm-up cooldown (autoscaling) off; a streaming queue turns
it on (qsys_env).
8. Rejection Policy¶
reject_cavgs is tier-aware and applies two filters:
- hard quality rejection (the
sievecontext's gates, applied byscore_project_cavgs); - compatibility model filtering (
class_compatibility) for the respective tier model (coarse_compatibility_modelorfine_compatibility_model).
Quality model policy (both tiers):
- both tiers load the same preset,
sieve(CAVG_QUALITY_MODEL_SIEVE_DEFAULT), and apply thesievehard-gate context. The fine tier does not switch to thechunkpreset (chunk100mics) or thechunkcontext, although its merged chunks hold 10,000 particles or more. The fine tier is the sieve's second pass, not the stream's chunk 2D: its class averages come from the sieve's own 2D runs, so the sieve scores them as it scores the coarse tier. This is a decision, not a gap. - as a result, the fine tier applies none of the shared
chunk/poolgates (theres > 40 Ågate included), nor thechunklocal-variance and band-pass floors. Flush chunks of a few hundred particles are scored the same way. - when
use_model=yes, rejection runs model-based quality scoring (score_project_cavgs, which callsevaluate_cavg_quality) after hard rejection. - when
use_model=no, rejection uses hard rejection only. - giving a tier another preset or context is a policy change. It needs a validation run, and the preset's spec must record which tier's tables it was fitted on.
Rejection outputs and artifacts:
- project state is mapped through
map_cavgs_selectionand persisted; - selected and rejected class-average stacks/JPEGs are written;
- a rejected class records
rejection_reasonas<tier>_reject:<reason>with underscores for blanks (coarse_reject:low_population), since the orientation reader splits values at blanks; - an all-class JPEG (
*_all_reasons.jpg) is written with reason-coded borders plus a sidecar key file (*_all_reasons.jpg.key.txt); REJECTION_FINISHEDsentinel is emitted on completion;- chunk selected-count is updated from particle states.
Cleanup retention policy (cleanup_chunk):
- cleanup runs after rejection completes;
- keep the files a restart reads (section 4): the lifecycle sentinels
SOLVE2D_FINISHED,REJECTION_FINISHED,COMPLETE,REJECTION_FAILED,FINAL_INGESTION, and what the chunk took,chunk_mics.txt(coarse) andconsumed_coarse.txt(fine); - keep chunk project metadata file and
frcs.bin; - keep selected/rejected JPEG renderings;
- keep all-reasons reason-overlay JPEG and its sidecar key file;
- keep latest iteration JPEG for the chunk;
- keep the class-average stack registered in the chunk project, plus final
iteration stacks for all three stack variants when present: whole stack
(non-
_even/_odd),_even, and_odd; - keep the highest-rank sigma STAR candidate (
sigma*.star, preferring_iterNNNwhen available).
Compatibility observability policy:
- rejection must log tier metrics (
a/b/c, deltas, validity flags, convergence). - convergence events should be logged explicitly when reached.
9. Completion and Finished Semantics¶
Chunk completion accounting:
- in coarse-only mode, coarse chunks can finalize accepted/rejected counts directly.
- in two-tier mode, terminal accepted/rejected counters are accumulated from fine chunks; coarse chunks act as feeders unless no fine tier exists.
get_finished contract:
- requires at least one coarse chunk;
- all coarse chunks must be complete or failed;
- if
coarse_only, this is terminal; - if not coarse-only and no fine chunks exist, coarse completion is terminal;
- otherwise all fine chunks must be complete or failed.
Hand-off policy:
- a terminal chunk (a rejection-complete coarse chunk in coarse-only mode, otherwise a
rejection-complete fine chunk) is handed to the next stage as a copy of its project in
completedir, before itsCOMPLETEsentinel is written; - with an
optics_dir, the copy gets the groups of the newest optics map in that directory, applied by import index to its micrographs, stacks and particles, with the map's optics segment; without a map yet, or without anoptics_dir, it is an exact copy; - the chunk's own project is never given optics groups: fine chunks merge coarse chunks, and the merge offsets each source's group ids, so the groups are applied only on the hand-off copy;
- the copy is written as
<stem>.tmpincompletedirand renamed to<stem>.simple, so the stage watchingcompletedirfor*.simplenever reads a partial project and needs no long settle time. Keep the temporary name off the.simplesuffix and incompletedir(a rename is atomic only within one file system).
10. Combination Policy¶
combine_completed_chunks merges eligible terminal chunk projects into one
project in completedir.
Eligibility:
- coarse-only: rejection-complete, non-failed coarse chunks
- two-tier: complete, non-failed fine chunks
No-op policy:
- do nothing when no eligible chunks exist;
- do nothing when target combined project already exists.
11. Counter and Query Policy¶
Counters must remain monotonic and query-safe:
get_n_accepted_ptcls,get_n_rejected_ptcls,get_n_accepted_micrographsare cumulative terminal counters: the finalised chunks of the terminal tier, and in two-tier mode the coarse chunks finalised with nothing selected (all their particles rejected), which no fine chunk counts.- every counter is cumulative across restarts:
newrebuilds them from the imported chunks. get_n_pass_1_non_rejected_ptclsandget_n_pass_2_non_rejected_ptclsreflect non-terminal per-tier selected counts.get_n_coarse_accepted_ptclsandget_n_coarse_rejected_ptclsare cumulative coarse-tier rejection results.get_n_fine_accepted_ptclsis the cumulative fine-tier accepted count.get_latestmust return.false.safely when latest payload is incomplete or uninitialized.
12. Failure Handling¶
Hard-fail conditions include structural inconsistencies (for example missing required source files in pre-chunked input). Recovery-friendly paths should prefer warning-and-skip for recoverable restart artifacts (for example missing one imported chunk project among many).
A chunk fails, and the stage does not stop, when its 2D job exits without
SOLVE2D_FINISHED (its script wrote EXIT_CODE_solve2D), or when its 2D run left
no class averages rejection can score (no output stack, fewer images than
classes, or class rows that do not match) (fail_chunk):
- The first failure retries it. The chunk's folder is moved to
<folder>_attempt1and kept, and the chunk starts again in a fresh folder fromchunk_input.simple, with its command line made again. - The second failure drops it. It is written
REJECTION_FAILEDandCOMPLETE; none of its particles is handed on; it counts as complete for the final flush and forget_finished. The sieve logs a warning, counts the chunk and its particles (get_n_failed_chunks,get_n_failed_ptcls), and p05 shows both in its GUI status. - A chunk without
chunk_input.simple(made before this rule) is dropped at its first failure. - A job that vanishes before its script writes an exit status (walltime, a
lost node) is found by its job's liveness check (
qsys_async_job; the chunk's job runs through it): gone at two checksJOB_LIVENESS_S(5 minutes) apart, it gets a lost status and the chunk takes the failure path above.
13. Test Policy¶
Policy-level tests for ptcl_sieve must cover:
- lifecycle defaults and idempotent reset;
- import recovery from sentinel files, including a chunk final ingestion staged;
- tier counters and running-count semantics;
get_finishedbehavior across coarse-only and two-tier modes;- empty-cycle behavior on empty record lists;
- latest-payload safe false-path;
- the hand-off copy in
completedir, with the newest optics map's groups when anoptics_diris given, and no.tmpleft behind; - a failed chunk retried once in a fresh folder, and dropped with its particles counted when it fails again.
Reference tester module: simple_ptcl_sieve_tester.f90.
14. Change Checklist¶
When changing ptcl_sieve behavior:
- preserve cycle ordering unless policy is updated;
- preserve fine-before-coarse submission priority;
- preserve sentinel-driven state recovery contracts;
- keep
get_finishedsemantics backward compatible; - keep counter meaning stable (
terminal cumulativevstier snapshot); - preserve cleanup artifact retention semantics (including sentinel files and whole/even/odd final iteration stack retention) unless policy is explicitly revised;
- update tester coverage for behavior changes;
- update this policy document in the same change.
15. particle_sieving_2¶
particle_sieving_2 (simple_exec, developer visibility) is a second offline sieving program. It shares no
code, file or sentinel with ptcl_sieve: its logic is ptcl_sieve2
(simple_ptcl_sieve2.f90), a controller of whole programs,
behind the thin commander_sieve_ptcls2. Its decisions and their reasons are in
particle_sieving_2.md; this section is the
living description.
The run, in its execution directory:
- Halves. The program makes the even/odd halves of every selected particle first (
ensure_field_halveson the work project; by micrograph group when every stack has its micrograph). A step labels only its own active particles: left to the seed'ssolve2D, every stack it does not hold would go to the lighter half. - Seed.
solve2Don the selected particles of the first stacks with selected particles, in project order, up tonmics(100) stacks or 10,000 selected particles (SIEVE2_SEED_NPTCLS), whichever comes first (the stack that reaches 10,000 is the seed's last), intoncls(100) classes, undermskdiam, which is required; every step uses the same mask.mskdiam=0runs the seed'ssolve2Din its automatic mode, and the later steps take the mask it registers with its final class averages. A mask far wider than the particle (the box's) letssolve2D's stage 2 leave many classes as ring-shaped rotational averages (decisions 23 and 28 of the plan).solve2Dtakeslpstop(10 A by default), the limit its stages march to; its last stage and terminal pass take their limit from the class FRCs, whichrefine2Dholds atlpstoponly in the stream (decision 30). Each seed particle is then givenupdatecnt1. - Labels, once. The class-average CNN (
infile,cavg_cnn_class_probs) scores the class averages a single time: after the round that froze the references (step 5), on those averages; without a freeze, after the last round; with no batch at all, on the seed's. A class is junk when it is populated, not empty and itsp_junkexceeds 0.9 (SIEVE2_JUNK_THRES, strictly). The run stops when no populated class is left that is not junk. Until the labelling the run report's accepted and junk columns read - (decision 37). The labelled averages are written as a montage,labels_<tag>.jpg: a red frame on a junk class, an orange one on a populated class whose most probable CNN group is junk below the threshold (mrc2jpeg_tiledwithframes; decision 40). - Student.
learn_class_studenton a random sample of at most 10,000 ingested particles (junk classes included) against the current class averages: after the seed, on the seed's particles, and again after each greedy round listed inretrain(comma-separated rounds; none by default) that a batch follows (a listed round no batch follows is ignored with a warning). The batches are predicted with the latest model. Retraining after every round placed new particles no better and took most of the run's time (decisions 26 and 27 of the plan). - Batches. The other stacks, in project order, in batches closed once they hold 10,000 selected
particles (the tail is the last batch); on a set of about 53,000 particles that is five batches and one greedy
round, after the last batch.
predict_classesgives each particle its class, angle and shift (the student's candidates and the alignment over them); nothing else is searched. Then the batch's sigma2 records are seeded (sigma2_state_extend): each starts from the store's global curve of its half, every other record is kept, and the store is published over the batch folder's copy. A pass rewrites a record over its band only, so an unseeded batch particle would never get a valid record (the seed'scalc_pspecfilled only the seed's). The extension takes each half's mean over the seeded rows: particles of one half (halves follow micrographs) wait for the next batch, and any left at the end are logged. - Greedy rounds. After every five batches and after the last one: one
refine2Diteration,refine=greedy, at the full box (autoscale=no), on every ingested particle, junk classes included. The first round is a full update; it publishes carried class sums at the full box (solve2D's are at its crop and its final averages at the full box), and every later round takesupdate_fracfor the new particles (update count 0) and a quarter of the earlier ones (SIEVE2_ROUND_OLD_FRAC), never fewer earlier ones than new, lowest update count first (shuffled within a count), blended with the carried sums: an earlier particle is searched again about every fourth round. (With as many earlier particles as new, the previous round's batches took that whole share and every particle searched twice was never searched again; decision 31.) A class's blended sums are the sampled particles' plus the carried sums scaled by(N - n) / M(N the class's particles ever searched, n those sampled, M what the carried sums held). Round r is iterationSIEVE2_ROUND_ITER0 + r - 1(8 first). A round aligns at the limitrefine2Dwould take from the class FRCs, never finer thanlpstop(passed aslp, withsolve2D's stage keysstageandgold_std_stageso that the references stay half-specific). Each round is followed, when listed inretrainand a batch follows, by the student's training. Each round reports the student's agreement: the share of its new particles the search left in the class the student gave them (all, and split by that class's label when the batch was predicted), beside the share of the earlier particles searched again that kept theirs, the search's own agreement (decisions 32 and 33), and how much the class averages moved: each class's new average against its previous one (the seed's for round 1) inside the mask and up to the round's low-pass limit, weighted by its new population (decision 35). Freeze: once two rounds running (SIEVE2_FREEZE_NROUNDS) left the averages at a weighted correlation of 0.99 or more (SIEVE2_FREEZE_CORR) with the previous ones, every later round searches the new particles only (update_frac= new / ingested) and passesrestore_cavgs=no, so the references and their labels stay; with the keyrestore_cavgs=yes(default no) the last round restores them from the carried sums and its new particles, for the output averages only: the selection is the one made on the frozen references. An earlier particle then keeps its class (decisions 36 to 38). After each frozen round,make_cavgssums the round's own particles in their new classes intoround_<nn>_cavgs/cavgs_round_particles.mrc, for inspection, with its montage framed by the labelling (cavgs_round_particles.jpg): nothing reads these averages back (decisions 39 and 40). A class a round empties stays empty: the first round empties the seed's nearly empty classes (17 to 23 of 100 on betagal) and nothing refills them (decision 29). - Result. A particle is accepted (state 1 in
ptcl2Dandptcl3D) when it is selected, ingested and its class is not junk by the labels; junk classes get state 0 incls2Dandcls3D. The 2D shifts go toptcl3Dunless it holds a 3D alignment, and the project is written once (a temporary file, renamed). It carries no sigma2 store, asparticle_sieving's combined result has none; a later program rebuilds it.
Folders and files: seed/, learn_<nn>/ (nn the rounds done, 00 after the seed), batch_<nnn>/,
round_<nn>/, round_<nn>_cavgs/ (frozen rounds), each with
its own copy of the work project under the project's own file name (the sigma2 store's layout digest
includes the project name) and of the current sigma2 store; one labels table, labels_round_<nn>.txt (labels_seed.txt without
batches) (class, population, the three probabilities, empty, junk); particle_sieving_2_report.txt (step, wall
time, particles ingested and accepted, junk classes and, for a round, the agreement shares in %: new particles,
those of a class not junk and of a junk class, earlier ones searched again; then the class averages' weighted
correlation with the previous round's); student_by_class.txt (the student's
agreement by class, ranked by the share kept: class, new particles predicted there, kept, placed there by their first
round, final population, last p_junk and label; decision 34). There is no restart: a rerun needs a fresh folder.
Tests: test=unit_project suite=particle_sieve2 (the seed and batch cut with the seed's two limits, the
retraining rounds, the labels, the update fraction, the final states, the halves of the sigma2 seeding, the two
stops in forked children) and the CTest entry particle_sieving_2_mini (the program on 2 000 simulated particles
in 20 stacks, a micrograph each and no halves, the seed ended by its particle cap before nmics, the student
retrained after round 1 of a list that also names the last round, with the CNN fixture at a threshold frozen
between its p_junk values; among its gates, the training folders, no round finer than lpstop, the agreement
shares reported for every round, the table by class (every class once, every new particle once, ranked), both halves in
every batch, balanced halves and a valid sigma2 record for every particle in the last round's store; its run
directory is kept for test=identity).