Repository navigation
refactor(csp-batch): arrange the procedures in the order of the stages of a batch - #140
Merged
Merged
Conversation
…in the order of the stages of a batch The driver first, then stages 0 - 9 (checks and plan, per-model setup, SFH weights, age sums, nebular, attenuation, dust emission/IGM/AGN, smoothing, outputs, the reverse pass), each with a banner, and a table of contents after contains. No procedure changed: a tool segmented the file into 84 units (a procedure with its doc comment, preprocessor wrapper and include block) and moved them whole; the new file holds exactly the old lines plus 45 banner and table-of-contents lines. Bit-identical: CPU with -fno-tree-vectorize (forward and gradient dumps) and 45 forward dumps on the R9700. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MXDRCs7ATQiqhT6RLPLXR5
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/hotpath-flag-names #140 +/- ##
========================================================
Coverage 74.93% 74.93%
========================================================
Files 51 51
Lines 14481 14481
Branches 6089 6089
========================================================
Hits 10852 10852
Misses 1482 1482
Partials 2147 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
Stack: after #140. Comment-only change in `opensps_csp_batch.f90` (the code is untouched; it builds). A survey of the procedures of the file for doc comments found 15 with fewer than two comment lines before them; most are small routines with an adequate one-line doc. The two real gaps are filled: - `nebular_kernels` (389 lines, formerly one comment line): the doc lists its five numbered steps (the ionizing photons Q of the young spectra, the EUV rows with the escaping fraction, the continuum as a sum over the nebular ages with the large factors scaled out, the line luminosities, the line profiles) and what `grid` selects (cue does steps 3 - 5 itself). - `age_sums_z4` (no comment): what the four slabs are, how the weights are formed, which template instance it calls. - `batch_backward`: the doc gets the stages of the reverse pass in order (magnitudes -> band fluxes, the observed frame, smoothing, AGN, dust emission, dust attenuation, the lines outside the spectrum, nebular emission, the age sums), the mirror of the stage index of the forward driver. 🤖 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 #139. Merge order: ..., #138, #139, this. A move of procedures within one file; no procedure changed.
What changes
The procedures of
opensps_csp_batch.f90were 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 whichcompute_csp_batchruns them:contains, so that the file reads as the hot path from top to bottom (search forStage 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/#undefblock 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
uselines, for little more than the order already gives.doc/HOT_PATH_TOUR.mdanddoc/HOT_PATHS_PLAN.mdsay so.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