Repository navigation
refactor(csp-batch): name the flags of the driver for what they mean - #139
Merged
elijahmathews merged 2 commits intoNov 19, 2026
Merged
Conversation
… a glossary of them and of its arrays in the tour imf -> use_operators, zimf -> operators_per_z, zw -> weights_over_z, zmode -> blend_z, naf -> n_afe_planes, zvar -> z_varies, given_w -> weights_given, host_w -> weights_on_host, host_m -> sums_on_host, in opensps_csp_batch.f90 only (223 occurrences; lines that grew past 132 columns reflowed). No change in the code: CPU with -fno-tree-vectorize (forward and gradient dumps) and 45 forward dumps on the R9700 are bit-identical. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MXDRCs7ATQiqhT6RLPLXR5
# Conflicts: # src/physics/opensps_csp_batch.f90
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (77.06%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## feat/hotpath-nebular-survey #139 +/- ##
==============================================================
Coverage ? 74.93%
==============================================================
Files ? 51
Lines ? 14481
Branches ? 6089
==============================================================
Hits ? 10852
Misses ? 1482
Partials ? 2147 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
elijahmathews
marked this pull request as ready for review
November 19, 2026 16:55
elijahmathews
added a commit
that referenced
this pull request
Nov 19, 2026
…s of a batch (#140) Stack: after #139. Merge order: ..., #138, #139, this. A move of procedures within one file; no procedure changed. ## What changes The procedures of `opensps_csp_batch.f90` were in the order in which they were written, with the forward stages, their helpers and the reverse pass interleaved. They now follow the stages of a batch, in the order in which `compute_csp_batch` runs them: - the driver, then stage 0 (checks and plan), 1 (per-model setup), 2 (SFH weights), 3 (age sums, mass and L_bol, the slab blend and kernels), 4 (nebular emission), 5 (dust attenuation), 6 (dust emission, IGM, AGN), 7 (smoothing), 8 (outputs), and 9 (the reverse pass, the largest section), - a banner for each, and a table of contents after `contains`, so that the file reads as the hot path from top to bottom (search for `Stage 3:` to jump to the age sums). How it was done, and why it is safe: a small tool segmented the file into 84 units (a procedure with its doc comment, any preprocessor wrapper around it, and the `#define`/`#include`/`#undef` block after it, for the template instances) and moved each whole. A mechanical check showed that the new file holds exactly the lines of the old one plus the 45 banner and table-of-contents lines: nothing lost, nothing duplicated. A split into several modules was considered and not done: the routines call each other across the stages (the reverse pass reuses the forward helpers; the types and constants are shared), so the pieces would need a common module under them and a long chain of `use` lines, for little more than the order already gives. `doc/HOT_PATH_TOUR.md` and `doc/HOT_PATHS_PLAN.md` say so. ## Verification - CPU, both trees built with `-fno-tree-vectorize` (see #134): forward dumps 6 of 6 and gradient dumps 6 of 6 bit for bit. - R9700 (both trees rebuilt from scratch, `csp_batch.f90` in both compile logs): 45 forward dumps, 0 differ bit for bit. - Host FP64 and FP32 suites, the six device tests and the nvfortran 26.1 compile pass. 🤖 Generated with [Claude Code](https://claude.ai/code) https://claude.ai/code/session_01MXDRCs7ATQiqhT6RLPLXR5 Co-authored-by: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack: after #138. Merge order: ..., #137, #138, this. A rename, bit-identical.
What changes
The flags of
compute_csp_batchhad names that did not say what they mean (imfis "the SSPs come from the operators", not anything about the IMF itself;zw,zmode,naf...). Inopensps_csp_batch.f90(the routines of the driver and the stage routines that receive them):imfuse_operatorsssp_opsgiven)zimfoperators_per_zzwweights_over_zssp_weights_z)zmodeblend_zlogzsolnafn_afe_planeszvarz_variesigm_factordiffer among the modelsgiven_wweights_givenhost_wweights_on_hosthost_msums_on_host223 occurrences; word-boundary replacement in this one file (checked: the new names were unused, no keyword arguments or other modules use the old names), 15 code lines and 9 comment blocks that grew past 132 columns reflowed (the comment blocks as whole paragraphs).
doc/HOT_PATH_TOUR.mdgets a table of the flags and one of the driver's main arrays (weights,w2,yo,total,absorbed,tdiff,eml,msum..., the packedipk/rpk/lpk/routand the names that view into them), and the plan the new names.Verification
-fno-tree-vectorize(see refactor(csp-batch): the host-only blocks of the driver as routines (step 4, first part) #134): forward dumps 6 of 6 and gradient dumps 6 of 6 bit for bit.csp_batch.f90in both compile logs): 45 forward dumps, 0 differ bit for bit.🤖 Generated with Claude Code
https://claude.ai/code/session_01MXDRCs7ATQiqhT6RLPLXR5