Skip to content

WB01-WB04: refactor forward DOD views#81

Draft
bout3fiddy wants to merge 114 commits into
codex/instrument-grid-comment-qualityfrom
codex/dod-wb01-forward-sample-views
Draft

WB01-WB04: refactor forward DOD views#81
bout3fiddy wants to merge 114 commits into
codex/instrument-grid-comment-qualityfrom
codex/dod-wb01-forward-sample-views

Conversation

@bout3fiddy

Copy link
Copy Markdown
Owner

Summary

  • add borrowed ForwardSampleRequest and ForwardInputScratch views for high-resolution forward samples
  • route configuredForwardInput and computeForwardSampleAtWavelengthWithScratch through named request/scratch data instead of long broad parameter lists
  • keep worker-owned scratch allocation and LABOS workspace ownership unchanged

DOD friction score

  • WB01 before: 351
  • WB01 after: 222
  • configuredForwardInput: 52 -> 0
  • computeForwardSampleAtWavelengthWithScratch: 54 -> 0
  • integratedSampleFromForward: 16 -> 0

Verification

  • zig fmt src/forward_model/instrument_grid/grid_calculation/forward_input.zig src/forward_model/instrument_grid/grid_calculation/spectral_forward.zig
  • zig test forward_input_layout_check.zig (temporary scratch assertion; removed after pass)
  • zig build check
  • zig build test-fast
  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/instrument_grid/grid_calculation/forward_input.zig src/forward_model/instrument_grid/grid_calculation/spectral_forward.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/instrument_grid/grid_calculation/forward_input.zig src/forward_model/instrument_grid/grid_calculation/spectral_forward.zig
  • uv run benchmark/run_benchmark_fast.py

Parent sync

Merged latest origin/codex/instrument-grid-comment-quality during the package and re-ran the focused gates after the final merge.

@bout3fiddy

Copy link
Copy Markdown
Owner Author

WB02 update: Product Simulation Workspace And Plan Boundary

What changed:

  • Added narrow borrowed request/output views for radiance sampling and irradiance sampling in simulate.zig.
  • Kept simulateInternal as the broad product orchestrator, but stopped passing full Storage.Buffers and broad setup pieces into the sample-fill helpers.
  • Added styleguide-compatible layout(64-bit) boxes for the new view structs.
  • Merged latest parent draft branch codex/instrument-grid-comment-quality before final gates.

Friction score:

  • WB02 current score: 814.
  • simulateInternal: 63.
  • fillRadianceSamples: 18.
  • fillIrradianceSamples: no longer appears in WB02 top scored items after this package.

Evidence:

  • Temporary same-file layout assertions passed through zig build test-unit, then were removed to preserve the no-inline-src-tests rule.
  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/instrument_grid/grid_calculation/simulate.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/instrument_grid/grid_calculation/simulate.zig
  • git diff --check
  • zig build check
  • zig build test-fast
  • uv run benchmark/run_benchmark_fast.py

Commit: 9c5df26 Refactor simulation sample views

@bout3fiddy bout3fiddy changed the title WB01: refactor forward sample input views WB01/WB02: refactor instrument-grid DOD views Jun 9, 2026
@bout3fiddy

Copy link
Copy Markdown
Owner Author

WB03 update: Wavelength Sampling And Forward-Miss Tables

What changed:

  • Added WavelengthSamplingRequest, WavelengthSamplingOutput, and WavelengthSamplingRange as stack-only borrowed views in wavelength_sampling.zig.
  • Replaced the broad/long fillWavelengthSamplingPlans, fillWavelengthSamplingPlanRange, and buildWavelengthSamplingPlan signatures with request/output/range flow.
  • Reduced WavelengthSamplingWorker from 176 B to 72 B by storing a pointer to the shared request plus the output view.
  • Kept table ownership and allocation policy unchanged: OwnedWavelengthSampling still owns rows and side arrays; KernelStorageBuilder still owns temporary side arrays until transfer.
  • Merged latest parent draft branch codex/instrument-grid-comment-quality before final gates.

Friction score:

  • WB03: 264 -> 184.
  • Broad owner params: 4 -> 0.
  • Parameter overage: 18 -> 0.
  • Broad forwarding edges: 12 -> 2.

Evidence:

  • Temporary same-file layout assertions passed through zig build test-unit, then were removed to preserve the no-inline-src-tests rule.
  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/instrument_grid/grid_calculation/wavelength_sampling.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/instrument_grid/grid_calculation/wavelength_sampling.zig
  • git diff --check
  • zig build check
  • zig build test-fast
  • uv run benchmark/run_benchmark_fast.py

Commit: 9b90e78 Refactor wavelength sampling plan views

@bout3fiddy bout3fiddy changed the title WB01/WB02: refactor instrument-grid DOD views WB01-WB03: refactor instrument-grid DOD views Jun 9, 2026
@bout3fiddy bout3fiddy changed the title WB01-WB03: refactor instrument-grid DOD views WB01-WB04: refactor forward DOD views Jun 9, 2026
@bout3fiddy

Copy link
Copy Markdown
Owner Author

WB04 update: refactored the layer accumulation leaf family in src/forward_model/optical_properties/state_build/layer_accumulation.zig.

What changed:

  • Added LayerAccumulationRequest as the borrowed view for Context, absorber build state, spectroscopy cache, collision cache, and aerosol sublayers.
  • Added SublayerTarget for the row indexes/thickness passed into populateSublayer.
  • Reduced ParitySupportRowWorker layout from 272 B to 184 B by borrowing the request view instead of carrying the broad setup fields in every worker row.
  • Removed the hidden profileScatteringAtMidpoint helper so profileEquivalentPhaseCoefficients visibly reads the aerosol-row fields consumed by the loop.

Audit signal:

  • WB04 friction score: 1169 -> 1095.
  • populateSublayer item score: 59 -> 19.
  • DOD layout advisory for layer_accumulation.zig: 0 findings.

Verification:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/layer_accumulation.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/layer_accumulation.zig
  • git diff --check
  • zig build check
  • zig build test-fast
  • uv run benchmark/run_benchmark_fast.py

Parent branch sync:

  • Merged latest codex/instrument-grid-comment-quality before final gates.

Commit: 7a5e4a2

@bout3fiddy

Copy link
Copy Markdown
Owner Author

WB04 update: refactored the support-row scalar cache-miss boundary in src/forward_model/optical_properties/state_build/carrier_eval.zig.

What changed:

  • Added SupportRowScalarRequest as the borrowed row view for prepared optical state, sublayer, spectroscopy cache, strong-line state, wavelength, and support-row index.
  • Added SupportRowWavelengthConstants for the wavelength-local scalar constants passed through cache-miss filling.
  • Replaced the 11-argument fillSharedOpticalScalarsAtSupportRowWithScalarCache boundary with fillSharedOpticalScalarsAtSupportRow(out, row, wavelength_constants).
  • Kept ownership unchanged: SupportRowScalarCache still owns epoch/scalar arrays; the new request and constants structs borrow stack/cache state only.
  • The new request keeps the 256 B PreparedSublayer out-of-line via pointer.

Audit signal:

  • WB04 friction score: 1095 -> 1017.
  • Previous P0 filler item is now classified as no-refactor-needed: params=3, broad=0, alloc_calls=0.
  • DOD layout advisory for carrier_eval.zig: 0 findings.

Verification:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/carrier_eval.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/carrier_eval.zig
  • git diff --check
  • zig build check
  • zig build test-fast
  • uv run benchmark/run_benchmark_fast.py

Parent branch sync:

  • Merged latest codex/instrument-grid-comment-quality before final gates.

Commit: 70902ad

@bout3fiddy

Copy link
Copy Markdown
Owner Author

Profile spectroscopy cache update: refactored the profile-cache value fill boundary in src/forward_model/optical_properties/state_build/layer_spectroscopy.zig.

What changed:

  • Added ProfileCacheValueRequest as the borrowed view for the line list, profile thermodynamic context, prepared strong/weak states, wavelength, and prepared wavelength window.
  • Reduced ProfileCacheValueWorker from 288 B to 32 B by borrowing that request instead of copying the 208 B line list and profile inputs into every worker row.
  • Narrowed fillProfileSpectroscopyCacheValueRange from the long positional input list to (cache, request, start, end).
  • Kept allocation and ownership unchanged: profile-cache arrays remain inline in ProfileSpectroscopyCache, and context/prepared-state/window storage is borrowed from the cache init call.

Audit signal:

  • WB04 friction score: 1017 -> 1000 after regeneration.
  • fillProfileSpectroscopyCacheValueRange is now classified as no-refactor-needed: params=4, broad=0, alloc_calls=0.
  • DOD layout advisory for layer_spectroscopy.zig: 0 findings.

Verification:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/layer_spectroscopy.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/layer_spectroscopy.zig
  • git diff --check
  • zig build check
  • zig build test-fast
  • uv run benchmark/run_benchmark_fast.py

Parent branch sync:

  • Merged latest codex/instrument-grid-comment-quality before final gates.

Commit: a513716

@bout3fiddy

Copy link
Copy Markdown
Owner Author

Package update: profile line-state views

Commit: 8be11b5e (Refactor profile line-state views), followed by parent sync merge d84322fa.

What changed:

  • Added ProfileLineStateRequest for the profile line-state inputs shared by workers.
  • Reduced ProfileLineStateWorker from the old wide per-worker row to a narrow borrowed row: request pointer, per-worker relaxation scratch slice, queue pointer, worker index.
  • Narrowed fillProfileLineStateRange from the old 8-argument hot helper to (request, strong_relaxation_weights, start, end).
  • Ownership stayed unchanged: profile arrays and state arrays are borrowed from prepareProfileLineStates; line-list storage ownership remains outside the request; strong relaxation scratch remains caller-owned/per-worker.

Audit signal after regeneration:

  • F0409 fillProfileLineStateRange: now no-refactor-needed, params=4, broad=0, alloc_calls=0, body_lines=24.
  • ProfileLineStateRequest: no structural refactor required, fields=5, slices=4, pointers=0.
  • ProfileLineStateWorker: no structural refactor required, fields=4, slices=1, pointers=2.
  • Bundle totals remain broad: WB04 998, WB05 1066; this item-level cleanup is visible even though the generator groups adjacent optical-preparation findings coarsely.

Verification:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/absorbers.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/absorbers.zig
  • git diff --check
  • zig build check
  • zig build test-fast
  • uv run benchmark/run_benchmark_fast.py

Parent sync:

  • Merged latest origin/codex/instrument-grid-comment-quality before pushing; latest merged parent commit was 8abffef6 (Clarify instrument reference headers).

@bout3fiddy

Copy link
Copy Markdown
Owner Author

Package update: carrier boundary row views

Commit: a43a482a (Refactor carrier boundary row views), followed by parent sync merge 17450e69.

What changed:

  • Added SourceInterfaceBoundaryRequest for the gas/particle/phase fields used to write one source-interface row.
  • Added RtmQuadratureBoundaryRequest for the gas/particle/level fields used to write one RTM quadrature level.
  • Narrowed private hot helpers:
    • fillSourceInterfaceFromBoundaryParts(...) -> fillSourceInterfaceFromBoundaryParts(request)
    • fillRtmQuadratureLevelFromBoundaryParts(...) -> fillRtmQuadratureLevelFromBoundaryParts(request)
  • Removed broad PreparedOpticalState from the source-interface leaf helper; it now borrows only aerosol_phase_coefficients plus the output row pointer.
  • No ownership or allocation behavior changed. The new requests are stack rows with borrowed pointers and value carriers.

Audit signal after regeneration:

  • WB04 score: 998 -> 980.
  • F0453 fillSourceInterfaceFromBoundaryParts: now no-refactor-needed, params=1, broad=0, alloc_calls=0, body_lines=25.
  • F0456 fillRtmQuadratureLevelFromBoundaryParts: now no-refactor-needed, params=1, broad=0, alloc_calls=0, body_lines=17.
  • New request structs are classified as request/config rows with no structural refactor required.

Layout evidence:

  • SourceInterfaceBoundaryRequest: 88 B, align 8, 2 cache lines, borrowed phase/output storage.
  • RtmQuadratureBoundaryRequest: 120 B, align 8, 2 cache lines, borrowed output storage.

Verification:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/carrier_eval.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/carrier_eval.zig
  • git diff --check
  • zig build check
  • zig build test-fast
  • uv run benchmark/run_benchmark_fast.py

Parent sync:

  • Merged latest origin/codex/instrument-grid-comment-quality before pushing; latest merged parent commits were 369bd5fc and 6c21c103.

@bout3fiddy

Copy link
Copy Markdown
Owner Author

Package update: WB03 wavelength sampling worker ownership

Scope:

  • Added WavelengthSamplingWorkerLease as the named temporary owner row for parallel wavelength-plan workers and thread handles.
  • Moved worker/thread heap setup into buildWavelengthSampling, so fillWavelengthSamplingPlans now borrows the lease and reads as fill-only execution.
  • Merged parent draft updates through 8e288db7 Clarify carrier evaluation cache routes; resolved the carrier-eval comment/request-wrapper conflict by keeping this branch's narrow request structs and preserving the parent explanatory comments.

Audit:

  • WB03 before this package: 184.
  • WB03 on final merged head: 169.
  • WB02 remains 353 on final merged head.
  • WB04 is 611 after the latest parent merge and conflict resolution.

Verification on final head 6021f7bc:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/instrument_grid/grid_calculation/wavelength_sampling.zig src/input/o2a_reference/run.zig src/forward_model/optical_properties/state_build/carrier_eval.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/instrument_grid/grid_calculation/wavelength_sampling.zig src/input/o2a_reference/run.zig src/forward_model/optical_properties/state_build/carrier_eval.zig
  • git diff --check
  • python3 scratch/reports/dod_memory_audit/analyze_dod_memory.py && python3 scratch/reports/dod_memory_audit/generate_friction_scores.py && python3 scratch/reports/dod_memory_audit/generate_refactor_proposal.py && python3 scratch/reports/dod_memory_audit/generate_work_bundles.py
  • zig build check
  • zig build test-fast
  • uv run benchmark/run_benchmark_fast.py

Benchmark run 2a825cbabf024e4f83b577e5be4006ab:

  • forward/no-session: 1.434s, 0.972s, 0.974s
  • session setup 0.710s; first cached run 0.266s; cached repeats 0.265s, 0.265s, 0.269s
  • fast-mode reference baseline 2.019s; reference oblique aerosol 2.392s; four-scene totals 2.396s, 2.393s, 2.417s
  • retrieval single session totals 1.826s, 1.824s; retrieval 1.118s, 1.117s
  • retrieval single fast_mode totals 1.120s, 1.118s; retrieval 0.530s, 0.529s
  • retrieval sweep case 001 session/fast_mode 6.774s/3.408s (local outlier in this run)
  • retrieval sweep case 003 session/fast_mode 5.345s/1.640s

@bout3fiddy

Copy link
Copy Markdown
Owner Author

Package update: WB04/WB05 layer accumulation deltas

Scope:

  • Changed populateSublayer, populateParitySupportRow, and populateLayer to return local LayerAccumulation deltas instead of mutating a broad *LayerAccumulation passed deep into the sublayer path.
  • Replaced mergeParitySupportTotals with mergeLayerAccumulationTotals, used at the caller boundary to make the flow explicit: fill row -> return contribution -> merge.
  • Merged parent draft updates through 3fdeb1ed Clarify prepared state finalization handoff.

Audit on final merged head e94c5127:

  • WB04: 757 -> 728.
  • WB05: 948 -> 942.
  • WB10 remains 113 after the parent integration-header merge.

Verification on final head e94c5127:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/layer_accumulation.zig src/forward_model/implementations/instrument/integration.zig src/forward_model/optical_properties/state_build/finalize.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/layer_accumulation.zig src/forward_model/implementations/instrument/integration.zig src/forward_model/optical_properties/state_build/finalize.zig
  • git diff --check
  • python3 scratch/reports/dod_memory_audit/analyze_dod_memory.py && python3 scratch/reports/dod_memory_audit/generate_friction_scores.py && python3 scratch/reports/dod_memory_audit/generate_refactor_proposal.py && python3 scratch/reports/dod_memory_audit/generate_work_bundles.py
  • zig build check
  • zig build test-fast
  • uv run benchmark/run_benchmark_fast.py

Benchmark run 26db98ecee5c441ab092ea7047d5abae:

  • forward/no-session: 1.383s, 0.972s, 0.972s
  • session setup 0.708s; first cached run 0.265s; cached repeats 0.266s, 0.265s, 0.267s
  • fast-mode reference baseline 2.022s; reference oblique aerosol 2.387s; four-scene totals 2.401s, 2.414s, 2.400s
  • retrieval single session totals 1.845s, 1.828s; retrieval 1.122s, 1.120s
  • retrieval single fast_mode totals 1.123s, 1.123s; retrieval 0.530s, 0.530s
  • retrieval sweep case 001 session/fast_mode 4.869s/1.621s
  • retrieval sweep case 003 session/fast_mode 5.270s/1.622s

@bout3fiddy

bout3fiddy commented Jun 10, 2026

Copy link
Copy Markdown
Owner Author

WB05 package: vertical grid storage ownership

