Skip to content

Computation registry + forward pass core #1613

Description

@Andrea-Havron-NOAA

At build time, the model should:

  1. Start with the values (parameters and derived quantities) provided by the modules the user configured.
  2. Find which calculations can run with those values.
  3. Run this check repeatedly, adding newly-created outputs (derived quantities) each round,
  4. Stop when no new calculations can be added.

This gives us the list of calculations the model should execute.

Scope

  • Add inst/include/models/forward_pass.hpp with:
    • CalcDescriptor: describes one possible calculation (its inputs, outputs, and loop domain).
    • DimRule: rules for deciding output size/dimensions.
    • ResolvedOutput: output metadata after size/dims are finalized.
    • run_forward_pass(): function that builds the final list of active calculations.
  • Start from an initial set of known quantities contributed by initialized modules.
  • Repeatedly activate calculations whose required inputs are available.
  • Compute output sizes/dimensions using DimRule.
  • Handle cases where two calculations can produce the same output in a fixed, predictable way.

Tasks

  • Define data structures for:
    • one calculation definition (CalcDescriptor)
    • dimension rules (DimRule)
    • finalized output metadata (ResolvedOutput)
    • a registry container holding all calculation definitions
  • Implement initial “known quantities” setup from module contributions.
  • Implement dimension/size calculation for outputs from DimRule.
  • Implement the repeat-until-no-change activation loop.
  • Define and implement a fixed tie-break rule when multiple calculations can produce the same output.
  • Return a finalized list of selected calculations and outputs in a format the kernel builder can consume directly.

Acceptance criteria

  • The forward pass always finishes (no infinite loop) and gives the same result every run for the same inputs.
  • Output metadata (name, size, dimensions, dimension names) is correct.
  • When multiple producers exist for one output, the selected producer follows documented tie-break rules and is covered by tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions