Skip to content

Audit B: 2D, particle I/O, stack indexing, KB interpolation, FSC area score

Scope: the seven documents named in the assignment, read in full and checked against the tree at fd5b5bc8e (HEAD 2026-10-21; working tree has simple_cartft_calc*.f90 modified and the untracked doc/policies/README.md and doc/policies/layering_and_project_ownership_policy.md, which I read and treat as the maintainer's draft: its section 8 already records the make_cavgs worker write). Nothing in the repo was edited. Line numbers in L.. are the policy document's; code is file:line.

Finding IDs are per document (S solve2D, B bootstrap, C cache, R read path, I stack indexing, K KB, F fsc). Cross-cutting items are X1..X8 at the end.

Counts (61 per-document findings + 8 cross-cutting). Severity: H 3, M 27, L 31. Category: STALE 10, DRIFT 11, CONTRADICTS 3, VIOLATED 4, GAP 24, STRUCTURE 9, OLDNAME 0. Cross-cutting: H 1, M 5, L 2. Per document: solve2D 16 (H1 M7 L8), bootstrap 10 (H2 M5 L3), cache 9 (M5 L4), read path 8 (M2 L6), stack indexing 9 (M4 L5), KB 5 (M3 L2), fsc 4 (M1 L3).


doc/policies/2D/solve2D_policy.md (lines 566; last commit 2026-10-20; verdict: minor drift, one large gap, split advised)

  • [S1][M][STALE] L112-114: "phase 2 stages run nits_per_stage iterations, more when the sample needs them" -> now: maxits = iter + max(nits_per_stage, coverage_nits) - 1 and minits = iter + 1, so a phase-2 stage runs 2..nits_per_stage iterations and stops when converged; only when coverage needs more than nits_per_stage is minits = maxits (fixed count). Evidence: src/main/solve/simple_solve2D_controller.f90:246-254. Fix: "run at most nits_per_stage iterations (at least 2) and end on convergence; a sample that needs more than nits_per_stage iterations to cover every particle fixes the count (minits = maxits)".
  • [S2][M][STALE] L346-349: "make_cavgs/cavgassemble commanders ... (command-line wrappers; theirs is a full project write)" -> only commander_cavgassemble (run_cavgassemble) does the full write (simple_cavgassemble_strategy.f90:31). Shared-memory make_cavgs writes the ptcl2D, cls2D and out segments (simple_make_cavgs_strategy.f90:246-255, 291-294); a distributed make_cavgs worker part 1 writes ptcl2D while the other parts read (:253, listed in the layering draft). Fix: say which wrapper writes what.
  • [S3][M][VIOLATED] L221-228 (and simple-solve2d skill "master writes only cls2D, cls3D, out and particle segments"; simple-main-project skill "writes it once per iteration"): the distributed refine2D master writes ptcl2D three times after the workers: merge_algndocs(..., 'ptcl2D', ALGN_FBODY) writes the merged segment by default (simple_refine2D_strategy.f90:404; write defaults to .true., simple_sp_project_core.f90:569-592), run_distributed_cavg_assembly (:771) and distr_finalize_iteration (:449), plus once after sampling in prob_align2D_exec (simple_prob_align_strategy.f90:314): four writes per prob iteration, three otherwise (CORRECTED after the policy edits: the first version of this report missed the merge write). The layering draft rule 5.4 ("one write of a segment per iteration") and red flag 7 name exactly this. Fix in code: skip :449 when assembly wrote; or state the second write and its reader in the policy.
  • [S4][H][GAP] Segment I/O contract of the 2D workflows is not written (who may write ptcl2D/ptcl3D/cls2D/cls3D/out/projinfo, how often, from where). Observed in code, to be turned into a table in section 3 (a "Project segments" subsection), see the table after this list. The refine3D policy has the equivalent (section 4, lines 161-184); the 2D policy only says what assembly writes. A developer cannot tell that (a) solve2D holds its own spproj across stages and must reread ptcl2D/ptcl3D/out before writing them (simple_commanders_solve2D.f90:197-198, 217-224, 701-704), (b) shared-memory refine2D hands ptcl2D to prob_align2D through the file (write simple_refine2D_strategy.f90:612, commander rebuilds its own params/builder, reread :622), (c) ensure_field_halves can write stk+ptcl2D+ptcl3D from any master-side caller (simple_eo_partition.f90:65-76).
  • [S5][M][DRIFT] L336-343 (and read path L75-86): "In shared memory the probability table fills the particle buffer" -> only when the run is uncached: if( .not. params%l_distr_worker .and. .not. l_cached ) (simple_commanders_prob.f90:371). With cache=yes the matcher reads the cache and no buffer is filled. Add "uncached".
  • [S6][M][GAP] Sampling predicates are in code but not in the policy: update_frac >= 0.99 is treated as no sampling at all (l_update_frac = update_frac < 0.99, simple_solve2D_controller.f90:94: no sample, no carry-over, no fillin, no terminal pass); refine2D_blends_carryover = l_update_frac .and. startit /= 1 (non-stream) or which_iter > 1 .and. update_frac < 0.99 (stream2d) (simple_matcher_smpl_and_lplims.f90:347-355), used by the matcher and the masters; is_fresh_2D_start excludes fillin and continue=yes (simple_strategy2D_alloc.f90:33-38). Proposal: add to section 4 as the single definition of "blends carried sums" and "fresh start".
  • [S7][M][GAP] cavg_state.bin has more writers and a different lifecycle than L494-513 say ("written only by the assembly owner"): (a) the distributed make_cavgs assembler also publishes it, because cavger_assemble_sums_from_parts always calls commit_carryover (simple_classaverager_restore.f90:867, 764), so the final full-box make_cavgs of solve2D, the seed references and the randcls/continue reference rebuild overwrite the run's carried set with sums of another geometry (safe, matches fails and the next iteration is a full update, but unstated; shared-memory make_cavgs does not write it); (b) the stream pool pads it (cavger_pad_carried_sums, simple_stream_pool2D.f90:877); (c) nothing deletes it: qsys_cleanup keeps 2D sums by default and no caller passes keep2D=.false. (simple_qsys_funs.f90:16-48). Proposal: list writers and end of life in section 6.
  • [S8][L][STALE] L536-537 checklist: "Does inpl_cont=no retain the callback route" contradicts L443-447 (inpl_cont internal, not selectable in 2D; set to no only by refine=cont, simple_parameters_phases.f90:1049). Delete or reword the item.
  • [S9][L][DRIFT] L131-132: "solve2D_chunks and the stream keep cls_init=rand" is a default: both pass a given cls_init through (simple_commanders_solve2D.f90 init_chunk_clustering, simple_stream_pool2D.f90:240-243); with prev a chunk fails ("requires a previous 2D clustering") because chunks delete the clustering (generate_chunk_projects). refine2D rejects prev only when it makes the references itself (init_standard_refs); with refs= given init_refine2D_refs returns first (simple_refine2D_strategy.f90:672).
  • [S10][L][DRIFT] L285 and L381-389: bench files are BENCH/<FAMILY>_BENCH.txt and BENCH/<FAMILY>_BENCH_PARTppp.txt (src/fileio/simple_bench_io.f90), so REFINE2D_BENCH_PARTppp.txt and PROB_TAB2D_BENCH_PARTppp.txt are inside BENCH/; the strategy file is REFINE2D_STRATEGY_BENCH.txt.
  • [S11][M][STRUCTURE] 566 lines mixing policy with implementation notes: L262-337 (part-file layouts, dense and sparse assignment algorithms, tie handling, bench record contents), L381-389 (bench inventory, duplicates refine3D_policy.md 11.1), L438-481 (continuous in-plane, duplicates refine3D_policy.md 528-637), L436 + L494-513 (carried sums, duplicates importance_sampling_fractional_update_policy.md 195-210, 412-426 and the refactoring note 4.1). Sections 7 and 8 repeat sections 2-4 almost line for line. Proposal: keep stages, seeded restart, ownership, artifacts; move the part-file and assignment algorithm text to an implementation note; point to one home for the carried sums.
  • [S12][L][STRUCTURE] L10-13, L133, L444: dated history ("called abinitio2D before 2026-10-03", "since release 4 (2026-10-03)", link to abinitio2D_seeded_restart.md). Allowed by CLAUDE.md as dated history, but a living policy should state the current names only.
  • [S13][L][VIOLATED] distr_initialize clears updatecnt/sampled in memory only (simple_refine2D_strategy.f90:319-321); in non-probabilistic distributed mode no ptcl2D write precedes the workers (they read the file), so a stand-alone refine2D nparts=N refine=snhc_smpl startit=1 starts from the file's stale flags. solve2D masks it (writes the cleaned field first, simple_commanders_solve2D.f90:166-170). Confirm before relying on it.
  • [S14][L][GAP] solve2D_chunks (stack-bound chunk projects built by hand, generate_chunk_projects, solve2D_chunk type in src/main/solve/simple_solve2D_chunk.f90) and nrestarts (restarted_exec, simple_exec_refine2D.f90:39-43) have no ownership entry in section 3; solve3D_chunks_policy.md has the 3D counterpart.
  • [S15][L][GAP] The matcher keeps module-level pointers (b_ptr, p_ptr) and public work arrays (ptcl_imgs, ...) that set_b_p_ptrs2D re-aims; prob_align2D_exec and exec_prob_tab2D call it with builders that are killed on return (simple_strategy2D_matcher.f90:70-75, simple_prob_align_strategy.f90:303, simple_commanders_prob.f90:329). Rule missing: "every entry into the 2D matcher module sets the pointers; they dangle after the owning builder is killed".
  • [S16][L][GAP] No test is named anywhere in the document. Existing guards to cite: carried sums unit_reconstruction suite "class-average carry-over" (simple_cavg_sums_tester.f90), part files unit_pftc_align2D3D "2D probability table I/O", half-sets and merge unit_project ("eo partition", "project merge"), stack I/O unit_core. Missing guards: byte identity of cache=no vs cache=yes (claimed at L371-374), restore_cavgs_inmem vs distributed assembly parity (L350-358).

Segment table for S4 (observed; proposal for section 3). "own project" = the process's build%spproj:

Process / routine Reads Writes (segment, when)
solve2D commander (own spproj) whole project once; cls2D,out after every stage; ptcl2D,ptcl3D at the end ptcl2D at start (fresh: after delete_2Dclustering; seeded: after reseed_classes); ptcl3D at the end unless a valid 3D alignment exists; out after the final class averages; ensure_field_halves may write stk,ptcl2D,ptcl3D
refine2D shared memory (restore_cavgs_inmem, inmem_finalize_run) file at start cls2D+cls3D every iteration; ptcl2D+out once per invocation; prob mode: ptcl2D written twice and reread once per iteration (:612, prob_align2D_exec:314, :622)
refine2D distributed master file at start ptcl2D after sampling (prob mode); ptcl2D by the default-writing merge of the workers' documents; after assembly cls2D,cls3D,out,ptcl2D; ptcl2D again in finalize_iteration; out at run end
refine2D worker (refine2D_exec) file none: algndoc_partN, sigma2 part files, cavg_contrib_partN.bin, dist_part*/assignment files
make_cavgs shared memory file ptcl2D (class remap, halves), cls2D, out
make_cavgs distributed file worker part 1: ptcl2D; assembler (run_cavgassemble): full project write
sigma2 rebuild entry (ensure_sigma2_for_iteration) - projinfo (sigma2_state registration); caller rereads projinfo

doc/policies/2D/class_average_bootstrap_policy.md (lines 373; last commit 2026-10-03 (rename only; last substantive change 2026-06-12); verdict: stale, rewrite)

The "four files changed since" of the staleness table are the four files the document names as places the command must NOT live; none of the changes touched bootstrap. The real drift is older: the command was reworked on 2026-06-12 (199b95d38) and the policy never followed.

  • [B1][H][STALE] L244-254 and L349-350, L360-365: "If any accepted parent has Y_cap_i < Y_child, the command stops and reports the limiting parent classes" -> now such parents (and parents with zero population, inactive cls2D state, invalid eo, a realized anchor below 2, no non-anchor particles left, no parity-complete anchor) are skipped, recorded in the manifest with a reason, and counted in >>> BOOTSTRAP_CAVGS CLASSES INPUT/USED/SKIPPED/OUTPUT; the command stops only when no class is usable. The output size is K_used * osmpl_fac, not K * osmpl_fac. Evidence: simple_commanders_mkcavgs.f90:146-175, 229-268, 507-527; the UI help already says "usable parent classes times osmpl_fac" (simple_ui_refine2D.f90, new_bootstrap_cavgs). Rewrite sections 9, 13, 14.
  • [B2][H][STALE] L8-12, L110-123, L153-176: "copies the accepted original class averages into the start of the output stack" / required inputs "merged, even, and odd class-average stacks" -> the command reads no class-average stack. It builds a bootstrap project (rows of every parent member as role original, plus anchor and member rows per child), writes it, and runs make_cavgs on it, so the whole output including the "original block" is re-assembled from particles (:188-192, 207-221). Required inputs are the ptcl2D, cls2D and stk segments (:123-127).
  • [B3][M][STALE] L224-227: a parent without a parity-complete anchor "is copied only in the original block" -> now the last anchor slot is swapped for the best-ranked particle of the missing half (select_bootstrap_anchor, :318-329); if that fails the parent is skipped entirely and absent from the original block too. A realized anchor below 2 also skips the parent (:148-153); neither rule is in section 8.
  • [B4][M][STALE] L276-327: manifest and membership formats. Code writes comment header lines (ncls_input, ncls_used, ncls_skipped, ncls_expected_if_all_input_valid, ncls_out, osmpl_fac, frac_best, anchor_target, skipped-class lines) then columns out_cls role parent_cls child_id parent_pop n_anchor n_members; membership columns synthetic_pind out_cls role parent_cls child_id source_pind source_rank source_corr eo stkind indstk; roles original|child (manifest) and original|anchor|member (membership), not anchor|variable. No run_seed/parent_seed exists; the shuffle uses the global generator (:355-362, 501-549). The reproducibility sentence (L324-326) is therefore false as written.
  • [B5][M][STALE] L176 and L328-334: "The original project ... not modified" / "temporary bootstrap project" -> boot_proj%write(params%projfile) (:209-210) writes the synthetic project to the command's project file; the original is safe only through the mkdir=yes copy (default set at :119); with mkdir=no it is overwritten.
  • [B6][M][GAP] unbootstrap_cavgs (exec_unbootstrap_cavgs, simple_commanders_mkcavgs.f90:609-744, UI new_unbootstrap_cavgs) is the return path: it copies cls3D alignment of the bootstrap_child=0 classes to their bootstrap_parent classes of projfile_orig (or, without the cls2D keys, by majority vote on ptcl2D:pind_prev) and calls map2ptcls. Section 10 ("must not perform ... mapping of synthetic child orientations back to original particles") and section 12 never mention it. Proposal: a "Return path" section; state that only the original block is mapped back.
  • [B7][M][STRUCTURE] L3 "first implementation policy" and section 14 "Before implementation, confirm": plan narrative of a command that has existed since June; the statements "public controls are only osmpl_fac and frac_best" (also refs; all three are UI_VIS_DEVELOPER, so not public in the UI sense) and "should not expose seed" are design intent. Convert to present tense.
  • [B8][L][DRIFT] L121-123 "accepted = cls2D%state > 0": code rejects state == 0 and pop == 0; a missing state key is accepted (:246-258).
  • [B9][L][GAP] One-way link: nothing in solve3D_cavgs consumes the package (rg bootstrap src/main/solve finds no call) and solve3D_cavgs_policy.md does not cite this policy; the "Handoff" section is aspirational.
  • [B10][L][GAP] The 553-line exec_bootstrap_cavgs (layering draft section 8) carries the whole logic in the commander, while section 4 says the work belongs "near explicit class-average assembly ... or a new commander": acceptable, but the policy gives no tester; none exists.

doc/policies/2D/particle_cache_policy.md (lines 197; last commit 2026-10-19; verdict: minor drift)

  • [C1][M][STALE] L108-111: fallback to uncached execution "with no active particles, a denoised primary source, or a non-particle oritype" -> no denoised-source check exists (ptcl_cache_ensure, simple_ptcl_cache.f90:488-587; the file has no "denois"). Delete the clause; section 7 lists the real eligibility (box_crop >= box, oritype).
  • [C2][M][CONTRADICTS] L146-148: "The cached class-average restoration path is accepted on statistical parity with uncached execution, not bit equality" vs L53-57 and solve2D_policy.md L371-379 and the simple-solve2d skill ("cache=no equals cache=yes byte for byte"). Since crop_particles2D (simple_matcher_ptcl_batch.f90:313-320) makes the same entry in memory, uncached equals cached; parity is against the retired full-box path, or against the stream pool. Reword.
  • [C3][M][DRIFT] L116-119: "restoring class averages from cropped particles is deliberately not the same preprocessing as from full-size ones, so ranks must never mix modes" -> an uncached rank (outside the stream pool) restores from the in-memory cropped entry, the same bytes. The mandatory uniformity (ptcl_cache_assert_ready, simple_ptcl_cache.f90:394-408) stays, but its stated reason is out of date; state the actual reason (buffer sizes, l_cached paths, stream pool keeps full-size sums).
  • [C4][L][DRIFT] L15-16: "In probabilistic mode the same particle is read twice per iteration" -> once in shared memory (the table fills the particle buffer, the matcher copies from it); twice in distributed runs.
  • [C5][L][CONTRADICTS] L78-80: "(the range-derived fallback is covered by the per-stack fromp/top)" -> project_stack_indexing_policy.md L93-100: the range-derived indstk fallback no longer exists (release 4); map_ptcl_ind2stk_ind stops (simple_sp_project_ptcl.f90:72-83). The fingerprint still tolerates an absent indstk (simple_ptcl_cache.f90:293-298); say that it folds what the project holds.
  • [C6][M][GAP] Consumers (L44-66) list who must not use the cache but not who turns it on: the stream initial analysis solve2D job (simple_stream_stage_initial_analysis.f90:1346) and the solve3D state-assignment route's solve2D (simple_state_assignment.f90:1159, also stream_3D_ingestion_policy.md L379). refine2D exposes cache but not cache_dir in the UI (simple_ui_refine2D.f90:61-66 vs :116-123), while L5 presents the pair for "the 2D matcher workflows". Add a "Known callers" list.
  • [C7][M][GAP] The cache has its own reader, ptcl_cache_read_batch (serial dstack_io, simple_ptcl_cache.f90:663-697), timed apart as rt_cache (simple_matcher_ptcl_io.f90:37, 105-108). The read-path policy says every pass reads through the session and that no particle cache exists (R1, R2). Section 3 should say that cache hits bypass the session and that the build itself reads the originals through it (reads%read, :616).
  • [C8][L][GAP] No tester for simple_ptcl_cache (key validity, adoption of a leftover, 25 % budget, uniform fallback, ownership cleanup); the contract of sections 4-8 is unguarded. Propose simple_ptcl_cache_tester in unit_core or a fast-gate case.
  • [C9][L][STRUCTURE] Section 10 "Future Extensions" is plan narrative (scavenger, benefit predicate, "consider defaulting cache=yes"); move to a planned note. Skill drift: simple-solve2d says the cleanup hook fires from simple_exception; the code (and this policy) say simple_error (simple_error.f90:44).

doc/policies/particle_read_path_policy.md (lines 102; last commit 2026-10-19; verdict: minor drift, two absolute claims wrong)

  • [R1][M][CONTRADICTS] L5-6: "No particle is rewritten into another file, and no cache of particles exists." vs particle_cache_policy.md (a disk cache of Fourier-cropped particles, simple_ptcl_cache.f90) and project_stack_indexing_policy.md L197-212 (consolidate_particles copies every active particle into one new stack, simple_commanders_project_ptcl.f90:798-910). Reword to "reading never rewrites ...; the 2D cache and consolidate_particles are separate, explicit products".
  • [R2][M][VIOLATED] L18-23 ("Every pass that reads particles reads them through one read session ... Nothing reads a particle by opening its stack on its own") and project_stack_indexing_policy.md L222. Readers outside the session: the cache reader (C7); exec_ctf_correct through read_imgbatch with the module-level stkio_r (simple_matcher_ptcl_io.f90:182-238, simple_commanders_imgproc.f90:64, 132); exec_write_classes (simple_commanders_mkcavgs.f90:847); cls_init=ptcl/tseries reference selection (simple_procimgstk.f90:825, 891, 947); project thumbnails (simple_sp_project_ptcl.f90:634). Scope the rule to the passes it names, list the exceptions, or route them through a one-shot session.
  • [R3][L][DRIFT] L21-22 "In the matchers the session is wrapped by ptcl_read_session": every pass kind uses the wrapper, including class sums (simple_classaverager_restore.f90:381), power spectra (simple_calc_pspec_strategy.f90:272), FLEX (simple_flex_pca_embed.f90:72, simple_flex_probe_fit_estep.f90:439), the offload reconstructor and single_commanders_experimental. The wrapper lives in strategies/search, so class/, volume/ and flex/ import a strategy-layer module. State it, or move the wrapper next to stack_read_session.
  • [R4][L][DRIFT] L31-33: a span bridges a gap of at most 2 MiB only while its over-read stays at most the bytes it needs, and within the per-stream cap SPAN_SCRATCH_CAP/(nstreams*image_bytes) (plan_spans, simple_stack_read_session.f90:605-606; span_cap :108).
  • [R5][L][DRIFT] L94-101: the bench context also reports "particle bytes advised" (simple_matcher_ptcl_io.f90:121).
  • [R6][L][DRIFT] L58: separate_alignment_and_reconstruction_for_multistate_peak_mem_reduction.md is named without its path (3D/), and that document restates the buffer and its budget (its table row and lines 74-78); the budget rule is stated in two policies.
  • [R7][L][GAP] Who resolves (stack file, image index) is only pointed at. State the owner in one line: sp_project%get_stkname_and_ind (simple_sp_project_stk.f90:749-765, wraps map_ptcl_ind2stk_ind), called per particle by ptcl_read_session (simple_matcher_ptcl_io.f90:318-320); the session itself only sees (name, index) pairs.
  • [R8][L][STRUCTURE] The code names the implementation note as "Policy" (simple_stack_read_session.f90:6, simple_matcher_ptcl_io.f90:54); point both at this document. The opening lacks a scope line and a "read before editing" pointer (the new doc/policies/README.md supplies the latter).

doc/policies/project_stack_indexing_policy.md (lines 294; last commit 2026-10-15; verdict: current for what it states; four contract gaps)

Spot checks that hold: map_ptcl_ind2stk_ind stops on missing nptcls_stk/indstk and range errors (simple_sp_project_ptcl.f90:60-83); prune_particles is metadata-only and drops a particle with its state-0 stack (:428-548); consolidate_particles sets indstk = project row and a common nptcls_stk (simple_commanders_project_ptcl.f90:891-903); fix_projfile behaves as L243-262 (simple_projfile_utils.f90:1275-1349); the merge rules of L114-142 hold for merge_selected_project_files.

  • [I1][M][VIOLATED] L222: "Every particle reader goes through the pass-scoped read session" (same exceptions as R2).
  • [I2][M][GAP] No list of who may write stk, nptcls_stk, fromp/top/nptcls, stkind, indstk. At least 15 independent sites compute them by hand: sp_project_stk (add_stk and the stack-table adders, :52-556), prune_particles, exec_prune_project (simple_commanders_project_ptcl.f90:766), consolidate_particles (:902), reimport_particles (:371-376), exec_... in simple_commanders_imgproc.f90:257, ptcl_subset, mic_subset, project_superset, merge_chunk_projfiles(_without_sigma2), merge_selected_project_files, extract and reextract (simple_extract_strategy.f90:401, simple_reextract_strategy.f90:343), refine_motion_model_strategy:291, the stream pool publication (simple_stream_refine2D_utils.f90:197, 371), solve2D_chunks, bootstrap_cavgs, STAR import (simple_starproject.f90:404), single_commanders_trajectory:417, and the path rewrite of update_project (doc/relocating_project_data.md, absolutize_project_stack_paths). Proposal: a "Writers" section listing the sanctioned ones and requiring stk, nptcls_stk, ranges, stkind and indstk to be set together (ideally by one helper), validated by the fix_projfile checks in a tester.
  • [I3][M][GAP] The (stack path, stkind, indstk) triple is an identity that others hash: ptcl_layout_digest ties the sigma2 state and the state weight set to it (src/main/project/simple_ptcl_layout.f90), the particle cache key folds path, range, nptcls_stk, size, mtime, stkind and indstk (simple_ptcl_cache.f90:265-302). Seven sites drop sigma2_state after a layout change (consolidate_particles:906, ptcl_subset:176, mic_subset:281, ...), while prune_particles does not (the digest rejects it later). Rule missing: any operation that changes those fields must invalidate dependents (drop sigma2_state, treat caches as stale).
  • [I4][M][GAP] Merge Policy covers merge_projects only. Two further mergers exist, merge_chunk_projfiles and merge_chunk_projfiles_without_sigma2 (simple_projfile_utils.f90:18, 323; callers simple_ptcl_sieve.f90:1325, 2317, stream and chunk code): they concatenate cls2D/out, renumber particle class (origclass/chunk keys), carry indstk through transfer_ori and run none of the nptcls_stk/indstk checks of L124-126. Say whether they are bound by the same contract (they should be), or name the difference.
  • [I5][L][GAP] Class averages as "particles": map_ptcl_ind2stk_ind('cls3D', ...) returns stack 1 and index = class, and get_stkname_and_ind takes the name from the out cavg stack (simple_sp_project_ptcl.f90:20-29, simple_sp_project_stk.f90:760-761); the initial analysis writes indstk on cls2D (simple_stream_stage_initial_analysis.f90:1686); the cache refuses cls3D. Not in the policy.
  • [I6][L][GAP] Stack rows also carry the half-set provenance markers (eo_group/eo_byindex, simple_eo_partition.f90:22), and ensure_field_halves writes stk, ptcl2D and ptcl3D inside the file when it labels (:65-76). Field Semantics lists neither; the only description is refine3D_policy.md section 5.
  • [I7][L][DRIFT] L216-218 names map_ptcl_ind2stk_ind; readers call get_stkname_and_ind, which adds the path. Name both.
  • [I8][L][STRUCTURE] Test Policy (L264-294) names no test. The guards exist: simple_project_merge_tester.f90 (pruned-style and earlier-release cases, :169, :242), simple_ptcl_subset_tester.f90, simple_eo_partition_tester.f90, all in unit_project; cite them.
  • [I9][L][GAP] Dead duplicate resolution on a hot path: cavger_transf_oridat calls map_ptcl_ind2stk_ind for every particle of every batch and stores precs(i)%ind_in_stk, which nothing reads (simple_classaverager_restore.f90:93, field simple_classaverager.f90:103). Remove; the session resolves again anyway.

doc/policies/KB_Interpolation_Policy.md (lines 113; last commit 2026-10-21; verdict: content current, form is a memorandum, not a policy)

Spot checks that hold: OSMPL_PAD_FAC = 2 (simple_defs.f90:95), pf^2 in simple_image_polar.f90:170 and simple_reconstructor.f90:1025, pf^3 in simple_projector.f90:198 and simple_projector_pft_batch.f90:133, plane storage on the native lattice (simple_type_defs.f90:93-94), and the 6a B-spline gather (gather_packed_bspline3_window_grad, ref_weight in set_ref, test_stencil_switch).

  • [K1][M][STRUCTURE] Not in policy form: title "Internal Technical Memorandum", "Subject/Purpose", no scope statement; section 8 "Summary of Policy Change" (L112-113) is history; the markdown is damaged by a conversion (F(x*pd) = Σ*{k_pd ∈ W}, escaped \[h,k,0\], 1\. headings); the file name is the only title-case one in doc/policies/. Rewrite as a policy: scope, rules, implementation map; drop section 8.
  • [K2][M][GAP] The constants and where they live are not stated: OSMPL_PAD_FAC = 2, KBALPHA = 2, KBWINSZ = 1.5 (half width; W = 2*Whalf, the "three taps"), beta from KB_BETA_KB15_A2 or pi*sqrt(W^2/alpha^2*(alpha-0.5)^2 - 0.8) (simple_defs.f90:94-98, simple_kbinterpol.f90:new). L25 "pf = 2 (current configuration)" does not name the compile-time constant that some twenty modules use; say whether changing it is supported.
  • [K3][M][GAP] Cropped class sums: sums at box_crop interpolate on box_croppd = 2*round2even(KBALPHA*box_crop/2) (simple_parameters_phases.f90:552, simple_classaverager_restore.f90:232-245), which spans the same physical extent as boxpd, so index h is the same frequency in both; sigma2 and PCG shells sit at OSMPL_PAD_FAC*n (simple_rec3D_pcg_strategy.f90:414-420). Section 6 ("Class Average Restoration", two sentences) states neither.
  • [K4][L][STRUCTURE] 6a cites plan identifiers, "O5 of the pose_cont refactoring" (L101) and "(E10)" (L103); E10 in that note is "gather equals interp_fcomp_oversamp" (pose_cont_refactoring.md:1095), not "interpolation errors". Cite the testers (simple_cartesian_fourier_tester.f90: test_fused_bspline3_gather_oracle, test_stencil_switch; simple_cartft_calc_tester.f90).
  • [K5][L][GAP] No implementation or test map: simple_kbinterpol.f90, simple_gridding.f90, simple_cartesian_fourier.f90, tests unit_numerics "Kaiser-Bessel kernel" and unit_cart_align3D "Cartesian Fourier" (named only in the skill).

doc/policies/fsc_area_score_policy.md (lines 205; last commit 2026-09-09; verdict: standalone part current, refinement part partly stale)

Spot checks that hold: Fibonacci axes, antipodal double cone, shell = nint(sqrt(h^2+k^2+l^2)) with DC skipped (simple_image_freq_anal.f90:303-368), wAuC with weight shell^2 and the crossing excluded, cFAR = min/max (simple_fsc.f90:556-679), outputs and plot names, min_count=1 (simple_commanders_resolest.f90:111-150), the 0.8 onset and the +2-shell start (phase_rand_fsc, simple_fsc.f90:60-113; ENVMSK_FSC_THRESH = 0.8).

  • [F1][M][STALE] L51-56 and L63-77 (and refine3D_policy.md 893-897): "envfsc=yes: the on-the-fly density envelope ... is applied to both half-maps before conical FSC and cFAR" holds for the gridding backend only. With rec_backend=pcg, evaluate_halfmap_pair builds the density mask solely to write automask3D_stateNN.mrc; the half maps are not masked, there is no phase randomization, and fscu/fsct/fscn_stateNN.bin are not written (l_phase_randomization = gridding .and. mask_kind /= none, simple_halfmap_diagnostics.f90:96-103; PCG call simple_rec3D_pcg_strategy.f90:86-95; refine3D_policy.md ~line 990: "PCG reports FSC on the constrained pair without post-hoc masking or phase randomization"). The automsk=nu mask path (lag-one NU envelope with density fallback, simple_volassemble_strategy.f90:745-770) and the rule that automsk=yes|nu implies envfsc=yes (simple_parameters_phases.f90:818-831) are missing. Fix: scope the paragraph to gridding and point to refine3D_policy.md section 9 and the NU policy for the masks, or add one sentence per backend.
  • [F2][L][STRUCTURE] L58 "since 2026-09-09" is dated history; the refinement-time masking text duplicates refine3D_policy.md 893-902 and NU/nonuniform_filtering_policy.md 141, 291. Keep the calculation here, the mask routing in one place.
  • [F3][L][GAP] Refinement uses fixed constants, not the program keys: CFAR_NDIRS = 256, CFAR_CONE_HALF_ANGLE_DEG = 20, CFAR_FSC_THRESHOLD = 0.143, CFAR_MIN_COUNT = 1 (simple_halfmap_diagnostics.f90:17-20). Also unstated: where the value goes (particle field cfar, slot 53, refine3D_policy.md 923; the RESOLUTION stats and GUI metadata).
  • [F4][L][GAP] No unit test of the numerics (conical_fsc, score_cfsc_curve, calc_fsc_area_score): rg finds cfar only in the ori and binoris record testers; the high-level suites use it as a floor (test_environment_policy.md 1150). Name the guard or add a tester.

Cross-cutting gaps in this cluster

  • X1 [H] Project-segment ownership for 2D has no home. The layering draft (section 5) states the general rules; solve2D_policy.md must carry the per-workflow table (S4), the write budget (S3) and the file handoffs of the stage controller (solve2D writes, child rebuilds from the file, solve2D rereads cls2D/out and writes only what it owns). The draft already notes the make_cavgs worker write; its "confirm before removing" should be settled (a worker only verifies the halves: ensure_field_halves returns early for l_distr_worker_glob, simple_eo_partition.f90:41-47; so the part-1 write persists what generate_cluster_centers and, for time series, partition_eo change in every worker's copy (remap_cls, expand_classes, ini_tseries, proj2class), which the assembler later reads from the file. That is the contract to write down, or to move to the master).
  • X2 [M] "Which stack file and index does a particle live at": the owner of the lookup is sp_project (map_ptcl_ind2stk_ind, get_stkname_and_ind), but the data are written by about fifteen independent routines and read by one session plus about five bypasses. Needed in project_stack_indexing_policy.md: a writers list (I2), the layout-identity rule (I3), the merger scope (I4), and the readers outside the session (R2). The three policies agree on the reader rule and on indstk semantics but each makes an absolute statement the code does not keep (R1, R2, C5).
  • X3 [M] Three-way consistency of read path, cache and indexing: the read path says no particle cache exists (R1), the cache policy has its own reader (C7), and the indexing policy says every reader uses the session (I1). One paragraph in the read-path policy listing "session readers" and "other readers" (cache hits, single-image utilities, consolidate_particles byte copy) fixes all three.
  • X4 [M] The carried class sums are described in three policies (solve2D_policy.md L436 and 494-513, importance_sampling_fractional_update_policy.md 195-210 and 412-426, the refactoring note 4.1) and by cavg_sums.f90's header, which points back at the solve2D policy. Pick one home; add the writer list and lifecycle (S7) there.
  • X5 [M] The predicates "blends carried sums" and "fresh start" (S6) are shared by the matcher, both masters and the stream; they belong in the sampling policy and are cited from solve2D.
  • X6 [M] ptcl_read_session sits in strategies/search/simple_matcher_ptcl_io.f90 but is imported by class/, volume/, flex/ and strategies/parallelization (R3): a domain-to-strategy import against layering_and_project_ownership_policy.md section 2. Move it beside stack_read_session (src/fileio) or declare it an exception.
  • X7 [L] Test pointers are missing in all seven documents except one file name (R-level). Map: stack I/O and spans unit_core "stack I/O"; carry-over unit_reconstruction; 2D table I/O unit_pftc_align2D3D; merge, half-sets, subsets unit_project; KB unit_numerics. No guard exists for the particle cache, cache==no-cache identity, cFAR numerics, or bootstrap.
  • X8 [L] Skills versus policy: simple-main-project ("a workflow that owns its project in memory writes it once per iteration") is contradicted by the distributed refine2D master (S3); simple-solve2d names simple_exception for the cache hook (code: simple_error); simple-solve2d and simple-main-class agree with the solve2D policy on the cropped sums and buckets.

Unverified

  • Numerical and bit-identity claims (cache==no cache byte for byte, restore parity between shared memory and distributed, "bit for bit" buffer records, (box/box_crop)^2 gains): need runs; I read the code paths only.
  • solve2D L438-481 (continuous in-plane: single all-angle evaluation, plus-minus two cells, acceptance guards, rounded probability artifacts): read the dispatch (simple_strategy2D_srch.f90:100-105, matcher :105, :198) but did not trace the optimizer.
  • solve2D L262-337: checked formats -4/-5, header words, entry sizes, dynamic schedules, atomic capture and bench names; did not trace the frontier assignment, the tie-handling statements or the "same unstable hpsort" claim.
  • solve2D L282-283 gen_likelihood_val_bank, memoize_shifted_ptcl, record_seed_shift internals (names exist).
  • particle_read_path "bit-exact" and prefetch counters under load; SIMPLE_IO_NSTREAMS per-device probe beyond the code read; Windows stubs.
  • Seed-restart bullet L136-176 beyond the commander's flow (reseed partition proportions, MINCLSPOPLIM value, lineage file columns).
  • fsc_area_score: Otsu/largest-component/cosine-edge density-envelope construction (automask3D with lp_override) not read.
  • KB policy section 1-5 formulas checked for names and scale factors only, not derived.