Changed OwnedVerticalGrid from fourteen independent heap column allocations to one aligned backing allocation with typed borrowed column slices. The public column fields remain the consumer-facing shape; owned_storage is now the single release point, with the layout(64-bit) comment and compiler-backed layout test updated from 224 B to 240 B.

Audit movement after merging latest parent draft commits:

  • WB05 score: 942 -> 747
  • WB05 ownership sites: 211 -> 146
  • F0734 vertical_grid.allocate dropped out of the highest-scoring items.

Verification on pushed head ad49cfda:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/vertical_grid.zig src/forward_model/optical_properties/state_build/rtm_quadrature.zig tests/unit/forward_model/optical_properties/state_build/root_test.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/vertical_grid.zig src/forward_model/optical_properties/state_build/rtm_quadrature.zig
  • python3 scratch/reports/dod_memory_audit/analyze_dod_memory.py && python3 scratch/reports/dod_memory_audit/generate_friction_scores.py && python3 scratch/reports/dod_memory_audit/generate_refactor_proposal.py && python3 scratch/reports/dod_memory_audit/generate_work_bundles.py
  • git diff --check
  • zig build check
  • zig build test-fast
  • zig build test
  • uv run benchmark/run_benchmark_fast.py
  • prek run --all-files

Stable benchmark rerun used for evidence:

  • forward/no-session median: 0.983s
  • forward/session cached median: 0.265s
  • forward/fast-mode median total: 2.413s
  • OE session median retrieval: 1.120s
  • OE sweep fast total: 2.051s

@bout3fiddy

Copy link
Copy Markdown
Owner Author

WB05/WB04 package: narrow parity layer accumulation inputs

Changed the parity-support branch in layer_accumulation.zig so helper calls borrow the specific data they need instead of forwarding the full preparation context deeper into the path:

  • seedParitySupportRowLayerIndices now takes layers and sublayers.
  • canParallelPopulateParitySupportRows now takes row_count.
  • reduceParityLayer now takes scene, vertical_grid, and sublayers.
  • usesDisamarParitySupportGrid now reads scene directly.
  • populateSublayer reuses the computed parity-grid route and groups support-weight/path-length selection into one branch.

Audit movement after merging latest parent draft commits:

  • WB05 score: 747 -> 737
  • WB04 score: 728 -> 716
  • F0536 populate: 30 -> 18

Verification on pushed head 05e6f90a:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/layer_accumulation.zig src/forward_model/instrumentation/stubs/calculation_telemetry_sink.zig src/forward_model/instrumentation/telemetry.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/layer_accumulation.zig src/forward_model/instrumentation/stubs/calculation_telemetry_sink.zig src/forward_model/instrumentation/telemetry.zig
  • python3 scratch/reports/dod_memory_audit/analyze_dod_memory.py && python3 scratch/reports/dod_memory_audit/generate_friction_scores.py && python3 scratch/reports/dod_memory_audit/generate_refactor_proposal.py && python3 scratch/reports/dod_memory_audit/generate_work_bundles.py
  • git diff --check
  • zig build check
  • zig build test-fast
  • zig build test
  • uv run benchmark/run_benchmark_fast.py
  • prek run --all-files

Stable benchmark rerun used for evidence:

  • forward/no-session median: 0.975s
  • forward/session cached median: 0.265s
  • forward/fast-mode median total: 2.402s
  • OE session median retrieval: 1.135s
  • OE sweep fast total: 2.051s

@bout3fiddy

Copy link
Copy Markdown
Owner Author

WB05 absorber builder package

Change:

  • Narrowed src/forward_model/optical_properties/state_build/absorbers.zig so buildCrossSectionAbsorbers and buildLineAbsorbers take sublayer_count instead of the whole PreparationContext.
  • Hoisted exact borrowed inputs in build: cross sections, profile T/P/z slices, borrowed profile line-state slices, midpoint wavelength, and air-mass LUT. This keeps allocation/ownership at the same setup boundary but makes the data flow visible at call sites.
  • Merged latest parent draft commits through ab0ba085 before push.

Audit movement after regeneration:

  • WB05 score: 737 -> 686.
  • F0424 build dropped out of the current friction-score table; before this package it was 27 with 9 broad-owner edges.

Verification on final pushed head 2af498b8:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/absorbers.zig src/forward_model/optical_properties/state_build/spectroscopy.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/absorbers.zig src/forward_model/optical_properties/state_build/spectroscopy.zig
  • audit regeneration chain: analyze_dod_memory.py && generate_friction_scores.py && generate_refactor_proposal.py && generate_work_bundles.py
  • git diff --check
  • zig build check
  • zig build test-fast
  • zig build test (o2a_vendor_forward_reflectance current residual exact-zero)
  • uv run benchmark/run_benchmark_fast.py
  • prek run --all-files

Fast benchmark canary on final head:

  • forward/no-session warm repeats: 0.987s, 0.988s
  • forward/session cached repeats: 0.279s, 0.269s, 0.268s
  • forward/fast-mode four-scene repeats: 2.407s, 2.438s, 2.427s
  • retrieval single session: 1.136s, 1.132s; fast-mode: 0.538s, 0.538s
  • retrieval sweep session cases: 4.223s, 4.616s; fast-mode cases: 1.038s, 1.096s

…ality' into codex/dod-wb01-forward-sample-views
@bout3fiddy

Copy link
Copy Markdown
Owner Author

Parent sync after absorber package

After the absorber evidence comment, the parent draft branch advanced again with 61857eed Clarify bundled asset selection comments. I merged it cleanly and pushed final head 5f5d2d39.

Additional final-head checks after that merge:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/absorbers.zig src/input/reference_data/bundled/assets.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/absorbers.zig src/input/reference_data/bundled/assets.zig
  • git diff --check
  • zig build check
  • zig build test-fast
  • prek run --all-files

The full test and fast benchmark evidence in the previous comment was run on 2af498b8 immediately before this parent-only asset-comment sync; the absorber code did not change in the final merge.

@bout3fiddy

Copy link
Copy Markdown
Owner Author

WB06 LABOS tangent request package

Change:

  • Added NonIntegratedReflectanceTangentRequest in src/forward_model/radiative_transfer/labos/execute.zig as an 80 B stack-only borrowed view for the non-integrated aerosol tangent route.
  • Replaced the two loose ten-argument calls into nonIntegratedReflectanceTangent with request literals plus the dynamic attenuation table.
  • The request borrows layers, geometry, RT rows, controls, and PLM basis; it owns no heap storage and does not change tangent allocation behavior.
  • Merged latest parent draft commits through c40c77c8 before push.

Audit movement after regeneration:

  • WB06 score: 486 -> 482.
  • F0773 nonIntegratedReflectanceTangent dropped out of the current friction-score table; before this package it was 20 with parameter_overage=4 and hot_path_allocator_sites=4.

Verification on final pushed head 29902c62:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/radiative_transfer/labos/execute.zig src/forward_model/instrument_grid/grid_calculation/spectral_eval.zig src/output/o2_line_contributions.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/radiative_transfer/labos/execute.zig src/forward_model/instrument_grid/grid_calculation/spectral_eval.zig src/output/o2_line_contributions.zig
  • audit regeneration chain: analyze_dod_memory.py && generate_friction_scores.py && generate_refactor_proposal.py && generate_work_bundles.py
  • git diff --check
  • zig build check
  • zig build test-fast
  • zig build test (o2a_vendor_forward_reflectance current residual exact-zero)
  • uv run benchmark/run_benchmark_fast.py
  • prek run --all-files

Fast benchmark canary on final head:

  • forward/no-session warm repeats: 0.972s, 0.972s
  • forward/session cached repeats: 0.282s, 0.265s, 0.273s
  • forward/fast-mode four-scene repeats: 2.410s, 2.396s, 2.398s
  • retrieval single session: 1.102s, 1.103s; fast-mode: 0.528s, 0.527s
  • retrieval sweep session cases: 4.149s, 4.551s; fast-mode cases: 1.021s, 1.023s

@bout3fiddy

Copy link
Copy Markdown
Owner Author

WB04 source-interface request package

Change:

  • Added SourceInterfaceSpectroscopyRequest and SourceInterfaceCarrierRequest in src/forward_model/optical_properties/state_build/source_interfaces.zig as 56 B stack-only borrowed views.
  • Public source-interface boundaries now assemble request rows and delegate to request-based private helpers.
  • The request rows borrow prepared optical state, layer inputs, source-interface output rows, and profile/wavelength caches; no heap storage, backing-slice copies, or ownership changes.
  • Merged latest parent draft commit a8d24c15 before push.

Audit movement after regeneration:

  • Targeted source_interfaces.zig public functions now score zero:
    • F0664 fillSourceInterfacesAtWavelengthWithLayers: 0
    • F0665 fillSourceInterfacesAtWavelengthWithLayersAndSpectroscopyCache: 0
    • F0666 fillSourceInterfacesAtWavelengthWithLayersAndCarrierCache: 0
  • Aggregate WB04 remained 716 after regenerated inventory, but the targeted broad-forwarding/scratch findings were removed from these public source-interface boundaries.

Verification on final pushed head 2e236ebd:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/source_interfaces.zig src/forward_model/optical_properties/state_build/rtm_quadrature.zig src/input/ObservationModel.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/source_interfaces.zig src/forward_model/optical_properties/state_build/rtm_quadrature.zig src/input/ObservationModel.zig
  • audit regeneration chain: analyze_dod_memory.py && generate_friction_scores.py && generate_refactor_proposal.py && generate_work_bundles.py
  • git diff --check
  • zig build check
  • zig build test-fast
  • zig build test (o2a_vendor_forward_reflectance current residual exact-zero)
  • uv run benchmark/run_benchmark_fast.py
  • prek run --all-files

Fast benchmark canary on final head:

  • forward/no-session warm repeats: 0.972s, 0.972s
  • forward/session cached repeats: 0.262s, 0.262s, 0.262s
  • forward/fast-mode four-scene repeats: 2.415s, 2.397s, 2.413s
  • retrieval single session: 1.106s, 1.108s; fast-mode: 0.530s, 0.545s
  • retrieval sweep session cases: 4.148s, 4.555s; fast-mode cases: 1.020s, 1.024s

@bout3fiddy

Copy link
Copy Markdown
Owner Author

WB04 layer-spectroscopy request package

Change:

  • Added LineSpectroscopyRequest and CachedSingleLineRequest in src/forward_model/optical_properties/state_build/layer_spectroscopy.zig.
  • populateSublayer now prepares the line-spectroscopy row explicitly before calling the spectroscopy helpers.
  • resolveCachedSingleLineEvaluation and resolveSpectroscopyEvaluation now accept narrow borrowed request rows instead of broad context/absorbers plus loose support-row scalars.
  • Request rows are stack-only borrowed views: LineSpectroscopyRequest is 208 B, CachedSingleLineRequest is 120 B. No heap ownership, backing-slice copies, or allocation behavior changed.
  • Merged latest parent draft commits through aabc50f8 before push.

Audit movement after regeneration on final head 4434d22c:

  • WB04 score: 716 -> 694.
  • Targeted layer-spectroscopy rows now score zero:
    • F0564 resolveCachedSingleLineEvaluation: 0
    • F0565 resolveSpectroscopyEvaluation: 0
    • S0171 LineSpectroscopyRequest: 0
    • S0172 CachedSingleLineRequest: 0
  • populateSublayer remains nonzero (8) because it is still the support-row assembly point, but the broad deep line-spectroscopy call route is removed.

Verification on final pushed head 4434d22c:

  • uv run scripts/linting/check-zig-styleguide.py src/forward_model/optical_properties/state_build/layer_spectroscopy.zig src/forward_model/optical_properties/state_build/layer_accumulation.zig src/forward_model/optical_properties/state_build/forward_layers.zig src/forward_model/optical_properties/state_build/rtm_quadrature.zig
  • uv run scripts/linting/check-zig-dod-layout.py src/forward_model/optical_properties/state_build/layer_spectroscopy.zig src/forward_model/optical_properties/state_build/layer_accumulation.zig src/forward_model/optical_properties/state_build/forward_layers.zig src/forward_model/optical_properties/state_build/rtm_quadrature.zig
  • audit regeneration chain: analyze_dod_memory.py && generate_friction_scores.py && generate_refactor_proposal.py && generate_work_bundles.py
  • git diff --check
  • zig build check
  • zig build test-fast
  • zig build test (o2a_vendor_forward_reflectance current residual exact-zero)
  • uv run benchmark/run_benchmark_fast.py
  • prek run --all-files

Fast benchmark canary on final head:

  • forward/no-session warm repeats: 0.973s, 0.974s
  • forward/session cached repeats: 0.262s, 0.262s, 0.262s
  • forward/fast-mode four-scene repeats: 2.395s, 2.398s, 2.395s
  • retrieval single session: 1.119s, 1.105s; fast-mode: 0.529s, 0.533s
  • retrieval sweep session cases: 4.149s, 4.561s; fast-mode cases: 1.024s, 1.024s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant