[codex] Optimize profile sigma and dense radiance storage#83
Conversation
Add a structural README for src/input describing the Scene type, the two build paths (defaultScene, parseSceneJson), and validation. Replace the remaining 'case' naming residue in the input modules with 'scene' to match the renamed domain object, keeping comment-banner alignment.
Add a structural README for src/setup explaining what the stage computes: the vertical layer grid, gas absorption inputs, scattering tables, and the solar/instrument tables, grouped by the role each plays in the forward model. Replace the remaining 'case' naming residue in the setup modules with 'scene', keeping comment-banner alignment.
… me throw my desktop out of the window
Reword the loose 'transport solver'/'each solve' prose to name the radiative transfer or rtm/ directly, leaving the genuine rtm/solve.zig filename and the real linear-algebra solves elsewhere untouched. Also remove a stray </content> tag left at the end of the file.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f58874b. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f58874bc57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fa91c273f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Summary
[]f64total-sigma column.[]f64plus optional Jacobian vectors so no-Jacobian gathers read only radiance data.Validation
zig build test-fastzig build testuv run scripts/linting/check-zig-styleguide.py ...uv run benchmark/run_benchmark_fast.pyprek run --all-filesFast benchmark residuals were unchanged versus the parent baseline; timing moved within canary noise on the forward paths.
Note
Medium Risk
Changes core session-cache invalidation and dense radiance/Jacobian memory layout on every forward and OE iteration; incorrect reuse or indexing would show up as subtle spectroscopy or Jacobian errors rather than obvious crashes.
Overview
Session cache and forward hot path: Profile-line reuse stamps no longer hash full
LayerGridsupport placement, so retrieval iterations that only change aerosol pressure can keep reusing spectroscopy rows instead of invalidating the cache. Support-profile line sigma is stored as a wavelength-major[]f64total column instead of 64-byteProfileSupportLineValuerows, and dense radiance prefetch is split into[]f64radiance plus optional Jacobian vectors so no-Jacobian gathers avoid loading Jacobian-sized structs.Python/Zig input boundary: The packaged O2 A reference scene is defined in Python (
default_o2a_scene()/o2a_default.py); Zig drops built-in default scene rendering and the C exportszds_prepare_default_o2aandzds_default_o2a_input_json. Native JSON encoding maps inertNaNtonullvianative_json_value; route constants like stream count live injson.ziginstead of a Zig defaults module.Tooling and docs (secondary):
./verifyis documented as canonical CI; pytest markers and dev deps are added; wheel smoke scripts point attest_wheel_install_smoke.py; cost-timing Zig target is renamed tocost-timing-forward-analysis. Retained benchmark and performance README numbers are refreshed.Reviewed by Cursor Bugbot for commit f256914. Bugbot is set up for automated code reviews on this repo. Configure here.