Skip to content

Reject averaging for database conductors - #932

Merged
agianno merged 1 commit into
gprMax:masterfrom
fallenmi:codex/material-db-conductor-averaging
Oct 23, 2026
Merged

agianno merged 1 commit into
gprMax:masterfrom
fallenmi:codex/material-db-conductor-averaging

Conversation

@fallenmi

Copy link
Copy Markdown
Contributor

Summary

Keep perfect-conductor averaging consistent at the material-database boundary:

  • reject explicit averagable: true for builtin PEC/PMC and constant materials with infinite electric or magnetic conductivity;
  • export perfect conductors with averagable: false, keeping generated entries loadable;
  • align the JSON schema and documentation, and add loading/building/export regression and compatibility cases.

For example, this material entry currently overrides the loader's correct non-averagable conductor default:

{"model": "builtin", "builtin": "pmc", "averagable": true}

Focused loader → builder → averaging probes show that this allows a conductor into smoothing and, with a smoothed dispersive neighbour, can produce a pole-bearing conductor compound which the direct dispersion builder rejects. This is an input/export contract fix, not a claim of demonstrated NaNs, incorrect simulation fields or solver instability.

Compatibility

This intentionally rejects previously accepted JSON that explicitly requests averaging for a perfect conductor. Omitted flags and explicit false remain accepted. Finite-material/free-space flags remain unchanged. The focused legacy-parser compatibility cases omit the flag and remain loadable; the full geometry/HDF5 converter was not run.

Verification

  • Independent focused harness: 76 passed, including 29 existing pure-database controls, the new regression cases, real Draft2020-12 schema validation and two exact legacy-parser controls. Ten intended loader/export/schema regression failures were observed against unchanged production code.
  • The harness executes the real loader/builder/exporter/averaging logic with disclosed namespace/configuration bootstrap and annotation-only grid seams. It is not a full installed-package test-module, geometry, solver, MPI or GPU run.
  • Normal pinned pre-commit run --all-files --show-diff-on-failure executed on actual BASE and PATCH checkouts. Both are not green: they produce the same 411 formatting changes outside this four-file proposal. The existing import reorder in the touched test module is also identical on both sides and is not included here. The one new assertion was folded exactly as pinned Black requests; no unrelated formatting is included.
  • Final Python sources compile and have literal ASTs identical to the independently tested proposal; git diff --check passes. No full upstream CI result is claimed by these local checks.

AI assistance

Claude Code prepared the patch and regression-test draft. Codex independently reviewed the public contracts, performed the scoped tests and paired normal-hook comparison, and handled integration and publication. The only final change to that tested proposal is the assertion's formatting described above.

@agianno
agianno merged commit 8d01044 into gprMax:master Oct 23, 2026
14 checks passed
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.

2 participants