Skip to content

CoDiPack gradient validation only seeds single output — incomplete for multi-component cost functions #31

@justinh2002

Description

@justinh2002

File: src/c/cores/controlvalidation_core.cpp:201

Code:

codi_global.setGradient(0, 1.0); // TODO: This is different form J. Also: Only one output is seeded and not all.

When validating gradients with CoDiPack, only output index 0 is seeded with weight 1.0.
For inversions with multi-component cost functions (e.g. combined velocity + thickness misfits),
the gradient check is incomplete — it tests only the first dependent, not the full Jacobian row.

ADOL-C handles this more carefully with per-dependent registration. The CoDiPack path needs
equivalent treatment, otherwise controlvalidation may silently pass on incorrect gradients.

Impact: High — affects correctness of AD gradient validation for all multi-objective inversions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    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