Skip to content

Validate Enzyme gradient against raw force#45

Open
krystophny wants to merge 18 commits into
developfrom
ad-11-enzyme-gradient-raw-force
Open

Validate Enzyme gradient against raw force#45
krystophny wants to merge 18 commits into
developfrom
ad-11-enzyme-gradient-raw-force

Conversation

@krystophny

Copy link
Copy Markdown
Member

Summary

  • Extend gvec_enzyme_ad_fixture_gradient to fetch EvalForceRawProjected through pyGVEC.
  • Compare Enzyme dW/dq to -raw_force on all free DOFs reported by the existing interior-DOF API.
  • Keep boundary-constrained DOFs excluded from the raw-force sign check.

Verification

Test fails before this PR

rg 'get_raw_projected_force|rawForce|raw_force' test-CI/enzyme/gvec_enzyme_ad_fixture_gradient.F90
# no matches, exit code 1

Test passes after fix

cmake --build /tmp/gvec-enzyme-ad10f --target gvec_enzyme_ad_fixture_gradient -j$(nproc)
ctest --test-dir /tmp/gvec-enzyme-ad10f -R 'gvec_enzyme_ad_fixture_gradient' --output-on-failure

100% tests passed, 0 tests failed out of 1
ctest --test-dir /tmp/gvec-enzyme-ad10f -R 'gvec_enzyme_(smoke|array_gradient|rz_flat_gradient|gvec_module_smoke|ad_fixture_gradient)' --output-on-failure

100% tests passed, 0 tests failed out of 5
git diff --check -- test-CI/enzyme/gvec_enzyme_ad_fixture_gradient.F90
# no output

fo
fo: no Fortran project detected

@krystophny krystophny force-pushed the ad-11-enzyme-gradient-raw-force branch from 648cada to 25e7aa5 Compare July 9, 2026 20:01
@krystophny krystophny force-pushed the ad-11-enzyme-gradient-raw-force branch from 25e7aa5 to 3a742db Compare July 9, 2026 20:46
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