Skip to content

CI check only: callback branch tip 323135b04 (do not merge) - #5586

Open
tclune wants to merge 109 commits into
developfrom
ci-check/callback-tip-323135b04
Open

tclune wants to merge 109 commits into
developfrom
ci-check/callback-tip-323135b04

Conversation

@tclune

@tclune tclune commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Throwaway PR to run the full CI matrix (CircleCI GEOS ifx regression, Spack, link check) on the callback branch tip. Not for review; will be closed.

tclune and others added 30 commits November 13, 2026 11:53
Converts the callback contracts and registry design note into an
OpenSpec change (proposal, design, tasks, five spec deltas) and a
task plan with owner questions and source-drift observations.
Docs/specs only; no Fortran changes, ctest not run.
…ment

The owner rejected the drafted subject indirection: a member-scoped
attribute is simply an attribute of the argument it belongs to, named
directly as host_argument, with no interface-level labeling concept.

Resolves plan item 20 (owner answer, 2026-11-13).
CallbackArgumentSpec: add dims, optional, extensive and weight_for

A callback argument can now declare its gridded dims ('xyz' or 'xy'),
whether it is optional, whether it is extensive, and which argument it
is the mass weight for. All four are optional constructor arguments
with accessors. The defaults keep the meaning of a name-and-kind-only
declaration: no dims, required, not extensive, no weight_for.

The constructor gains an optional rc. It rejects a field argument
declared without dims and any dims value other than xyz or xy.
weight_for is stored as a name only; checking it against the other
arguments needs the whole interface.

weight_for was named weight_of through review; renamed because
"weight_of: mixed_quantity" on air_mass reads backwards (this
argument's weight is mixed_quantity) instead of the intended meaning
(this argument is the weight for mixed_quantity).

Plan-Task: CB1-ArgSpec
Matches the CallbackArgumentSpec rename landed in 1c2e59e (PR #5530):
weight_of: mixed_quantity on air_mass read backwards (this argument's
weight is mixed_quantity) instead of the intended meaning (this
argument is the weight for mixed_quantity).

Plan-Task: CB1-ArgSpec
Adds Test_InfoTypesProbe.pf: 13 pFUnit tests exercising raw
ESMF_Info on i4/i8/r4/r8/logical/string scalars and arrays, plus
nested-key enumeration, to settle callback-contracts-and-registry
design.md Decision 4 before the MAPL_Info* wrapper design (CB2) is
written.

Findings recorded in design.md Decision 4: ESMF_InfoGet never
silently converts across stored kind (returns non-success rc
instead, confirmed for both r8->i4 and string->r8); nested keys
under a prefix can be enumerated purely from the ESMF_Info object
itself via size= at the parent key for child count, then idx=/ikey=
(1-based) for each child's own unqualified key name.

NAG:      100% tests passed, 0 tests failed out of 72
gfortran: 100% tests passed, 0 tests failed out of 72

Plan-Task: CB0-InfoTypes
Adds Test_HConfigDuplicateKeys.pf: loads a YAML file with two
top-level "toy_scaling:" entries via ESMF_HConfigCreate(filename=...)
(the pattern MAPL's loaders use elsewhere) and records what
ESMF_HConfig does with the duplicate, for design.md's planned
callback-registration loader (item 5).

Findings, recorded in design.md's Risks bullet and Open Questions:
ESMF_HConfigGetSize reports 2 for the loaded map (no collapse);
ESMF_HConfigIter visits both entries in file order under the same
key name, with no error/warning signaling the duplicate; but
ESMF_HConfigCreateAt(hconfig, keyString=...) -- the lookup pattern
every existing MAPL parser uses -- silently returns only the FIRST
occurrence's value, never the last, never an error. Iterating code
and keyString-lookup code in the same codebase would therefore
disagree about which duplicate "wins."

No production code changed; no second YAML parser added.

NAG:      100% tests passed, 0 tests failed out of 72
gfortran: 100% tests passed, 0 tests failed out of 72

Plan-Task: CB0-HConfigDup
New stand-alone module mapl_CRC32_mod (utils/MAPL_CRC32.F90), no
dependencies beyond mapl_ErrorHandling_mod. Standard IEEE 802.3
(zlib/gzip) CRC-32, table built from the reflected polynomial
0xEDB88320. Needed for callback-registry content hashing.

Interface:
  CRC32(buffer)           -> integer(INT32), CRC of a character buffer
  CRC32File(file, rc)     -> integer(INT32), CRC of a file read as a
                             stream in 4096-byte chunks; rc /= SUCCESS
                             if the file cannot be opened or read
  CRC32Hex(crc)           -> character(8), upper-case hex digits

Re-exported from mapl_utils_api as mapl_CRC32, mapl_CRC32File and
mapl_CRC32Hex. Tests in utils/tests/test_CRC32.pf cover the empty
string, the standard check value CBF43926 for "123456789", other
published vectors, hex formatting, small/empty/multi-chunk files, and
a missing file.

ESSENTIAL ctest:
  nag:       100% tests passed, 0 tests failed out of 72
  gfortran:  100% tests passed, 0 tests failed out of 72

Plan-Task: CB3-CRC32
Adds CallbackContractViolation (one entry per conformance problem
found on a Handler's callback State) and
format_callback_contract_report, which turns a violation array into
one report message: a header line naming the interface and its
version, the Handler component and the callback State, followed by
one indented line per violation, so every violation found for one
callback State is reported together instead of failing on the first.

CallbackContractViolation has one named constructor per violation
category named in the conformance spec's "Contract checks run on the
realized callback State" requirement (F1-F8, MF1, MF1b, MF4, MF6-MF8):
missing_argument, kind_mismatch, missing_attribute (state or
member-hosted), attribute_type, attribute_value_not_allowed,
rule_not_met, unknown_key, weight_missing, weight_geometry. Internal
short reason codes reuse export_conforms_to_interface's existing
naming scheme ("missing_member:<name>", "kind_mismatch:<name>",
GraphBuilder_CallbackWiring_smod.F90) rather than inventing a parallel
one; the new codes extend it the same way ("attribute_type:<key>",
"weight_missing:<name>", etc.).

Test_CallbackContractReport.pf asserts, as literal full-string
equality (not substring containment): the header alone, the spec's
message-wording scenario (operation: ofset) producing the exact
header-plus-line text including "allowed values: scale, offset", the
F1 missing-argument scenario, the F4 attribute-type scenario, and the
"two violations, one report" scenario. Each remaining violation
constructor has its own test asserting its code and rendered text.

Not yet wired to export_conforms_to_interface or a realized-state
checker (tasks 4.2/4.3); CallbackInterface carries no version field
yet (task 1.6), so the formatter takes interface name/version as plain
arguments from the caller rather than from a CallbackInterface value.

NAG:      100% tests passed, 0 tests failed out of 72
gfortran: 100% tests passed, 0 tests failed out of 72

Plan-Task: CB4-Messages
Adds mapl_SnapshotTransform_mod (superstructure/generic/graph/transforms/):
a value copy of a Field, taken each time it computes. The callback
layer places one on the get return path of a callback argument when a
horizontal regrid lies between the owner and the Invoker, so a later
put can form the delta against the value the Invoker was given; the
delta itself is not formed here.

One input port 'source_field', one output port 'destination_field';
the output is a distinct Field of the same shape and typekind so a
later change to the input does not reach it. R4 and R8, any rank
assign_fptr_condensed_array supports. Field only; bundles are not
supported (not needed for the callback argument snapshot). Independent
of the legacy layer, matching sibling transforms in this directory.

NAG:      100% tests passed, 0 tests failed out of 72
gfortran: 100% tests passed, 0 tests failed out of 72

Plan-Task: CB6-Snapshot
Adds mapl_WeightedDeltaBackTransform_mod (superstructure/generic/graph/
transforms/): returns the change an Invoker made to a callback argument
on its grid T to the owner field X on grid O so the owner budget closes.

Input ports value (c on T), snapshot (c0 on T), owner (X on O) and, when
constructed weighted, weight_invoker (mT on T) and weight_owner (mO on
O); output port owner. Weighted: X + R(mT (c - c0)) / mO. Unweighted:
X + R(c - c0). R is the horizontal regridder from RegridderManager,
first-order conservative by default (overridable by EsmfRegridderParam);
same geom on both sides skips the regrid. R4 and R8; all ports share one
typekind; each port, value included, is checked for geom (by MAPL geom
id), typekind and condensed shape before any temporary is made, so a
weight_owner on another geom or of another typekind is rejected. The
regrid temporaries are destroyed on every exit path, including a failed
regridder lookup or regrid. mO is a mass and assumed nonzero.

Input ports are answered from a fixed name list rather than the base
port map, following ExpressionTransform (gfortran polymorphic copy of a
multi-entry gFTL map). Not yet wired into any graph.

Test_WeightedDeltaBackTransform.pf (no graph wiring): M2 on an 8x4 to
4x4 edge-aligned lat-lon pair (two Invoker cells of area a per owner
cell): weighted gives dO = 1, a plain unweighted area average of the
same dT gives dO = 2; an unweighted case dT = (6, 2) gives dO = 4;
M2 repeated with R4 fields; same-geom weighted case; owner weight on
the wrong geom, an R4 owner weight against R8 fields, and a missing
weight port all fail.

NAG:      100% tests passed, 0 tests failed out of 72
gfortran: 100% tests passed, 0 tests failed out of 72

Plan-Task: CB6-WeightedDeltaBack
ConservativeColumnFillTransform scales max(X,0) per column by the
non-negative ratio that restores the column's mass total (owner's
weight), writing the change to a separate fill diagnostic; a column
whose total is negative, NaN, or infinite is an error naming the
column. A total within round-off of zero (typekind-scaled tolerance)
fills to zero. NonNegativeCharacteristic ("non_negative: {fill:
column}") is a never-compared per-alias characteristic, following
RestartMode's shape; wiring into the put network is CB6-WireDeltaBack.
Stand-alone test pins the M4 scenario numbers.

NAG and gfortran ESSENTIAL: 72/72 passed.

Plan-Task: CB6-ColumnFill
…g tests

Add mapl_ImplicitColumnDiffusion_mod to the test-only
MAPL.generic.test_common library (superstructure/generic/tests): a
mass-weighted backward-Euler column diffusion step with
neumann_homogeneous, neumann, robin and dirichlet bottom conditions,
used as the synthetic turbulent_mixing test interface. It is not part of
MAPL.vertical and is not installed. The system is an M-matrix and is
solved directly (Thomas), so non-negative input stays non-negative
without fill. Dirichlet pins the bottom layer; its realized flux
includes the bottom-layer reset. The MAPL.generic.vertical ctest covers
the M-matrix property, M9 positivity for all four conditions,
conservation, distinguishable bottom conditions, and input checks.

NAG:      100% tests passed, 0 tests failed out of 72
gfortran: 100% tests passed, 0 tests failed out of 72

Refs #5528

Plan-Task: CB9-ColumnSolver
Plan-Task: plan-maintenance
Declares one attribute in a callback interface's attribute schema: a
value type (integer, real of 4 or 8 bytes, logical, string, or a list of
one), a scope (member or state, default member), a host_argument name
(required for member scope, rejected for state scope), required,
an optional default, and an optional allowed set for string and integer
types. Rejects a default on a required attribute, a default outside the
allowed set, and an allowed set on a real or logical attribute. A value
of another type is rejected, not converted; string values are stored
trimmed. For a list attribute the allowed set constrains each element
(unresolved by the spec; kept as the natural reading, open for review).

CallbackValueType is its own module so call scalars (CB1-CallScalarSpec)
and rules (CB1-Rule) can share it without depending on this task.
CallbackAttributeSpecMap is a gFTL map keyed by attribute name.

Whether host_argument names a real, non-weight argument, and the
slash-free name rule, are left to the interface-level checks
(CB1-Interface).

NAG ESSENTIAL 72/72, gfortran ESSENTIAL 72/72.

Plan-Task: CB1-AttributeSpec
One rule of a callback interface: "when attribute a has value v,
arguments x, ... are required". CallbackRule stores the attribute name,
the triggering value as a string, and the required argument names in
the order given; strings are stored trimmed. The constructor rejects an
empty or blank attribute name, a rule that requires no arguments, and a
blank required-argument name. An empty trigger value and duplicate
argument names are accepted. Whether the attribute and arguments are
declared, and whether the value is legal for the attribute's type, is
left to the whole-interface check, not this type.
CallbackRuleVector collects rules in declaration order.

The trigger value is a plain string, not CallbackValueType; the text
form of logical and real triggers is not yet defined and is left to the
interface task.

Tests: ESSENTIAL ctest, rerun from scratch after the final change.
  NAG:      100% tests passed, 0 tests failed out of 72
  gfortran: 100% tests passed, 0 tests failed out of 72

Plan-Task: CB1-Rule
Landed-By: meta
Plan-Task: plan-maintenance
Landed-By: meta
graph: add CallbackCallScalarSpec and CallbackCallScalarSpecMap

Declares one call scalar in a callback interface: a named scalar written
into the callback State's own Info just before a method call. It carries
a value type (the shared CallbackValueType; a time interval is a string
holding an ISO 8601 duration) and a writer, CallbackCallScalarWriter
(invoker or handler). The writer has no default. Rejects an empty name,
an unset value type, and an unset writer.

CallbackCallScalarSpecMap is a gFTL map keyed by call-scalar name,
following CallbackArgumentSpecMap.

The slash-free name rule is left to the interface-level checks
(CB1-Interface).

gfortran ESSENTIAL 75/75, ifx ESSENTIAL 75/75 (author-reported).
NAG ESSENTIAL 72/72, gfortran ESSENTIAL 72/72 (meta, independent rerun).

Plan-Task: CB1-CallScalarSpec
Landed-By: meta
Plan-Task: plan-maintenance
Landed-By: meta
Record the owner's preference: a structure-constructor overload should
not validate its arguments; validation belongs in a separate
make_TypeName(..., rc) factory. Preferred style, not an absolute rule.
Whichever form is used, the function result must be defined on every
branch -- critical for an allocatable result or component. The four
landed CB1 value types validate inside their structure constructors and
are accepted debt; CB1-Interface should split CallbackRule's constructor
as a small side item while it is already touching that file.

Also fixes the CB1 Status paragraph: an earlier edit left the
CB1-AttributeSpec file description and CallbackValueType dependency note
orphaned after the CB1-CallScalarSpec entry, with no lead-in sentence.
Reordered per-task so each entry reads standalone.

Plan-Task: plan-maintenance
Landed-By: meta
The rule and its rationale already live in CONVENTIONS.md; restating
them in the plan doc's per-task Status duplicates content meta doesn't
need to retain, only the author of CB1-Interface does. Keep just the
pointer and the one concrete action item.

Plan-Task: plan-maintenance
Landed-By: meta
Add freeze_callback_registry: after it, register_callback_interface
fails with a message naming the interface and stating the registry is
frozen; lookups still work; freezing twice is a no-op. Add
list_callback_interface_names, which returns every registered name in
sorted order (via sorted_names; entries are blank-padded to the longest
name, callers trim).

Add reset_callback_registry_for_testing (public in the module, test-only
by contract, no production caller) which clears both maps, restarts the
id generator and unfreezes. Test_CallbackInterfaceRegistry.pf calls it
from @before/@after so freezing the singleton cannot leak into other
tests. Other suites register unique service names and never freeze, so
they are unaffected.

Tests added in Test_CallbackInterfaceRegistry.pf: registration after
freeze fails (and the name is not recorded), lookup after freeze
succeeds, freezing twice is a no-op, reset unfreezes, enumeration is
sorted (b_iface, a_iface -> a_iface, b_iface), enumeration of an empty
registry is empty.

ctest -L ESSENTIAL, NAG 7.2.41:  100% tests passed, 0 tests failed out of 72
ctest -L ESSENTIAL, gfortran:    100% tests passed, 0 tests failed out of 72

Plan-Task: CB1-RegistryFreeze

Landed-By: meta
CallbackMethodSpec keeps its AccessSpecMap and gains a parallel map from
argument name to a new CallbackArgumentOptions value. The one recognized
option is put_flavour, legal values "value" or "delta"
(CallbackPutFlavour, CALLBACK_PUT_FLAVOUR_VALUE/_DELTA). set_option
rejects an unrecognized option name (for example put_flavor) or an
illegal put_flavour value and leaves the options unchanged.
declare_argument_access takes a new optional `options` argument; every
declared argument gets an entry in both maps, so an argument declared
without options reports the default (no put_flavour). New accessor
get_argument_options. Existing callers are unchanged.

New: callback/CallbackArgumentOptions.F90,
containers/CallbackArgumentOptionsMap.F90. Tests in
Test_CallbackMethodSpec.pf cover both scenarios of the requirement
"A method's argument access may carry per-argument options", plus
delta, illegal value, no options, undeclared argument and duplicate
declaration.

ctest -L ESSENTIAL (NAG 7.2.41): 100% tests passed, 0 tests failed out of 72
ctest -L ESSENTIAL (gfortran):   100% tests passed, 0 tests failed out of 72

Plan-Task: CB1-MethodOptions

Landed-By: meta
Plan-Task: CB1-RegistryFreeze
Plan-Task: CB1-MethodOptions
Landed-By: meta
CallbackInterface gains the declarations and cross-checks that only it
can make, because it alone sees every declared name together:

- version (at least 1), one-line summary, optional description, built by
  make_CallbackInterface(..., rc); the structure constructor stores
  values and checks nothing (CONVENTIONS section 5).
- declare_attribute (wraps CallbackAttributeSpec), declare_call_scalar
  (wraps CallbackCallScalarSpec), declare_rule (wraps CallbackRule);
  matching is_/get_/get_* accessors. declare_argument now forwards dims,
  optional, extensive and weight_for.
- host argument of a member-scoped attribute must be a declared,
  required argument that is not a weight.
- weights: the weight is extensive, names a declared non-extensive
  argument, and is required whenever that argument is.
- rules: the attribute is declared, the value is legal for its type and
  allowed set, every required argument is declared and optional.
- names of arguments, methods, attributes and call scalars contain no
  '/'; the interface name is checked in register_callback_interface.
- set_method_argument_access forwards the optional per-argument options.

Message wording of the unknown host argument, unknown weight target and
unknown rule attribute/argument checks (each names the unknown name and
the declared names) is asserted in
superstructure/generic/tests/Test_CallbackInterfaceMessages.pf, which
needs the exception handler the graph suite lacks.

CallbackRule's constructor no longer validates; the checks moved to the
new make_CallbackRule(..., rc) factory.

ctest -L ESSENTIAL (nag):       100% tests passed, 0 tests failed out of 72
ctest -L ESSENTIAL (gfortran):  100% tests passed, 0 tests failed out of 72

Plan-Task: CB1-Interface

Landed-By: meta
Plan-Task: CB1-Interface
Landed-By: meta
Extends infrastructure/esmf/InfoUtilities.F90 with the pieces needed
for Info-based component introspection: MAPL_InfoGet(Shared/Private)
r8_1d and string-list (StringVector) getters/setters alongside the
existing i4_1d/r4_1d; MAPL_InfoGetShared/MAPL_InfoSetShared scalar
logical/i4/r4/r8 accessors on a State's own Info (not just a named
item's); MAPL_InfoGetValueKind, a stored-type query (integer, real,
logical, string, and their list forms, plus absent/other) usable on a
raw Info object, a State's own shared Info, or a named item's shared
Info; and MAPL_InfoGetKeys, unqualified key enumeration under a prefix
with the same three call shapes.

Fixes a read of key(1:1) on a zero-length key in the internal concat()
helper (invalid substring reference for MAPL_InfoGetKeys(..., key=''))
by switching concat to an allocatable-length result, which also removes
a one-character trailing-blank pad that concat could introduce when the
caller's key already started with '/', masking info_get_keys's
trailing-'/' strip. Also corrects a comment that had attributed
key-name truncation in MAPL_InfoGetKeys to ESMF; it is this module's
own fixed-length ESMF_MAXSTR buffer.

Documents two known gaps in the module header: MAPL_InfoGetValueKind
reports an empty array as OTHER, not a list kind, and the string-list
getter reads a scalar string back as a one-element list instead of
failing (the numeric list getters do not share this second gap).

Plan-Task: CB2-InfoWrappers
Landed-By: meta

NAG ESSENTIAL: 100% tests passed, 0 tests failed out of 72, Total Test time (real) = 88.02 sec
gfortran ESSENTIAL: 100% tests passed, 0 tests failed out of 72, Total Test time (real) = 152.58 sec
tclune and others added 24 commits November 24, 2026 20:14
Plan-Task: plan-maintenance
Landed-By: meta
#5561)

graph: add invoker-side callback collection iterator (CB5-Execute-5.3)

Add CallbackMemberHandle and CallbackCollectionIterator to
GraphBuilder.F90, implemented in new submodule
GraphBuilder_CallbackExecution_smod.F90, so an Invoker can iterate the
members of a resolved callback collection import and invoke a bound
Handler method on each member without caring how StateRegistry
resolved the import.

- begin_callback_collection(this, import_short_name, rc) builds a
  CallbackCollectionIterator over the collection node matched to
  import_short_name; an unresolved or never-connected import yields a
  zero-member iterator, not an error.
- The iterator is advance-first: done()/current() are only meaningful
  after at least one advance(); current()/get_state() called before
  any advance() or after done() is true raise a loud _ASSERT/_FAIL
  instead of returning a stale or null handle silently.
- One iterator member corresponds to one matched Handler's whole
  composite STATE export, keyed by that export's own qualified name
  (StateItemMemberMap keying established in callback wiring).
- CallbackMemberHandle%execute(method, rc) builds a
  callback_method_binding_key, looks it up in the collection node's
  callback_method_bindings, and invokes invoke_callback_method on a
  match; an unbound method name fails loudly via _ASSERT rather than
  invoking nothing.
- CallbackMemberHandle%get_state(rc) exposes the member's bound State,
  and %get_member_qualified_name() the matched export's own qualified
  name, for callers that need direct field access or member identity
  alongside method invocation.

8 new tests in Test_GraphBuilder_CallbackExecution.pf cover: empty
iterator for an unresolved import, single-member advance/current,
advance-first ordering guards (current() before advance() and after
done()), a get-direction execute() (the "quantity" member Field is
proven aliased to the Invoker's own provide_item Field, not merely a
same-named copy - same-grid get arguments are wired as a direct Field
alias, not a real per-call pull), a put-direction execute() (checks
that the Invoker's own receive_item NodeRevision advances via
get_receive_revision after a successful invoke - not the matched
export's NodeRevision, and not a claim that real data moved), an
unknown-method _ASSERT that also checks both call gates stay false and
the revision is unchanged (the two checks that actually show nothing
ran; a same-grid quantity Field read afterward only confirms the
method body itself never ran, since quantity already aliases
provide_item regardless of whether a pull happened), and a two-Handler
multi-member iteration test (two matched Handlers bound to the same
import; two advance() calls reach exactly HANDLER/cb and HANDLER2/cb,
in either order, before a third advance() reaches done() -
distinctness is by member_qualified_name, not Field identity, since
this fixture's "quantity" argument is IN on get and OUT on put, so its
get-side forward-network wiring, shared across every match via
provider_get_ids, makes every matched Handler's own quantity alias the
one Invoker provide_item Field; an OUT-only argument does not alias
this way and gets independent storage per matched Handler).

Updated docs/graph/callbacks.md with an execution-side section
describing begin_callback_collection, the advance-first idiom, the
one-member-per-Handler semantics, the same-grid get-argument aliasing
behavior (including that it extends across every match of a
multi-Handler collection for IN/INOUT arguments only, not OUT-only
ones), and a note that a get-and-put-sharing-one-argument member's put
can appear to move data today purely through that get-side aliasing -
a known, accepted side effect of the still-open put-direction
data-flow gap, not a new decision. Trimmed task 5.3's Status entry in
callback-contracts-and-registry/tasks.md.

Also in this squash (found by CI after the first push):
- avoid fpp mishandling of // & inside @assertExceptionRaised (ifort/ifx)
- copy QualifiedExportEntry arrays element by element, and fill
  VariableSpecVector in place (gfortran skips the gFTL deep copy on
  array and function-result assignment)
- reword comments that name MAPL macros (ifx expands them in comments)
- StateEval now sets rc on the success path (gfortran Release failure)

NAG:      100% tests passed out of 74 (ESSENTIAL, laptop, before the CI fixes)
gfortran: 100% tests passed out of 77 (ESSENTIAL, bucy Debug and Release)
ifx:      100% tests passed out of 77 (ESSENTIAL, bucy)

Plan-Task: CB5-Execute-5.3
CB5-Execute 5.1b: `alias: <pattern>` with `template: true` on
declare_member expands one member declaration into one callback State
per matching INTERNAL item (via the same VirtualConnectionPt%matches
regex already used for import-name wildcards), each with generated
name `<declared>_<matched item>` and a single aliased member. The
un-expanded declared var_spec never gets a node of its own. Zero
matches is allowed (no State, no error); a literal alias with
template: true is a template of one.

VariableSpec.F90: new `callback_member_template` field (plain field
assignment, no make_VariableSpec keyword, same precedent as
callback_member_alias), `get_template_member` (detects the one-member/
alias+template shape) and `expand_template_member` (clone: short_name
= <declared>_<matched>, callback_declared_name = declared short_name so
a connection/re-export naming the declared name finds every expansion,
members map reset and rebuilt via declare_member so the templated
member becomes a literal, non-template alias on the clone).

GraphBuilder.F90: `matching_internal_item_names` shared helper (public
for gfortran cross-submodule linkage, same reason as is_self) — reused
by advertise_one and collect_qualified_exports rather than writing a
second regex path.

ComponentGraph.F90: `get_internal_item_names` accessor (resource_index
keys with INTERNAL_ITEM_KEY_PREFIX stripped) — purely string-based;
the actual pattern match happens in matching_internal_item_names so
ComponentGraph stays free of any VirtualConnectionPt/connection-layer
dependency.

GraphBuilder_Advertising_smod.F90: advertise_one's body moved into a new
advertise_single, which holds all of the old flat/composite advertise
logic unchanged. advertise_one itself is a thin, non-recursive wrapper:
a template declaration expands into clones and calls advertise_single
once per clone in a loop; a non-template declaration calls
advertise_single once. advertise_single never calls back into
advertise_one, so it stays non-recursive too — only
materialize_composite (called once per clone, for a plain,
non-nested-composite clone) is `recursive`, same as before this task.

GraphBuilder_CallbackRealization_smod.F90
(graphbuilder_realize_callback_states): the brief's mechanism section
covers advertise_one and re-export/import lookup, but a Handler's
callback State is realized into a real ESMF_State by this separate
pass, which walks the *same* un-expanded comp_spec%var_specs list and
looked up each export's own node by its un-expanded short_name. Since
a template declaration's expansions never appear under that name,
without this fix every expansion was advertised and wired correctly
but never actually realized into export_state. Added the same
get_template_member/matching_internal_item_names/expand_template_member
branch here, calling realize_callback_state once per expansion. This
is Handler-side state realization, not Invoker-side execution (5.2/
5.3), so it's in scope for 5.1b.

GraphBuilder_CallbackWiring_smod.F90 (collect_qualified_exports): a
template var_spec is expanded into N QualifiedExportEntry clones
instead of one, so resolve_callback_import's existing 5.1d
is_own_declared_name_match mechanism (get_callback_declared_name)
automatically picks up every template expansion with no change to
resolve_callback_import itself.

GraphBuilder_ConnectionResolution_smod.F90 (reexport_one): unlike
collect_qualified_exports, this scans the graph's port table by
literal name, so it needs its own fallback. Added
find_export_ids_by_declared_name (builds the qualified-export
namespace, filters to the source component's own direct exports,
matches get_callback_declared_name() == name, resolves to real
NodeIds), tried only when find_export_port_node_ids finds zero
literal-name matches — ordinary exports and re-export-of-a-re-export
are unaffected.

gfortran correctness issues found and fixed in the same pass:
- Test subroutine name test_realize_callback_states_template_member_
  literal_alias_one_match was 68 characters, over gfortran's (and the
  Fortran standard's) 63-character name limit; NAG accepts longer
  names as an extension. Renamed to
  test_realize_callback_states_template_member_literal_one_match (62).
- advertise_one's and graphbuilder_realize_callback_states' template
  branches read matched_items%of(i) (a gFTL StringVector) across a call
  into a `recursive` procedure made from inside the per-match loop
  (advertise_single's call to materialize_composite;
  realize_callback_state's own recursion into nested composite
  members). Reproducible gfortran-only crash: "Index '2' of dimension 1
  of array 'this%elements' below lower bound" — the vector's own array
  descriptor was corrupted by the time the second iteration read it.
  Fixed both sites by copying every matched name out into a plain
  character(MAX_CALLBACK_ARGUMENT_NAME_LEN) array before any such call
  runs, then iterating that plain array instead of the live
  StringVector. NAG never reproduced this (works either way); gfortran
  needs it. var_spec needs no such copy at either site: it is a
  pointer to a scalar VariableSpec, with no array descriptor of the
  kind that was corrupted in matched_items. template_member_name/
  template_pattern also need no such copy: they are set once per
  var_spec and only read, never reassigned, for the rest of the
  per-match loop. Verified with a new 3-match test
  (test_realize_callback_states_template_member_three_matches, one
  call-into-recursive-procedure deeper than the pre-existing 2-match
  test) run under gfortran -fcheck=all,no-array-temps
  -finit-real=snan: passes clean, no corruption.
- Two @test subroutine signatures (..._expands_per_match,
  ..._literal_one_match) are 82 characters: pFUnit's preprocessor
  matches the `@Test`-tagged subroutine's declaration line without
  continuation handling, so wrapping the signature across two lines
  silently drops the test from the generated suite (no build error).
  Kept single-line and left over 80 columns for that reason.

Ordering: a template-aliased INTERNAL item must already be advertised
earlier in SetServices/comp_spec%var_specs order, same constraint
literal callback_member_alias already has via materialize_member's
same-pass point lookup — inherited for free since expansion enumerates
whatever is already in resource_index at expansion time.

Scope: Fortran-API-only, no YAML (parse_var_specs.F90/KEY_* untouched).
Does not touch 5.2a/5.2b/5.3 Invoker-side execution.

Merged PR #5561 (graph/CB5-Execute-5.3, 7f9ea09) for its own gfortran
fix: whole-array (or array-section) intrinsic assignment of a derived
type containing a gFTL map/vector skips the nested defined-assignment
deep_copy on gfortran, leaving dangling parent pointers in the copy
(scalar element assignment is unaffected). That PR converted
build_qualified_export_namespace and resolve_callback_import to
subroutines with allocatable intent(out) outputs and added
append_qualified_export (grows one QualifiedExportEntry at a time) for
exactly this reason. This task's own diff had three of the same
pattern, converted the same way: collect_qualified_exports' template
branch now calls append_qualified_export per match instead of building
`grown_entries(1:n) = entries`; find_export_ids_by_declared_name now
calls `call build_qualified_export_namespace(meta, namespace, _RC)`
instead of the old function form; and the new
test_resolve_callback_import_matches_template_expansions test now
calls `call resolve_callback_import(...)` instead of
`matches = resolve_callback_import(...)`.

New tests: Test_GraphBuilder_CallbackRealization.pf (template expands
per match, zero matches builds nothing, literal alias + template is a
template of one, three matches stresses the recursive-call-mid-loop
case one match deeper than two) and Test_GraphBuilder_CallbackWiring.pf
(plain-name import by declared name finds every expansion;
reexport_one's declared-name fallback carries every expansion up a
level), all hand-built ComponentSpecs, no YAML.

NAG ESSENTIAL 74/74 and gfortran ESSENTIAL 74/74 both green, rebuilt
and rerun after merging PR #5561 (7f9ea09).

Plan-Task: CB5-Execute-5.1b
Landed-By: meta
Tick 5.1b in the callback tasks.md with what landed and the gfortran
StringVector trap found; update the callback plan status; add the
GFTL-VarSpecCopy entry (landed with PR #5561). Docs only.

Landed-By: meta
Brings in develop (60d2544): #5549, #5553, #5555, #5556, the
Configurable callback State mark 1 (#5544), the connection-resolution
refactor (#5505), and the revert of the accidental #5550 snapshot.

Conflict: superstructure/generic/GraphBuilder_ConnectionResolution_smod.F90.
Develop split that file into five sibling submodules
(ConnectionMatching, ConnectionDestinations, ImportExportPropagation,
PayloadMaterialization, ExpressionResolution) and folded the duplicated
dispatch/reporting blocks into push_entry, record_second_producer,
for_each_connection_pair and source_satisfies_import. This branch had
edited the old monolithic file for callback re-export and import
resolution. Resolution: took develop's file layout and re-applied the
callback changes in the new locations:
- ConnectionResolution: build_qualified_export_namespace subroutine form
  in wildcard_import_has_match; callback_zero_match_is_empty, used by
  source_satisfies_import (develop's single "already resolved?" check, which
  replaces the two copies in check_one and connection_pt_pair_resolves) via
  the subroutine form of resolve_callback_import with the rejected list.
- ImportExportPropagation: reexport_one carries every source, with
  find_export_ids_by_declared_name, reexport_add_or_merge and
  callback_exports_mergeable replacing find_export_port_by_name.
- ConnectionDestinations: resolve_callback_destination builds provider maps
  and per-match method/state bindings; resolve_wildcard_destination uses the
  subroutine namespace builder and append_qualified_export.
- GraphBuilder.F90: removed the duplicate interface for
  materialize_extension_chain that both sides had added.
- Test_GraphBuilder_CallbackRealization.pf: three failure tests expect two
  more status=1 levels, from for_each_connection_pair and its callback.

Tests: gfortran ESSENTIAL 77/77, ifx ESSENTIAL 77/77.
A callback import whose resolution failed was only logged as a warning by
the connect hook, leaving an import that looked resolved but had no
bindings. resolve_connections now collects such failures (callback_failures,
with the contract-violation report) when asked, run_connect_hook returns
them, and initialize_accept_transfer fails the phase with one message per
import. resolve_callback_destination registers the collection's reuse
entry and forward edge only after every binding succeeded. Other connect
hook steps keep their warn-and-continue policy.

Each step of resolve_callback_destination (match, materialize, provider
maps, per-member binding) sets its own failure report naming the step and
the matched member. Activate-time detection stays advisory.

Also initialise the allocatable results of get_callback_interface_name,
callback_declaration_report and normalize_rule_value on failure paths.

ESSENTIAL: gfortran 100% tests passed out of 77; ifx 100% tests passed out of 77
Change: callback-contracts-and-registry (design decision 23, task 5.2d)

Plan-Task: CB-T1-FatalCallbackReports
Landed-By: meta
…the Invoker

An Invoker works on the State it is handed (the server's own State), so no
item of the Invoker's is wired into a server member. Remove the
provides:/receives: data wiring: build_callback_provider_maps,
resolve_invoker_item_id, wire_callback_argument, the per-method put network,
pull/advance of get/put arguments, and the get/put endpoint maps of
CallbackMethodBinding. Optional arguments a server State omits are skipped
when binding; a method nothing attached to the State is a no-op.

Two owners now keep distinct member Fields and attributes; an alias member
written in place by the Invoker is seen by the owner. provides:/receives:
still parse but are ignored by binding.

Patch tests adapted (3): two_owners_have_distinct_member_fields,
two_owners_keep_own_member_attribute, alias_member_same_grid_member_write_is_in_place.
Patch tests dropped as asserting the removed model (6): the four get/put
moves_data tests (invoker/handler first), alias_member_units_mismatch_reaches_owner_field,
alias_member_same_grid_provides_reaches_owner_field. The adapted tests run
Invoker-first only; Handler-first order is left to a later task.

Tests: drop those asserting the removed model, retarget the connect-hook
binding-failure test to a materialize failure, add optional-argument,
unattached-method, no-member-edge, and storage tests.

Change: callback-contracts-and-registry
Plan-Task: CB-M1-MinimalBinding
ESSENTIAL gfortran: 100% tests passed out of 77
ESSENTIAL ifx: 100% tests passed out of 77
Landed-By: meta
…lections by path

An Invoker works on a callback member in place, so the member must share the
Invoker's grid, and its units where the interface declares a concrete unit.
build_callback_bindings_for_match now checks every bound member and fails the
binding with a message naming the argument, the Handler, the Invoker and the
differing kinds ("in this version"). A member still DEFERRED in a compared kind
fails too, naming the kind. The Invoker side is a probe spec carrying only
units and geometry (VariableSpec%make_compatibility_characteristics), so no
other kind is compared; a placeholder or undeclared interface unit compares
nothing, and an Invoker with no geometry yet compares no geometry (logged at
debug level).

provides:/receives: are now a parse-time error wherever they appear; the dead
VariableSpec callback_provides/callback_receives fields and
parse_callback_provider_map are removed. A declared method nothing attached
to the server State stays a no-op in EsmfStateMethodInvoker but logs a
warning naming the method and the State, once per State and method.

A callback member is always the owner's own storage, so realize_callback_member
no longer looks for a forward-network predecessor to alias to. The Invoker's
collection now nests each member by component path (substate DU holding the
server State MIXING_CB_DU001, so "DU/MIXING_CB_DU001" is a path lookup); an
empty path segment, or a member name that is the leading path of another,
fails with a message. The collection iterator and every member handle carry
the interface id of the Invoker's import (CallbackMemberHandle%get_interface_id)
for the lazy conformance check.

Tests: new Test_CallbackCompatibility.pf (alias and plain member on another
grid, other units, same grid and units, undeclared unit, deferred geometry);
Test_CallbackStoragePinning.pf gains get/put between an owner and an Invoker in
both sibling orders for plain and alias members, path lookup, a two-level path,
empty segments, name collision, the handle interface id, and two Invokers of
one server; parser tests flipped to rejection tests.

Change: callback-contracts-and-registry
Plan-Task: CB-M2-CompatCheck
Plan-Task: CB-M3-RealizationCleanup
ESSENTIAL gfortran: 100% tests passed out of 77
ESSENTIAL ifx: 100% tests passed out of 77
Landed-By: meta
An Invoker works in place on the server's own State; nothing of the
Invoker's is wired into a member, and a grid or units difference is a
fatal error at connect. Cross-grid and cross-units callbacks are a later
design.

design.md: new decision 24, with supersession notes on decisions 12, 13,
14, 18, 19, 20, 21 and 23. callbacks.md rewritten to the in-place model
(compatibility check, nested members, unattached methods, many Invokers).
spec/15-callbacks.md 15.10 annotated. callback-wiring spec delta: new
"A callback member shares the Invoker's grid and units" requirement with
"Mismatch is an error"; the transform, regrid-default, weighted-delta and
column-fill requirements kept and marked deferred. callback-test-tools
P1/P2 are same-grid for now; proposal.md and tasks.md (5.2b, 5.2h, 6.1,
6.5) amended.

docs only; openspec validate passes

Change: callback-contracts-and-registry
Plan-Task: CB-M4-Docs
Landed-By: meta
CallbackMemberHandle%execute runs check_callback_state_conformance on the
member State first, unless the State was checked before or the Invoker's
import declares no interface. A State that does not conform fails with the
formatted report (interface, version, Handler, State) before the method
runs and is not marked checked, so it fails again. A conforming State is
marked checked in its Info under /MAPL/callback/checked.
CallbackCollectionIterator%check_all checks every member once without
moving the iterator and reports all non-conforming members in one failure;
CallbackMemberHandle%check_conformance is the per-handle request.

The realized State records its Handler's name under /MAPL/callback/handler,
also for a Handler that declares no interface, so the report names it.
Existing storage-pinning fixtures now set mix_like as an owner would.
Docs: callbacks.md, design.md (decision 24), plan status.

ESSENTIAL gfortran: 100% tests passed, 0 tests failed out of 77
ESSENTIAL ifx: 100% tests passed, 0 tests failed out of 77

Change: callback-contracts-and-registry
Plan-Task: CB5-5.4-LazyConformance
Landed-By: meta
…2b partial)

A GCM built from YAML runs the full phase sequence with graph mode on:
MockTracerOwner offers a tracer, TurbulentMixingTestInvoker mixes it in
place through the collection iterator (one or two Invokers), hand-checked
values, both conformance failures before any mixing, and an owner with no
methods attached. The two-owner and robin (three-member) tests are written
and disabled; the four framework gaps behind them are recorded in tasks.md.

ESSENTIAL gfortran: 100% tests passed, 0 tests failed out of 77
ESSENTIAL ifx: 100% tests passed, 0 tests failed out of 77

Change: callback-contracts-and-registry
Refs: CB9-9.2b-TurbulentMixingInvoker (partial, not complete)
Landed-By: meta
…ring it

gfortran leaves the nested member, characteristic, argument and binding
maps shared with the original when a polymorphic gFTL map stores a copy
by sourced allocation, so the registering routine's local finalizers left
the stored node dangling (SIGSEGV with 3+ Handler members, invalid reads
with 2). HierarchyGraph%register_node now stores an empty node and fills
it in place with copy_from, which rebuilds each map entry by entry
(GraphStateItem, StateItemDescriptor, StateItemNode, MethodGraphNode),
and reports a failure through rc. New Test_RegisterNodeCopy (5 tests)
fails on unfixed gfortran (state-node member map, MethodGraphNode
argument maps) and under valgrind, and passes valgrind-clean on gfortran
and ifx after the fix.

Repeat evidence, after the last source edit:
ctest -R 'callback_test_gridcomp|^MAPL.generic.graph$' --repeat until-fail:20
gfortran: 40 of 40 passes (2 tests x 20 runs), 100% tests passed out of 2
ifx: 40 of 40 passes (2 tests x 20 runs), 100% tests passed out of 2
valgrind: Test_RegisterNodeCopy clean on both; lifecycle test (gfortran)
has no invalid reads.

Change: callback-contracts-and-registry
Plan-Task: CB-GapD-RegisterNodeCopy

gfortran ESSENTIAL: 100% tests passed, 0 tests failed out of 77
ifx ESSENTIAL: 100% tests passed, 0 tests failed out of 77
Landed-By: meta
… skip them

SimpleConnection, MatchConnection and ReexportConnection now do nothing,
at activate or connect, for a connection whose destination import or
source export declares a callback_interface. StateItemSpec carries the
declaration (set from the VariableSpec) and StateRegistry%declares_callback
reports it. Other connections are unchanged.

The graph handles the rest: one callback import has one collection fed by
any number of connections (extend_callback_collection, one reuse entry per
connection source), and a member is named <src_comp>/<qualified name>
(callback_member_key), so same-named Handlers of different owners stay
distinct and method bindings are keyed by that name. A Handler named
differently from the import, a YAML-declared callback import, and merged
re-exports now work. Tests that asserted the old member names are updated.

New tests: Test_CallbackLegacySkip.pf (skip and unchanged behavior), a
two-connection collection test in Test_GraphBuilder_ConnectionResolution.pf,
and lifecycle tests for two owners into one Invoker (un-disabled), a
differently named Handler, a YAML import and a re-export group. The robin
test is un-disabled as well.

Tests: gfortran ESSENTIAL 77/77, ifx ESSENTIAL 77/77 (bucy).

Status:
9.2b done. Callbacks are graph-only (owner decision 2026-12-02); member
names now carry the source component. Minor findings left open: YAML
members cannot set typekind, no MAPL_CallbackSetAttribute, a YAML callback
import must give vertical_dim_spec.

Plan-Task: CB-9.2b-Complete
Landed-By: meta
…cribers on wildcard/callback paths

After merging #5537 (propagated failures are one pFUnit exception), tests
added on the callback branch still asserted one 'status=1' / bare
exception per call level; remove them and the comments describing them.

Callback collections now mark each member export subscribed in
add_matches_to_payload, so the extend path as well as
materialize_callback_collection is covered. Test that an export consumed
only through a wildcard import, or only by a callback collection (single
and two-connection cases), has_subscribers (so freeze checks it) and that
unconsumed siblings do not.

Landed-By: meta
…AG dangling-pointer checks)

NAG's runtime checks flag a pointer taken through a function result
(state_members_ptr, get_descriptor) when the object the accessor was
called on lacks the TARGET attribute: "Reference to dangling pointer ...
Target was RETURNed from procedure ...".

- add_matches_to_payload: payload dummy is now TARGET (callers pass a
  pointer, so no change in behavior).
- Test_RegisterNodeCopy: the StateItemNode locals whose descriptor is
  taken by pointer are now TARGET.

A sweep of every `=> x%get_descriptor()/get_payload_ptr()/
state_members_ptr()` in superstructure/generic found no other receiver
without TARGET or POINTER.

Landed-By: meta
…gisterNodeCopy (NAG)

NAG's dangling-pointer check rejects an iterator taken from a map
local without TARGET.

Landed-By: meta
… by interface, warn on unwired callbacks

- StateItemNode%copy_from now copies has_subscribers_; the
  copy-keeps-every-component test sets it and asserts it. The
  MethodGraphNode and GraphStateItem copies were checked and drop no
  component. TransformGraphNode has no copy_from and still registers
  through the generic sourced allocation (not changed).
- check_callback_members_compatible builds its probe and descriptor
  inside a per-argument block. No failing case could be constructed, so
  this is not a bug fix; two-argument tests pin per-argument comparison
  (a later argument with no declared unit passes, a later argument in
  other units fails naming it).
- The "conformance checked" mark on a callback State is one flag per
  Invoker interface id (/MAPL/callback/checked/<id>), so a second Invoker
  with a different interface is checked, and the same interface still
  once. MAPL_InfoIsCallbackChecked/SetCallbackChecked take the key.
- Advertising a callback declaration while the graph does not populate
  user States logs one WARNING, on the root process only, on the
  component's logger (the legacy connections skip such a declaration and
  nothing else wires it). The legacy layer is unchanged. Tests at the advertise
  seam: one warning in registry mode (not repeated by a second advertise),
  none when the graph populates user States.
- Docs: GLOSSARY, ARCHITECTURE, dependency-network.md and
  spec/06-dependency-network.md no longer describe a callback put
  network (the only write-back network is the inout return edge);
  callbacks.md and the callback design note describe the per-interface
  checked mark.

Tests: gfortran ESSENTIAL 77/77, ifx ESSENTIAL 77/77 (bucy)

Plan-Task: CB-ReviewFixes
Landed-By: meta
…-grid connect failures

Through the real lifecycle (a GCM built from YAML, the test Invoker, mock
tracer owners):

- four owners on the Invoker's grid, one per bottom boundary
  (neumann_homogeneous, neumann, robin, dirichlet): hand-solved columns,
  the budget identity sum m dc = dt F_realized, and one number the
  Invoker's own sum does not supply (flux 0, flux constant, -rho v_d c_L,
  pinned value);
- an owner with a different air mass per layer ([1, 3]): mass-weighted
  total unchanged and the exact column;
- owners failing before any mixing: no air_mass (fails at connect), robin
  without dry_deposition_velocity, an unknown member key; and an owner
  with dry_deposition_velocity bound under neumann_homogeneous, which the
  framework accepts and the Invoker rejects;
- a coarser and a finer owner fail at connect, naming the argument, the
  Handler, the Invoker and the geometry, with "cross-grid/units callbacks
  are not supported yet".

MockTracerOwner takes an air_mass list and one extra member attribute.
tasks.md 9.4 records the coverage per label, and says what is not
asserted (no inserted transform node); the callback-wiring spec's M1
scenario no longer mentions a transform report and notes that only its
cross-grid parts are deferred.

Tests: gfortran ESSENTIAL 77/77 passed; ifx ESSENTIAL 77/77 passed.

Plan-Task: CB-9.4-minimal
Landed-By: meta
…nly 'z'

The declaration-level conformance check classified a member from its
vertical info alone, so a rank-1 'dims: z' member with a stagger (possible
since 5.1a) was read as 'xyz' and accepted by an interface declaring
'xyz'.

- The argument-dims vocabulary gains 'z' (vertical only): the
  CallbackArgumentSpec constructor accepts it, the registration-file
  loader validates 'dims:' with its own message listing the legal values
  (xyz, xy, z), and the test Handler rejects a 'z' argument loudly instead
  of building a 2-D field for it.
- member_dims reads the member's horizontal dims spec together with its
  vertical info: gridded + vertical = xyz, gridded only = xy, vertical
  only = z. A member with neither is reported as a dims mismatch ("has no
  horizontal or vertical dims"). A mirrored or unset spec stays
  undeterminable and skipped.
- Tests: a 'dims: z' member against xyz (rejected, was accepted) and z
  (accepted) interfaces, at the export check and at connect; xyz and xy
  members against a z interface; the no-dims member against all three;
  a mirrored horizontal spec is skipped; the loader accepts 'dims: z' and
  names the legal values on a bad one; the constructor test that rejected
  'z' now accepts it and rejects 'yz'; the test Handler rejects a 'z'
  argument by name (and its message no longer says only "xy or xyz").

tasks.md 5.1c is marked done; design.md records the vocabulary; the
registration-file spec lists 'z'.

Tests: gfortran ESSENTIAL 77/77 passed; ifx ESSENTIAL 77/77 passed.

Plan-Task: CB-5.1c
Landed-By: meta
…clared dims

Dims were checked at connect on declarations only, so a Handler State
whose member had the wrong rank conformed and the Invoker failed later
inside its solver with a pointer rank error.

The realized-State check now compares each FIELD member with its
argument's declared dims, using the geom's dimension count g, the rank and
the ungridded-dim count: xyz is rank g + 1 with one ungridded dim (the
vertical), xy is rank g with none, z is rank 1 with one. The recorded
vertical stagger tells the vertical from another ungridded dim, so a 2-D
field with one ungridded dim is not accepted as xyz; a field MAPL did not
build (no stagger recorded) gets the benefit of the doubt. On a mesh or
location stream (g = 1) the ungridded count is what tells xy from z. The
violation names the argument, the rank found with what it is as far as
known (dims, or its ungridded count) and the rank and dims expected; the
report header names the Handler. The interface cannot declare other
ungridded dims, so a field carrying one is a mismatch too. The rules are
recorded in the conformance spec (with a rank-mismatch scenario) and in
design decision 9.

Tests (Test_CallbackStateConformance): an xyz argument bound to a 2-D
field; an xy argument bound to a 3-D and to a vertical-only field; a z
argument with a vertical-only field (conforms) and a 3-D one; an extra
ungridded dim; a 2-D field with an ungridded dim bound to xyz; a location
stream and a mesh. The hand-built xyz members in the existing tests are now 3-D.
End to end (Test_TurbulentMixingLifecycle): a member left at the default
dims xy that aliases a 3-D item connects, fails the first run with the
conformance report, and mixes nothing.

Tests: gfortran ESSENTIAL 77/77 passed; ifx ESSENTIAL 77/77 passed.

Plan-Task: CB-RankCheck
Landed-By: meta
… for M1; 9.4 done

M9: a robin owner (dry_deposition_velocity 5, air mass [1, 3], heat) whose
column starts with an exact zero is mixed for two steps by the real
Invoker. Every layer stays >= 0 (the step does no fill or clipping), the
columns equal the hand-solved ones ([9,18]/19 and [144,117]/361), and
the budget closes. An off-diagonal sign error in the operator would give
a negative top layer on step 1. The mock owners have a constant kappa per
class, so a non-uniform kappa stays solver level.

M1: the Invoker's collection entry is the owner's own export NodeId (a
copy or snapshot would carry another), and no TransformGraphNode is the
entry or a forward-network neighbor of the entry or its members.

tasks.md: 9.4 ticked; the budget closure and column fill of M3 and M4
stay deferred to 6.5.

Tests: gfortran ESSENTIAL 77/77 passed; ifx ESSENTIAL 77/77 passed. Seeded guards: an always-true transform check fails the M1 test; a flipped off-diagonal sign in the solver fails the M9 test (and the other mixing tests).

Plan-Task: CB-9.4-addendum
Landed-By: meta
…ser guide

Rewrite docs/graph/callbacks.md as one document: a page-length overview
with the turbulent_mixing worked example (who declares what, what the
Invoker calls, what happens on a grid mismatch), then the contract, the
registration file and registry, Handler and Invoker declarations,
conformance (connect-time and lazy realized-level checks), matching and
binding at connect, the compatibility check, in-place execution, the
same-grid limit, the test tools, what is not built, and open items.
Corrects statements the code contradicts: the callback source paths,
the registry's public procedures, the file holding reexport_one, the
predicate callers of callback_zero_match_is_empty.

Add docs/user_guide/docs/callback_registration_file.md (location, format,
the shipped turbulent_mixing entry, the start-up report, duplicate-key
behavior, writing a Handler and an Invoker, the Invoker coding rule, and the
common error messages taken from the tests) and link it from the user
guide README as 3.12.

Tick 10.1 and 10.2 in the callback change's tasks.md; 10.3 stays open and
is deferred until the branches converge.

docs only; ctest not run

Plan-Task: CB-10-Docs
Landed-By: meta
MaplFramework%initialize reads mapl: graph_mode (registry default, both,
graph) after loading the callback registration file and sets graph mode,
graph ownership of the user States and extension materialization
together (mapl_GraphModeConfig_mod). Any other value fails naming the
key; both logs one warning line; no environment variable. The
unwired-callback warning now names the key. Docs and the callback tasks
list updated.

Tests: gfortran ESSENTIAL: 100% tests passed, 0 tests failed out of 80
Tests: ifx ESSENTIAL: 100% tests passed, 0 tests failed out of 80

Plan-Task: CB-GraphModeSwitch-A
Landed-By: meta
@tclune tclune added 🚫 Contingent - DNA Do Not Approve (DNA). These changes are contingent on other PRs 0 Diff The changes in this pull request have verified to be zero-diff with the target branch. Changelog Skip Skips the Changelog Enforcer labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

This PR is being prevented from merging because you have added one of our blocking labels: 🚫 Contingent - DNA. You'll need to remove it before this PR can be merged.

@tclune
tclune marked this pull request as ready for review December 4, 2026 01:20
@tclune
tclune requested a review from a team as a code owner December 4, 2026 01:20

This branch has not been deployed

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

Labels

0 Diff The changes in this pull request have verified to be zero-diff with the target branch. Changelog Skip Skips the Changelog Enforcer 🚫 Contingent - DNA Do Not Approve (DNA). These changes are contingent on other PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants