Report of the run atomic_density_model_2¶
The Dell, 26 to 27 October 2026. The second unattended run on the atomic density model of detect_atoms, the nanoparticle atom finder of SINGLE. Its code is now in ~/src/SIMPLE, uncommitted, on top of ad4432498 ("first draft nanoparticle rejection model"). This report reads on its own; the run's own, longer account is the second section of doc/implementation_notes/completed/atomic_density_model_report.md, and every number with its log path is in section 13 of doc/implementation_notes/completed/atomic_density_model.md.
What the run was for and what it delivered¶
Three things were asked of it. First, the transfer of a map, the band-pass the reconstruction leaves on every atom (the images carry no signal coarser than 5 Å, so each atom's low frequencies are missing and it sits in a negative well), was to be measured from the map itself as a curve over resolution, instead of being fitted as a two-number Gaussian notch, which hit its cap on 14 of the 66 maps in the first run. Second, element was to leave detect_atoms, so that detection is species-free for every project. Third, the species call was to move into a program of its own, detect_atomic_species, built on the fitted intensities and widths with an error on every call.
All three are delivered and tested. On the 66 experimental platinum maps the fit to the map is better than the first run's on every single map, with a quarter of the residual peaks; detection takes no element anywhere; detect_atomic_species finds one species on all 66 maps when left free and refuses a forced platinum-nickel split on all 66, and on the synthetic two-element particles it calls every atom right with no uncertain call. The nanoparticle refinement test single_workflow_fcc, which failed at the start of the run, passes at the end at 3.58 Å against a floor of 5.00 Å. The price is time: detect_atoms takes 8.8 s per map at 24 threads on the Dell, where the first run took 7.0 s, because the transfer is now measured in rounds.
What is in your tree now, and what to run¶
The complete diff of the run (result/full.diff, 667 kB, against the run's base 1a12472e2) was merged onto ad4432498, which is 22 commits later. Eleven files had been changed on master in between (the parameters files by you, Cyril and Mazharul; the image module by Cyril and you; the test registry files by you, Ruben and Mazharul; the PCG strategy by you and Mazharul); nine merged without a conflict and two needed a hand: simple_commanders_test_class.f90, where Ruben's sharpvol tester and the run's density tester were added on the same line (both kept), and doc/policies/test_environment_policy.md, where two claim paragraphs were reworded on both sides (the run's wording kept). The merged change is 32 modified files and 4 new ones, 3,411 lines added and 1,458 removed; the added and removed lines are identical to the run's diff, line for line. The two pure-Python gates pass on the merged tree (check_test_registry.py: 37 selectors, 47 programs, 47 router cases, consistent; check_descr.py: clean). Nothing is staged and nothing is committed. result/full_rebased_on_ad4432498.diff is the merged change as a diff against your HEAD, if you prefer to read it that way.
The three new source files (simple_nano_density.f90, its tester, simple_atomic_species.f90, all under src/main/nano/) are collected by a plain file(GLOB_RECURSE ...) in src/CMakeLists.txt, so CMake has to be re-run in build/ before make sees them. After the build, the checks the run itself used are the fast gate (scripts/run_fast_gate.sh build, 15 entries, which includes unit_single with its density and species sub-suites), then the five CTest entries single_atoms_stats, its three CdSe variants and species_discovery, then single_workflow_fcc and single_workflow_wurtzite (about 12 and 9 minutes). The run did all of that on the Dell and all of it passes there; the Mac has only to build and pass the checks.
The visible changes for a user. detect_atoms takes no element and refuses element, discover_species, nspecies, vol_even and vol_odd with a message naming the two programs that take them (atoms_stats for the lattice analyses, detect_atomic_species for the species call); discover_species is no longer a key at all. _model.txt has lost a and B_h and gained the transfer's bookkeeping (transfer_rounds, transfer_round, transfer_rounds_capped, the gauge, and contact_ceiling); the curve itself is in a new product, _transfer.tsv, with the curve the fit used and the one re-measured on the final model side by side. detect_atomic_species is run after detect_atoms as single_exec prg=detect_atomic_species vol1=<map> pdbfile=<name>_ATMS.pdb smpd=<smpd>, with element=Pt,Ni (brightest first) or nspecies= to force a class count and vol_even=/vol_odd= for the half-map label agreement; it writes the _species files as before with two more columns per atom, the posterior's standard error and the coordination spread. autorefine3D_nano takes no element and its atomicity prior now holds the model's positions and per-atom widths with free amplitudes (the fourth ruling). conv_atom_denoise has lost element too.
How the run went¶
The run took seven restarts to finish. Three of the stops were the kind the run is designed for: the session reached a point where the plan's floors could not be met without a decision, wrote a status, and stopped. Four were harness stops that cost nothing but time: an index left staged by a git add before launch, and three times the file fence refusing a phase because a reopened phase's snapshot did not match the tree (when phase 6 was reopened after phases 7 and 8 had run, every later phase's snapshot had to be reset by hand, and I did not do it the first two times). Those are recorded against the harness, not the work.
| when | what |
|---|---|
| 26 Oct 02:00 to 08:17 | Phase 5, the baseline. Stopped once (single_workflow_fcc failing its floor, and an index left staged before launch); done after ruling 4. |
| 26 Oct 08:17 to 09:33 | Phase 6 built the measured transfer and stopped: the measurement had an exact degeneracy and its alternation with the fit did not settle on 22 maps and ran away on 2 and on FePt. |
| 26 Oct 23:10 to 23:29 | Phase 6 under ruling 5 (one measurement, fixed gauge): ended with bad misses on the synthetic particles. |
| 26 Oct 23:29 to 00:16 | Phases 7 (done) and 8 (stopped on two test checks). |
| 27 Oct 07:17 to 11:03 | Phase 6 reopened under rulings 6 and 7: two short stops (the residual-based stop rule, then the fence), then done. |
| 27 Oct 11:03 to 11:08 | Phase 8 confirmed done; the fence stopped it on the stale snapshot. |
| 27 Oct 18:49 to 19:15 | Phases 8 and 9 done; all phases done. |
The decisions I made on your behalf, so that you can revisit them. Ruling 4 (phase 5): the refinement loop's atomicity prior takes free amplitudes per atom, with the positions and per-atom widths from the model; the one-free-scale form of Ruben's commit stays available to reconstruct3D when a species-posterior table is given. Ruling 5 (after the first phase-6 stop): the gauge that fixes what a map alone cannot (the curve's scale and its Gaussian tilt are set to unity over 3.1 to 2.0 Å, where your pooled 66-map curve is unity), the floors on the synthetic particles with the transfer measured (intensity scale and width within 5 percent, curve within 0.06, the gradient particle's fade within 0.01), and, at your instruction, everything per map with no shared or pooled curve. Ruling 5 also said to measure the curve exactly once and never feed it back; that was my mistake. The fit without any curve gives biased atoms, a curve measured from biased atoms is biased, and one fit through it keeps the bias: the synthetic particles came out 20 percent dim with a false fade of 0.04 per neighbour, the size of the effect the species call reads. Ruling 6 reopened phase 6 for rounds of measure-and-refit, first with a fixed count (withdrawn when you objected that a constant tuned on today's maps would not survive a change in their character), then stopped by the residual, which turned out to be flat at its noise from the second round on and could not say when to stop. Ruling 7 is the form that stands: the rounds stop when the curve itself changes by 0.01 or less between rounds, at most six rounds as a safety limit, the last round kept unless its residual is more than a tenth of a percent above the best round's (the guard that holds the runaways), the measurement taken from the model as fitted, and nothing in it a stop. Ruling 6 also settled phase 8's two checks: the posterior keeps the plan's shared coordination spread (the variant without it passed by being overconfident, which is what the error estimate exists to prevent), the element check becomes "no confident call is wrong" with the atoms below a posterior of 0.9 counted and listed as uncertain, and the soft-probability floor scales with the class gap.
What was built¶
The transfer. For one map, after a provisional fit of the atoms as plain Gaussians and the recovery of the weak atoms, the curve is measured as the shell-wise least-squares ratio of the map to the rendered atoms, in shells of 1/50 Å⁻¹, smoothed by a running median of three shells, held where the atoms carry less than 1 percent of their peak power, and put in the gauge. The halo the curve gives each atom is tabulated as a radial transform on the fit's width grid and rendered by one FFT per colour class of the parallel sweep. The atoms are refitted with the curve held fixed, and the measurement is repeated from the new model until the curve stops changing. On the uniform synthetic particle that takes five rounds and lands within 2 percent of the true intensity scale, at 27.5 Ų against a true width of 28 and a fade of 0.0509 per neighbour against 0.05; the gradient particle reaches the six-round limit and is within every floor there. The FFT threads are capped at 16 on the Dell, where the system FFTW is slow above that.
Species-free detection. Every detection path uses the same pseudo-atom template and length scales measured from the map. The contact ceiling of the pruning step, which the lattice table gave as 12 for every element, now comes from the data as the median contact score of the inner 30 percent of the atoms: 12 on platinum, 4 on the wurtzite and zincblende CdSe test particles, 6 on rocksalt, their true coordinations. The four single_atoms_stats entries keep every floor and their position errors shrink slightly (0.012 Å against 0.015), because detection no longer uses an element kernel as its template. On 14 of the 66 real maps, the small ESC5, ESC3 and FCHCS1 particles, the ceiling comes out below 12, the pruning keeps 2 to 21 more surface atoms each (135 in all), and the fit improves on all 14.
detect_atomic_species. A new domain module and program. The class fit is multiplicative, ln I = ln S_k + beta (c − 12), one slope beta per particle shared by the classes, where c is the coordination number. Each atom gets a posterior per class with a standard error by the delta method, and the coordination spread is measured within the classes per coordination bin (the spread detect_atoms writes is fitted under one species and holds the species' separation on a two-element particle, which made every two-class call inadmissible until this was changed). A two-class fit is admissible when its classes are at least three noise widths apart and each holds enough atoms.
The evidence¶
The 66 platinum maps, run one at a time at 24 threads on the Dell. Phase 5 is the run's own baseline (the first run's code, 7.0 s per map); the single curve is ruling 5's form; the alternation is the first form, on the 44 maps where it settled.
| measure | rounds (final) | single curve | alternation, 44 maps | phase 5 |
|---|---|---|---|---|
| residual over noise, median | 1.284 | 1.306 | 1.325 (rounds: 1.282) | 1.537 |
| residual peaks per map, median | 16 | 18 | — | 59 |
| interstitial wells within 10 % of the model | 39 of 66 | 37 | 39 | 9 |
| correlation of the full model with the map | 0.840 | 0.833 | — | 0.783 |
| wall time per map | 8.8 s | 3.8 s | — | 7.0 s |
The residual over noise is lower than phase 5 on all 66 maps and lower than the single curve on 63, higher by more than 1 percent on none. The two maps on which the alternation ran away (residuals 8.0 and 6.1) now give 1.19 and 1.48. The atoms' widths are free of the resolution cutoff and now fall from 38 to 40 Ų at 4 to 5 neighbours to 31.9 Ų at 12, where phase 5 was flat at 36 to 38. The measured curves look like the reconstruction's band-pass: median 0.22 at 50 to 6.2 Å, 0.20 at 6.2 to 3.3 Å, 0.905 at 3.3 to 2.0 Å, 0.30 at 1.9 to 1.6 Å; the edge where a curve rises through one half has a median of 3.33 Å over the maps and sits near 5 Å on four particles, and within a particle's time points it moves by 0.94 Å while the 3.3 to 2.0 Å band varies by only 0.07. FePt (Miao's tomogram) keeps round 2 of 6: residual 0.955 against 0.963 in phase 5, model correlation 0.739 against 0.709.
Species on the real maps. With the class count free, detect_atomic_species finds one class on all 66 maps. With element=Pt,Ni forced, the two-class fit is inadmissible on all 66 (the species work's open note asked for at least 95 percent; the four maps that accepted the split in that work refuse it now). Nine forced fits put atoms in both classes, and there the calls are mostly uncertain, as they should be: EFC4_time18s has 266 of 304 atoms below a posterior of 0.9, FCHCS1_time02s 185 of 246. On FePt the forced platinum-iron fit is inadmissible, and the comparison with Miao's model is not a test of the class call, because species-free detection finds 60 percent of his platinum and none of his 6,569 iron atoms.
The tests. The density sub-suite passes 70 of 70 at 11 and 24 threads (twice at 24) with identical prints, and 69 of 69 at one thread; the species sub-suite 70 of 70 at 1, 11 and 24 threads; the fast gate 15 of 15; the five CTest entries pass, with species_discovery's density cases at a fade error of 0.0003 and 0.0038 (floors 0.005 and 0.01) and every two-species run at 0 wrong and 0 uncertain calls, recall 1.00, no false atom, half-map label agreement 1.00, the fitted Ni/Pt intensity ratio 0.560 where a single atom's is 0.561. single_workflow_fcc passes at an FSC-0.143 resolution against the truth of 3.58 Å (floor 5.00; 5.73 at the start of the run, 4.41 at the run's base commit without the model); single_workflow_wurtzite passes at 2.49 Å, within its recorded spread.
What to look at when reviewing¶
The gauge is a convention, and it is written into the products: S and B_p in _model.txt are numbers in it (across the maps B_p runs from 1.1 to 93 Ų), while occupancy I/S, the fade beta and B by coordination, which the species call uses, are gauge-free. The rounds oscillate on many real maps: the six-round limit is reached on 31 of 66 and the guard keeps an earlier round than the last on 40, so a curve measured from the fitted model is not a fixed point there, even though the kept round fits better than any alternative we have. The time per map doubled against the single curve. The species_discovery test was changed under ruling 6 in two places (the element check and the soft-probability floor); both changes are reasoned in the test's comments and are worth a look, because a test that was loosened to pass is the thing to be suspicious of, and I believe these were corrected rather than loosened. The products' band-pass filters are single-threaded on purpose, for identical results at any thread count.
Open decisions¶
Whether to damp the rounds (a damped update, or the product of the first two measurements) where the curve oscillates; the plan's per-map rule leaves sharing a curve among a particle's time points out without a new ruling. EFC2_time10s keeps the profiles of its provisional fit, because after the first measurement its atoms are about five intensity-noise units bright, below the strong-atom threshold of ten. The posterior's standard error is linearised and exceeds 1 on two forced fits where the posterior sits near one half; a bounded form in the log-odds would read better. An inadmissible forced fit still writes its labels (on FePt it names 8,730 platinum atoms iron while _species.txt says the fit is inadmissible); whether the program should refuse to label or fall back to one class is a product decision. FePt's iron is a detection question before it is a species question. The species work's planted-class validation has not been run with the new program. The first run's open items stand untouched: the size rule and the strong-only pruning of weak surface atoms, the missing atoms at the particle's edge, and the mask factor.