Skip to content

Remove the experimental learned-damage route - #15

Merged
allamaprabhuani merged 1 commit into
mainfrom
remove-learned-damage
Oct 12, 2026
Merged

allamaprabhuani merged 1 commit into
mainfrom
remove-learned-damage

Conversation

@allamaprabhuani

Copy link
Copy Markdown
Contributor

Summary

This removes the experimental learned-damage route. It is not part of the released solver scope, and the teaching material does not use it. After this change the classical phase-field damage solve is the only damage-subproblem route.

What was removed

  • phast.learned_damage and its package-level exports (DamageDecision, DamagePrediction, DamagePredictionRejected, DamagePredictor, DamageStepContext, DamageUpdateController, load_damage_predictor)
  • The phast.training package
  • examples/learned_damage/ and docs/user_guide/learned_damage.md
  • tests/test_learned_damage.py, tests/test_mesh_graph_net_adapter.py and tests/test_damage_step_context_fem_helpers.py. The last file is removed in full because every test in it exercised DamageStepContext methods.
  • The solver configuration fields damage_update, damage_predictor, damage_checkpoint, damage_predictor_options, damage_residual_rtol, damage_residual_atol, damage_bound_tolerance and damage_fallback. These are removed from SolverConfig and SolverSettings, together with:
    • their __post_init__ checks
    • the enum, range and cross-field validation
    • the schema-v2 adapter check
    • their configs/REFERENCE.yaml entries
  • From StaggeredSolver:
    • set_damage_predictor and clear_damage_predictor
    • the per-step context builder
    • the controller branch in step_solve_damage
    • the update and last_route route-report fields and the predictor print block
  • The AIBridge class
  • FEMOperators.compute_physics_loss, which had no remaining callers
  • The learned-damage and deep-learning lines in phast doctor

Documentation

  • docs/tutorial/03_modular_fem_and_learned_damage.md is renamed to docs/tutorial/03_modular_fem.md, retitled "Modular fracture problems", and keeps only its finite-element content.
  • Links are updated in:
    • docs/index.md
    • docs/tutorial/index.md
    • tutorials 05 and 06
    • README.md
  • The two learned-damage rows are removed from the capability matrix, and the related entries from DOCUMENTATION_STYLE.md.
  • Docstrings and comments in the staggered solver, damage solver and io_utils no longer describe the generic hooks in terms of learned models. set_damage, get_H_nodal, compute_edge_index and the stored edge_index dataset keep their names and behaviour.

Schema

configs/phast.schema.json was regenerated with python -m phast schema --output configs/phast.schema.json. As well as dropping the removed fields, the regeneration adds the rational_at2 degradation option and the stress_degradation field. Both already exist in the code but were missing from the checked-in schema.

Tests

  • Baseline on main (1c379fd): pytest -q tests gave 467 passed.
  • This branch: 432 passed. The 35 tests no longer present are:
    • the 34 tests in the three deleted learned-damage test files
    • the learned case of test_unsupported_choices_fail_before_execution
  • A set comparison of test IDs confirms that every other test that passed on main still passes.
  • sphinx -W -b html docs builds without warnings: 54 pages, down from 55 because the learned-damage guide is gone. It also builds cleanly with PHAST_NB_EXECUTION_MODE=force, matching the docs workflow.
  • The core CI steps pass locally:
    • python -m phast doctor
    • the five --validate-only configurations
    • the retained DCB replot
  • A configuration that still sets solver.damage_update is now rejected as an unknown field, in both the legacy and the schema-v2 input paths.

The learned-damage route is not part of the released solver scope, so it
is removed together with its configuration, documentation and tests. The
classical damage solve is now the only damage-subproblem route.

Removed:
- phast.learned_damage and the phast.training package
- examples/learned_damage and docs/user_guide/learned_damage.md
- tests for the learned-damage controller, step context and mesh-graph
  adapter
- SolverConfig and SolverSettings fields damage_update, damage_predictor,
  damage_checkpoint, damage_predictor_options, damage_residual_rtol,
  damage_residual_atol, damage_bound_tolerance and damage_fallback, with
  their validation, schema and REFERENCE.yaml entries
- StaggeredSolver.set_damage_predictor, clear_damage_predictor, the
  per-step context builder, the route-report predictor fields and the
  AIBridge class
- FEMOperators.compute_physics_loss, which had no remaining callers
- the learned-damage guidance in phast doctor

The modular-FEM tutorial is renamed to 03_modular_fem.md ("Modular
fracture problems") and keeps only its finite-element content. The
regenerated phast.schema.json also picks up the rational_at2 degradation
and stress_degradation entries that the checked-in file was missing.
@allamaprabhuani
allamaprabhuani marked this pull request as ready for review October 12, 2026 13:33
@allamaprabhuani
allamaprabhuani merged commit ccf5c3c into main Oct 12, 2026
8 checks passed
@allamaprabhuani
allamaprabhuani deleted the remove-learned-damage branch October 12, 2026 13:34
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