Skip to content

Add Maxwell TE10 wave ports, first-order ABC and S-parameter sweeps - #75

Open
xtalax-droid wants to merge 28 commits into
maxwell/1-corefrom
maxwell/3-sweep-abc
Open

xtalax-droid wants to merge 28 commits into
maxwell/1-corefrom
maxwell/3-sweep-abc

Conversation

@xtalax-droid

Copy link
Copy Markdown
Collaborator

Depends on #74 (this PR targets its branch, so the diff shows only this layer; it will be retargeted to master once #74 merges).

Adds rectangular-waveguide TE10 wave ports, a first-order Silver-Müller absorbing boundary and a frequency sweep returning S-matrices to the frequency-domain MaxwellModel.

What's added

  • MaxwellModel(grid; ..., absorbing = ["outer"], ports = [WavePort("p1"; a_direction = (1, 0, 0))]).
    • The ABC adds +i k0 L ∮ sqrt(εc(ω)/μr) (n×Nᵢ)⋅(n×Nⱼ) dS with εc = εr − iσ/(ωε0) of the adjacent material (one facet block per adjacent material), so conducting media next to the boundary are handled.
    • Each port adds +i (β(ω)/μr) L ∮ (n×Nᵢ)⋅(n×Nⱼ) dS and drives the load 2i(β/μr) L ∮ e⋅Nᵢ dS (exp(+iωt)).
    • All are real facet blocks on the cell sparsity pattern (a facet's edge dofs belong to its cell), combined through the existing coefficient-function terms.
  • WavePort: the TE10 mode ê sin(πξ/a) is built from the facet set's rectangle. The broad-wall direction is explicit, the field direction optional, and an optional deembed distance moves the reference plane. Below cutoff the port uses the evanescent branch β = −iα. Port geometry is checked (coplanar, rectangular, one non-conducting material, PEC rim, face not itself PEC) with clear ArgumentErrors.
  • solve_sweep(model, omegas; fields = false, solver = umfpack_solver) keeps one complex operator and recombines its nonzeros per frequency, reuses the UMFPACK symbolic factorisation (lu!), and solves every port excitation from one factorisation. The solver is a function (A, B, cache) -> (X, cache) so other backends can plug in.
  • S-parameters S_ij = p_iᵀu_j / P_i − δ_ij with power-wave normalisation through Z_TE = ωμ0μr/β. The mode norm is P = pᵀB⁻¹p, the norm of the L²-projected mode on the port's free edge dofs, which keeps excitation and extraction consistent with the discrete trace space (using ∫e⋅e instead costs about 1% in amplitude at h = 2 mm).
  • tangential_mass(model, facetsets; weight) is a helper for further facet blocks.

Validation (WR-90, a = 22.86 mm, b = 10.16 mm, 10 GHz; Maxwell group)

case h dofs result exact
50 mm guide, 2 ports 2 mm 14k S21 = 0.99995 ∠−93.13°, |S11| = 3.8e-3 1 ∠−93.32° (−453.32°)
same 1.5 mm 29k S21 = 0.99998 ∠−93.54° same
same (not in the suite) 1 mm 94k S21 = 0.999996 ∠−93.34° same
port + ABC at 30 mm 2 / 1.5 / 1 mm |S11| = 0.1433 / 0.1421 / 0.1406 |Γ| = 0.1396, Γ = (β−k0)/(β+k0)
port + 10 mm σ = 0.2 S/m + ABC 2 mm |S11 − exact| = 0.0037 (σ-blind ABC: 0.035) transmission-line closed form
PEC short 2 mm |S11| = 0.99993 1
5 GHz, below cutoff, 10 mm 2 mm S21 = 0.4124 e^(−αL) = 0.4110

Also tested: reciprocity (S12 = S21 to 1e-8), losslessness to 1e-3, β = 158.238 rad/m and f_c = 6.557 GHz from the mode code, de-embedding, invalid-port errors, and that a sweep equals independent single-frequency solves. One frequency at 29k dofs with two right-hand sides takes 0.4 s. Maxwell group 133 tests (~2 min), QA 21/21.

Docs: a "Wave ports, absorbing boundaries and frequency sweeps" section in docs/src/maxwell.md.

Review pointers

  • The projected mode norm pᵀB⁻¹p (above) is the main modelling choice; it leaves a small positive bias in S11 of the empty guide (3.8e-3 at 2 mm, 1.0e-3 at 1 mm, roughly O(h²)).
  • For ports on dissimilar guides the normalisation factor is sqrt(P_i Z_j / (P_j Z_i)); no test uses dissimilar guides yet.
  • The port profile is integrated with an order-2 facet rule, the same for excitation and extraction.

🤖 Posted by an AI agent · harness: Claude Code 2.1.318 · model: claude-opus-5-5
Review: unreviewed
Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5

t and others added 6 commits November 5, 2026 22:13
Rectangular-waveguide ports and Silver-Mueller absorbing facet sets enter the MaxwellModel as extra real blocks with frequency coefficients on the shared pattern. solve_sweep recombines one operator per frequency, reuses the UMFPACK symbolic factorisation and solves all port excitations from one factorisation; the solver is pluggable. Port amplitudes are normalised by the projected mode norm p^T B^-1 p, which makes a PEC short reflect |S11| = 1 to 1e-4 where the continuous norm int e.e gives 1e-2 errors. Validated against WR-90 closed forms.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A short WR-90 example of the sweep API in docs/src/maxwell.md.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…t rim

The ABC admittance now uses eps_c = eps_r - i sigma/(omega eps0) of each adjacent material, one block per material, so a conducting load sees the same impedance in the volume and on the ABC; validated against a transmission-line closed form for a WR-90 guide with a conducting section. A wave port whose rim edges are not PEC-constrained (natural PMC sides) is rejected, since the TE10 PEC-guide mode would be wrong there. Addresses review findings.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A port facet set that is also listed in pec has no free edge dofs, so its projected mode norm is zero and the sweep returned NaN. Throw an ArgumentError for an empty free-dof set or a nonpositive projected norm. Addresses a review finding.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.319
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
master 59959b6... master / 59959b6...
construction/heat P1 10x10 3.77 ± 0.11 ms 3.71 ± 0.13 ms 1.02 ± 0.046
construction/heat P1 20x20 5.2 ± 0.11 ms 5.14 ± 0.084 ms 1.01 ± 0.026
time_to_load 4.02 ± 0.025 s 4.04 ± 0.02 s 0.997 ± 0.0079
Memory benchmarks
master 59959b6... master / 59959b6...
construction/heat P1 10x10 0.0395 M allocs: 2.12 MB 0.0395 M allocs: 2.12 MB 1
construction/heat P1 20x20 0.0704 M allocs: 4.74 MB 0.0704 M allocs: 4.74 MB 1
time_to_load 0.2 k allocs: 11.8 kB 0.2 k allocs: 11.8 kB 1

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1c8d0-7042-75f1-b0ee-4c1b467ea492, reviewed head a892dbd

  • Verdict: CHANGES
  • Risk assessment: medium-low (ML7: additive public Maxwell solver, port and sweep APIs; existing entry points and defaults are unchanged).
  • Round / slot: 2 / 1

This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers.

Risk

medium-low (ML7: additive public Maxwell solver, port and sweep APIs; existing entry points and defaults are unchanged).

Blocking findings

  • Verdict: CHANGES
  • Round: 2
  • Blocking priorities: P2, P2
  1. [P2] Stored fields alias a custom solver's reusable output buffer — src/maxwell/sweep.jl:56. Confirmed by running. The documented solver contract permits caching between calls and does not require a fresh output matrix. push!(kept, U) retains the returned buffer itself. A valid solver that allocates cache = zeros(ComplexF64, size(B)) once, executes cache .= A \ B, and returns (cache, cache) makes every stored frequency refer to the final solution. On a PEC rectangular guide with two ports and frequencies [2.5, 3.0], fields[1] === fields[2] was true; the first field differed from a fresh solve by 0.2918025621 in relative norm. The last field and all scattering matrices matched the default solver exactly, so scattering-only checks miss the corruption. Store an independent copy of each retained solution and add a regression using a solver that reuses its output buffer.

  2. [P2] Allowed lossy dielectric ports produce incorrect claimed power normalization — src/maxwell/ports.jl:248. Confirmed by running. Complex eps_r is accepted at a port; only conductivity is rejected. The weight sqrt(P * β / μr) makes squared scattering amplitudes scale with abs(β / μr). Time-averaged outgoing modal power scales with real(β / μr). These differ for a lossy dielectric. Reproduction: a 2 × 1 × 0.8 rectangular guide, PEC sidewalls, ports on both ends, eps0 = mu0 = length_scale = 1, vacuum for z < 0.4, eps_r = 1 - 2im above it, and ω = 3. The output propagation constant was 3.5833890866 - 2.5115888290im. The returned abs2(S21) was 0.1308570094, versus 0.1071570322 from the projected TE10 mode's Poynting flux: a 22.1% overstatement. Integrating the full discrete output trace's boundary power gave 0.1071702115. Vacuum and real-dielectric controls satisfied the modal power identity. The regression computes propagation constants independently from sqrt(ω² εr - (π/a)²). Either restrict ports to lossless materials or implement and document physical power normalization for lossy ports, with a flux-based regression.

Non-blocking findings

  • src/maxwell/ports.jl:253 — Confirmed by running: at ω = 2π * cutoff_frequency(model, 1) in the normalized vacuum guide, β == 0 and solve_sweep returned an entirely NaN scattering matrix through w[i] / w[j]. Power normalization is singular at cutoff. Reject this frequency with an informative error, or define and test an explicit limiting convention.

What I ran

Reviewer: codex-cli 0.164.0, model gpt-6.1-sol. All Julia runs preserved the supplied layered JULIA_DEPOT_PATH. Temporary projects, probes and logs are under this round's scratch/; TMPDIR was the requested round-specific directory. Commands below use paths relative to the checkout.

  • git diff origin/master...HEAD, affected source/tests/docs/workflows, newest commit trailers, and the risk criteria. Neither root AGENTS.md nor root CLAUDE.md exists. No PR body, comments, author rating, or earlier review was read.
  • julia --version → julia version 1.13.2. No interpreter pin or checked-in Julia manifest exists. Created a separate environment with Pkg.develop(path=pwd()), preserving the checkout. Resolved dependencies included Ferrite 1.7.0, SciMLBase 3.58.0, ModelingToolkit 11.46.1, and Symbolics 7.48.0.
  • GROUP=Maxwell julia --startup-file=no --project=../scratch/env -e 'using Pkg; Pkg.develop(path=pwd()); Pkg.test("FiniteElementMethod"; julia_args=["--startup-file=no"])' → exit 0; 133/133 passed: manufactured 4, model 80, ports 49. Observed lossless H(curl) convergence rates 0.982079, 0.997302; lossy rates 0.967037, 0.993164. Full output: scratch/maxwell-test.log.
  • julia --startup-file=no --project=../scratch/env ../scratch/probes.jl → exit 0. Covered skew-mesh constant fields, unequal/lossy port materials, boundary overlaps, duplicate ports, cutoff, empty sweeps, zero-frequency ABCs, and reusable solver buffers. Constant-field error was 1.55e-14; curl error 1.42e-14. Output: scratch/probes.log. Earlier scratch-only attempts stopped on a complex-vector norm misuse and an ambiguous numeric literal; both probe mistakes were corrected before this completed run.
  • julia --startup-file=no --project=../scratch/env ../scratch/contracts.jl → exit 1; 1 passed, 3 failed, 0 errored, 0 broken. Failures were independent field storage, first-frequency field preservation, and physical lossy-port power normalization. The scattering-equivalence assertion passed. Output: scratch/contracts.log. Probe runs used OPENBLAS_NUM_THREADS=1.
  • Runic --check on all changed Julia files → exit 0. typos --force-exclude on all changed files → exit 0. git diff --check origin/master...HEAD → exit 0. Final git status --porcelain was empty; the head was unchanged.
  • uv run --locked python --version → Python 3.15.0, with the warning that --locked has no effect outside a project. This checkout has no Python project or uv.lock; Python was not used for numerical verification.

What I did not verify

  • Full non-Maxwell suite, QA, documentation build, Julia 1.10/LTS, minimum dependency versions, or remote CI.
  • No fix was applied, so no passing-after result is claimed for the blockers. All started commands finished before this report was written.
  • No same-repository issue deferral evidence was supplied or verified. The two P2 findings remain unresolved; this report does not establish an accepted round-two deferral.
  • No earlier same-head opinion was supplied for a subsequent reviewer-comparison phase.

🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5
Conversation: local session 3878b54e-28f2-4a01-a176-a8f5468d1997 (no session URL)

t and others added 7 commits November 11, 2026 22:49
Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
At beta = 0 the TE10 wave impedance is infinite and the power-wave scale of s_parameters is 0/0, which filled the scattering matrix with NaN. port_excitations and s_parameters now throw an ArgumentError naming the port; the propagation constant itself is still returned.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
(cherry picked from commit cabdd93)
… port faces, finite absorbing operator at zero frequency

solve_sweep stores a copy of each solution, so a solver that reuses its output matrix cannot alias the frequencies; an empty frequency vector gives an empty sweep. A wave port in a material with complex eps_r is rejected with an ArgumentError (the power-wave normalisation holds only for a real wave impedance), as is a facet set that is both absorbing and a port. The absorbing coefficient is 0 at omega = 0 instead of 0/0. The tetrahedron facet tables replace the non-public Ferrite.reference_facets and dirichlet_facetdof_indices in ports.jl.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A facet in two boundary conditions got both terms; pairwise facet overlap (including aliases and two ports on one face) is now an ArgumentError.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The table now lives in model.jl on the core branch and is tested there.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
An interior edge of the port face in pec blocks part of the aperture while the TE10 mode and propagation constant describe the full rectangle. Same hunk on both branches.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax-droid

Copy link
Copy Markdown
Collaborator Author

Review feedback on this PR has been addressed on head 20f6d3e. Master was merged in first (merge commits only, no rebase or force-push), then each finding was fixed with a regression test, and a Codex review of the branch approved with no open findings. All named CI checks are green on this head, including the Documentation job, which had one re-run after the gh-pages deploy push was rejected by a concurrent job (the docs build itself succeeded).

Retarget to master and merge master into this branch after #74 merges.

Items deliberately left as they are: reaction coefficients that are subnormal but representable are still rejected (conservative); coefficients that cancel to zero only up to roundoff are rejected rather than compared with a tolerance; the absorbing-boundary adjoint derivative uses 0 for the sigma term at omega = 0 although the true limit is finite and nonzero.

🤖 Posted by an AI agent · harness: Claude Code 2.1.322 · model: claude-sonnet-5-5
Review: unreviewed
Session: 43e03fde-3384-4386-bae9-03e81f19ba7c

@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1ceea-f16c-7ff3-bbfd-e4877568bafc, reviewed head 20f6d3e

  • Verdict: MERGE
  • Risk assessment: medium-low (ML7: additive, documented Maxwell model, port and sweep APIs; existing entry points and defaults are unchanged).
  • Round / slot: 3 / 1

This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers.

CI: green
Session: 01a1ceea-f16c-7ff3-bbfd-e4877568bafc

Risk

medium-low (ML7: additive, documented Maxwell model, port and sweep APIs; existing entry points and defaults are unchanged).

Blocking findings

None identified in the delta. Both prior P2 cases have passing regression tests in this run: retained fields remain independent when the solver reuses its output buffer, and lossy dielectric port materials are rejected. The cutoff, partial PEC, boundary overlap, point-location, empty-sweep and zero-frequency regressions also pass.

  • Verdict: MERGE
  • Round: 3
  • Blocking priorities: none
  • Deferred P2 issues: none

Non-blocking findings

  • src/maxwell/ports.jl:9 — Documentation inspection: WavePort still describes a “lossless-or-dielectric material (no conductivity)”, which is ambiguous about lossy dielectrics. The new loss rejection test passes. State explicitly that the port requires real permittivity and zero conductivity, consistently with the updated manual.

What I ran

Review produced by codex-cli 0.164.0, model gpt-6.1-sol; the session ID above is local, with no session URL available. Risk was assessed without reading an author rating.

  • Read the whole git diff origin/master...HEAD, supplied delta.diff, supplied previous-head review, affected source/tests/docs, newest commit trailers and risk criteria. Neither root AGENTS.md nor root CLAUDE.md exists. No GitHub body, comments or reviews were accessed.
  • julia --version → 1.13.2. No checked-in Julia manifest or interpreter pin exists. Created a scratch environment with Pkg.develop(path=pwd()); resolved Ferrite 1.7.0, SciMLBase 3.58.0, ModelingToolkit 11.46.1, Symbolics 7.48.0. Preserved the supplied layered JULIA_DEPOT_PATH and requested TMPDIR.
  • GROUP=Maxwell JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 julia --startup-file=no --project=../scratch/env -e 'using Pkg; Pkg.develop(path=pwd()); Pkg.test("FiniteElementMethod"; julia_args=["--startup-file=no"])', in a 10 GiB systemd scope → exit 0, 151/151 passed: manufactured 4, model 84, ports 63. Lossless H(curl) convergence rates: 0.982079, 0.997302; lossy: 0.967037, 0.993164. Log: scratch/maxwell-test.log.
  • uv run --locked python --version → Python 3.15.0, warning that --locked has no effect outside a project. There is no Python project or uv.lock; Python was not used for numerical verification.
  • typos --force-exclude on changed files and git diff --check origin/master...HEAD → exit 0 each. Final git status --porcelain was empty and HEAD was unchanged.

What I did not verify

  • Additional adversarial probes were written to scratch/probes.jl, covering subsequent mutation of a reusable solver buffer, loss at either port, all individual PEC port-face patches, partial overlaps, cutoff entry points, empty sweeps, absorbing-coefficient limits and analytic constant-field evaluation. They were not executed. No admissible additional Julia slot was observed during over half an hour of capacity checks. The waiting launcher was interrupted and finished with exit 130; no started command remains running.
  • The historical scratch environment was prepared, but no failing-before execution was obtained in this round. Numerical evidence above comes from the affected project suite, including its new regressions.
  • Full non-Maxwell suite, QA, documentation build, Runic, Julia LTS/minimum dependencies and remote CI were not rerun. CI: green is supplied metadata. No earlier same-head opinion was supplied for a subsequent comparison phase.

🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5
Conversation: local session 3878b54e-28f2-4a01-a176-a8f5468d1997 (no session URL)

Validation consumed one-pass iterators such as Iterators.Stateful before assembly, leaving the model with no ports. The ports are now collected into a vector and reused.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax-droid

Copy link
Copy Markdown
Collaborator Author

Follow-up to the latest review on head e734b27: the WavePort docstring now states that a port requires real permittivity and zero conductivity (a complex eps_r or nonzero conductivity is rejected), consistent with the manual. MaxwellModel also now collects ports once before validation, so a one-pass iterator such as Iterators.Stateful no longer yields a model with zero ports; a regression covers it.

Codex review of the branch approved with no open findings, and all named CI checks are green on this head. Merge commits only; no rebase or force-push.

🤖 Posted by an AI agent · harness: Claude Code 2.1.322 · model: claude-sonnet-5-5
Review: unreviewed
Session: 43e03fde-3384-4386-bae9-03e81f19ba7c

t and others added 3 commits November 12, 2026 19:05
Below cutoff the incident mode carries no real axial power, so its coefficients are generalized traveling-wave coefficients rather than power waves. The docstrings, the manual and the normalisation comment now say so, and a test integrates the axial flux of the projected incident mode above and below cutoff. No behaviour change.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The function is not exported.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #75

Reviewed head: e734b27
Raw SHA-256: aa9f40a8daf322cdb51c31ab8468e1f3650da670a14171d5f6ecf3534203015d
Source SHA-256: 07758d800c4aa79bd261eb17bbc01a6a65dc1e2a0ac96a6ddc177461554581f7
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d11f-2242-7f02-b6a5-88c09ce1860e
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: MERGE
  • Reviewed head: e734b27

Review report

VERDICT: MERGE
Round: 4
Head: e734b27
Slot: 1
CI: green
Session: 01a1d11f-2242-7f02-b6a5-88c09ce1860e

Risk

medium-low (ML7: additive, documented and tested Maxwell API, with existing entry points and defaults unchanged in the diff).

Blocking findings

None.

  • Verdict: MERGE
  • Round: 4
  • Blocking priorities: none
  • Deferred P2 issues: none

Non-blocking findings

None. No confirmed numerical, interface or rule violation was found. Inspection found independent analytic references and no weakened or deleted test assertions.

What I ran

Review performed by codex-cli 0.164.0, model gpt-6.1-sol, without reading PR discussion, author ratings or earlier reviews.

All Julia runs preserved the supplied layered JULIA_DEPOT_PATH and used the requested TMPDIR. Environment generation and probes stayed in scratch; the reviewed checkout remained clean. There is no tracked Manifest.toml, Julia interpreter pin, uv.lock or Python project. I instantiated an exact HEAD archive in scratch/head, then retained its generated dependency resolution for testing.

  • julia --version: julia version 1.13.2. Resolved Ferrite 1.7.0, SciMLBase 3.58.0, ModelingToolkit 11.46.1.
  • uv run --locked python --version: Python 3.15.0; uv warned that --locked has no effect outside a project. This is not a locked project Python environment.
  • GROUP=Maxwell julia --startup-file=no --project=../scratch/head -e 'using Pkg; Pkg.test(; allow_reresolve=false)', with two Julia threads, four precompile tasks and one BLAS thread: 152/152 passed (manufactured 4, model 84, ports 64). Output ended Testing FiniteElementMethod tests passed. Lossless H(curl) convergence rates were 0.9821, 0.9973; lossy rates 0.9670, 0.9932. The iterator, cutoff, conducting ABC, PEC and sweep-buffer regressions passed.
  • julia --startup-file=no --project=../scratch/head ../scratch/probes.jl: 11/11 targeted assertions passed. Independent constant complex fields in a lossy material, with a 100-fold mesh-coordinate rescaling and inverse length_scale, had relative errors below 3.3e-15. Rotating/translating a guide changed its scattering matrix by 1.15e-14 relative. A guide with different permittivity and permeability at its ports matched analytic transmission-line scattering within 0.005523, with reciprocity error 1.15e-15 and norm(S' * S - I) = 0.000161 or less. Reversing node numbering preserved scattering, evaluated fields and curls exactly in this probe. The initial probe attempt errored in my diagnostic use of norm on a complex Ferrite Vec; collecting its components corrected the probe, without changing package code.
  • git diff --check origin/master...HEAD and typos src/maxwell test/Maxwell test/shared/maxwell.jl docs/src/maxwell.md: exit 0. Final git status --porcelain=v1 --untracked-files=all: empty. HEAD matched the SHA above.

What I did not verify

Other test groups, QA, documentation build, older supported Julia versions and performance benchmarks. No lockfile was available to reproduce a preselected dependency environment. CI status is supplied by the task; I did not inspect GitHub. No GitHub operations or checkout edits were performed.

AUTHOR_GRADE: {"task":"feature","score":5,"difficulty":4,"rounds":4,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"The full Maxwell group passed 152 assertions and independent probes passed 11 assertions covering analytic fields, units, unequal port impedances, reciprocity, conservation and geometry/orientation invariance. No defect was confirmed; broader suites and documentation builds were not rerun."}

Head link: e734b27


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d11f-2242-7f02-b6a5-88c09ce1860e (no session URL)

t and others added 5 commits November 12, 2026 19:41
…ive permittivity; positive frequencies only

The absorbing coefficient took the principal square root, which is the incoming branch for a negative real eps_r/mu_r with no loss and jumped when a vanishing loss was added; it now takes the limit from the lossy side. A wave port's propagation constant squares omega, so a negative frequency returned the same S instead of its conjugate; wave ports and sweeps now reject non-positive frequencies before any solve.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
For a lossless negative real eps_r/mu_r the coefficient chose the same root at both signs of omega, so the operator at -omega was not the conjugate of the one at omega; the root is now the limit from the lossy side at each sign.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…f eps_r, mu_r and omega

The lossless root now follows the passive limit for negative permeability too, y = -i sign(omega) sign(mu_r) sqrt(|eps_c/mu_r|) where eps_c/mu_r is a negative real, with a table regression over the sign combinations and the decaying-exterior check. A wave port's term in the operator path now rejects non-positive frequencies like the sweeps, since its propagation constant depends on omega squared.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The operator is finite at omega = 0, where an existing adjoint test evaluates it; only the S-parameter normalisation is singular there, and the sweeps keep rejecting zero.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A port filled with a double-negative or single-negative material has an outward power that does not follow beta/mu_r, so the port injects energy and the transmission phase has the wrong sign; such a port is now an ArgumentError at construction, documented with the real-permittivity requirement.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #75

Reviewed head: fcb0262
Raw SHA-256: 64f89c583ba243db3ab39e5907d95aae72cb1ccd5631b634cae1d8a77d66fe9a
Source SHA-256: fa9306813145a10012abf54ec1d7c7585c4254705862197019c1b1ca98854c9d
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d18a-e630-7990-937b-01fb292620a3
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: CHANGES
  • Reviewed head: fcb0262

Review report

VERDICT: CHANGES
Round: 5
Head: fcb0262
Slot: 1
CI: CI is not green
Session: 01a1d18a-e630-7990-937b-01fb292620a3

Risk

medium-low (ML7: additive exported Maxwell model, driven-solve and scattering APIs).

Blocking findings

  • Verdict: CHANGES
  • Round: 5
  • Blocking priorities: P1
  • Deferred P2 issues: none supplied or verified; this finding is P1.
  1. [P1] Wave ports introduce substantial artificial loss in a lossless, single-mode taper. src/maxwell/ports.jl:249 applies the real TE10 propagation constant to the full tangential mass matrix assembled at line 200. Every transverse trace component therefore receives a dissipative boundary condition. However, s_parameters at line 303 reports only the TE10 projection. Higher modes that are physically evanescent can absorb real power through this boundary, contradicting the lossless-unitarity contract at lines 21–24.

    Confirmed by running: a vacuum PEC taper, length 0.5, height 0.5, width increasing from 2 to 3, with normalized eps0 = mu0 = 1, rectangular ports at both ends, and angular frequency 2. Both ends support exactly one propagating mode: TE10 cutoff is π/a, TE20 cutoff is 2π/a (at least 2.0944), and TE01 cutoff is π/0.5 = 6.2832. Conservation therefore requires |S11|² + |S21|² = 1.

    Refining meshes with (2n, n, n) subdivisions gives:

    n Straight-guide control Lossless taper
    2 0.9977367103 0.7712156626
    4 0.9998267672 0.7716377178
    6 0.9999635253 0.7719758895

    These are the outgoing TE10 powers for unit incident power. The taper's 22.8024% deficit persists under refinement. Independently integrating the boundary component orthogonal to the projected TE10 profile gives artificial outgoing flux 0.22802411048997942, matching 1 - sum(abs2, S[:, 1]) = 0.22802411048997906. Reciprocity still holds to approximately 4e-16; coordinate-unit consistency also passes.

    Minimal reproduction of the finest case:

    using FiniteElementMethod, Ferrite
    g = generate_grid(Tetrahedron, (12, 6, 6),
        Vec(0.0, 0.0, 0.0), Vec(2.0, 0.5, 0.5))
    for i in eachindex(g.nodes)
        x = g.nodes[i].x
        g.nodes[i] = Node(Vec(x[1] * (1 + x[3]), x[2], x[3]))
    end
    ports = [WavePort("bottom"; a_direction=(1, 0, 0)),
             WavePort("top"; a_direction=(1, 0, 0))]
    m = MaxwellModel(g; pec=["left", "right", "front", "back"],
        ports, eps0=1.0, mu0=1.0)
    S = solve_sweep(m, [2.0]).S[:, :, 1]
    sum(abs2, S[:, 1])  # observed: 0.7719758895100209

    Suggested fix: apply the propagating admittance through the appropriate modal projector and treat the evanescent complement without artificial real-power absorption. Add a lossless taper or discontinuity conservation regression; the existing straight-guide checks do not expose this error.

Non-blocking findings

None.

What I ran

Independent blind review produced by an AI agent using codex-cli 0.164.0, model gpt-6.1-sol, in the local session identified above (no session URL available). Inspected the checkout, git diff origin/master...HEAD, affected tests and supplied review instructions. Read only the newest commit's Agent-Harness/Agent-Model trailers for attribution. Neither AGENTS.md nor CLAUDE.md exists at the checkout root.

All Julia execution used a clean git archive HEAD in scratch/head, the repository's Project.toml, and the runtime's unchanged layered JULIA_DEPOT_PATH. TMPDIR was set to this review's tmp directory before execution. Julia workers used two Julia threads and four precompile tasks, with memory-capped scopes. Paths below are relative to the review workspace.

  • julia --version: julia version 1.13.2. No committed Julia manifest or interpreter pin exists; scratch resolution selected Ferrite 1.7.0 and SciMLBase 3.58.0.
  • uv run --locked python --version: Python 3.15.0, with warning that --locked has no effect outside a project. There is no uv.lock or Python project here; this does not establish a locked Python environment. Package verification used Julia.
  • GROUP=Maxwell julia --startup-file=no --project=scratch/head -e 'using Pkg; Pkg.instantiate(); Pkg.test()': exit 0. Maxwell/manufactured.jl: 4/4; Maxwell/model.jl: 98/98; Maxwell/ports.jl: 110/110. Lossless H(curl) convergence rates were 0.982079 and 0.997302; lossy rates were 0.967037 and 0.993164.
  • GROUP=QA julia --startup-file=no --project=scratch/head -e 'using Pkg; Pkg.test()': exit 0, QA/qa.jl: 21/21. OPENBLAS_NUM_THREADS=2 for this run.
  • julia --startup-file=no --project=scratch/head scratch/probes.jl: final run exit 1, with 12 passing assertions and one failing conservation assertion: 0.7719758895100209 ≈ 1 (rtol=0.01) is false. The control, analytic cutoff checks, orthogonal-flux identity and unit conversion checks passed. Unit conversion changed S by at most 4.22e-15. Full output is in scratch/probes-confirmed.log. An initial draft of the probe errored when comparing arrays of complex Ferrite Vecs; comparing their collected components resolved that probe-harness issue before the final run.
  • git diff --check origin/master...HEAD and typos src/maxwell test/Maxwell test/shared/maxwell.jl docs/src/maxwell.md: exit 0.
  • Final git status --porcelain=v1: empty. No checkout edits, commits, pushes or GitHub posts.

What I did not verify

The full All suite, documentation build, formatter, other supported Julia versions, or live CI status. CI status above is supplied by the task. I did not read PR descriptions, comments, reviews, author risk ratings, earlier same-head reviews or sibling review artifacts. No deferred-issue evidence was supplied or inspected.

AUTHOR_GRADE: {"task":"feature","score":3,"difficulty":5,"rounds":5,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"All 212 Maxwell and 21 QA assertions pass, but an independent lossless single-mode taper probe demonstrates persistent 22.8% artificial power loss from the port boundary formulation."}

Head link: fcb0262


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d18a-e630-7990-937b-01fb292620a3 (no session URL)

The propagating admittance acted on the whole tangential mass of the port face, so the evanescent higher modes absorbed real power: a lossless taper, dielectric insert and short inclusion lost 23%, 11% and 27% of the incident power. The port term is now the rank-one p p^T / norm of the TE10 projection (the same one s_parameters and the excitation use), which couples the dofs of the face and adds them to the model's sparsity pattern; the complement keeps the natural boundary condition, so power is conserved. Frequencies that are not finite are rejected with one predicate, and the single-mode limitation is documented.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #75

Reviewed head: dfef81e
Raw SHA-256: 753fa62806ed7a5ce90843e0e59fc7616ec4ed39dbb6489bc8f91cdc2c80a73e
Source SHA-256: 6d320620dda1f95e75882eac3a0182aabe3e35e16170f3dbc51b6d43bb794e2f
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d1c5-694f-78f0-b7b9-5638eeb83db2
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: MERGE
  • Reviewed head: dfef81e

Review report

VERDICT: MERGE
Round: 6
Head: dfef81e
Slot: 1
CI: CI is not green
Session: 01a1d1c5-694f-78f0-b7b9-5638eeb83db2

Risk

medium-low (ML7: additive, documented Maxwell model, driven-solve and scattering APIs; existing entry points and defaults are unchanged).

Blocking findings

  • Verdict: MERGE
  • Round: 6
  • Blocking priorities: none
  • Deferred P2 issues: none supplied or verified.

None. The prior P1 artificial-loss finding is resolved, confirmed by running the same independent lossless-taper probe on both heads. For mesh refinements n = 2, 4, 6, outgoing power on the prior head was 0.7712156626, 0.7716377178, 0.7719758895; on this head it is 1 within 1.4e-15. Full scattering-matrix unitarity errors are at most 3.0e-15, including both excitation columns and their cross terms. The implementation explicitly documents the reflected evanescent complement and uniform-lead limitation.

Non-blocking findings

  1. src/maxwell/model.jl:234: the add_term! docstring incorrectly promises that Ferrite.allocate_matrix(model.dh) has the model's pattern. Confirmed by running: on the n = 2 taper, that matrix has 2148 stored entries versus the model's 3696; passing it to add_term! throws ArgumentError: the block must have the sparsity pattern of the model's blocks. The expanded port pattern makes this instruction invalid. Document constructing an extra block by copying a model block and zeroing its values, or using tangential_mass for boundary terms.

  2. src/maxwell/model.jl:72: the model docstring still describes the port operator as the full tangential mass integral. Confirmed from source and the operator probe: the implemented term is now i β L / μr * p pᵀ / norm, with rank-one action on the unconstrained face. Update this formula to agree with WavePort and WavePortData.

What I ran

Review produced by an AI agent using codex-cli 0.164.0, model gpt-6.1-sol, in the local session identified above (no session URL available). Inspected the whole PR diff for context and the supplied delta against fcb0262. Recorded the independent risk in this report before reading the explicitly supplied prior-head previous-review.md; focused verification on the delta and its prior blocker. Neither AGENTS.md nor CLAUDE.md exists at the checkout root. Author attribution comes from the newest commit's trailers.

All commands first set TMPDIR to this review workspace's tmp directory. Julia used the runtime's unchanged layered JULIA_DEPOT_PATH, two Julia threads, four precompile tasks and two OpenBLAS threads. Test runs used memory-capped scopes and timeout 7200. scratch/head and scratch/before are clean git archive copies of the reviewed and prior heads; dependency resolution and probes wrote only outside the checkout. Commands below use paths relative to the review workspace.

  • julia --version: julia version 1.13.2. No committed Julia manifest or interpreter pin exists. Scratch resolution selected Ferrite 1.7.0 and SciMLBase 3.58.0; the prior-head negative control used the same resolved manifest.
  • uv run --locked python --version: Python 3.15.0, with warning: --locked has no effect outside a project. This repository has neither uv.lock nor a Python project; this command does not establish a locked Python environment. Package verification used Julia.
  • GROUP=Maxwell julia --startup-file=no --project=scratch/head -e 'using Pkg; Pkg.instantiate(); Pkg.test()': exit 0. Maxwell/manufactured.jl: 4/4; Maxwell/model.jl: 98/98; Maxwell/ports.jl: 121/121. All 223 assertions passed. Output: scratch/maxwell.log.
  • julia --startup-file=no --project=scratch/head scratch/probes.jl: exit 0, 27/27 assertions. Checked taper conservation under three refinements, full unitarity and reciprocity, rank-one modal coupling, zero coupling of orthogonal traces, operator reconstruction, rotated coordinates, coordinate-unit conversion, and rejection of NaN/Inf before any solver call. Unit-conversion and rotation errors were 2.67e-15 and 1.82e-15. Also observed the documented matrix-construction failure reported above. Output: scratch/probes.log.
  • julia --startup-file=no --project=scratch/before scratch/conservation.jl: exit 1, with 3 passing reciprocity assertions and 3 failing unitarity assertions, one per refinement. This is the same conservation test used in the successful head probe, with physical reference S' * S = I, not expected values copied from computed S. Output: scratch/before.log.
  • GROUP=QA julia --startup-file=no --project=scratch/head -e 'using Pkg; Pkg.test()': exit 0, QA/qa.jl: 21/21. Output: scratch/qa.log.
  • git diff --check origin/master...HEAD and typos src/maxwell test/Maxwell test/shared/maxwell.jl docs/src/maxwell.md: no diagnostics, exit 0.
  • git status --porcelain=v1: empty. No checkout edits, commits, pushes or GitHub posts. Every command started for this review completed before this report was finalized.

What I did not verify

The full All suite, documentation build, formatter, other supported Julia versions, benchmarks, or live CI and its failures. The non-green CI state is supplied by the task and remains a separate merge gate. No committed locked Julia environment was available. I did not read PR bodies, comments, author risk ratings, earlier same-head opinions or sibling review directories. The supplied prior-head review was the explicitly requested re-review context; no second review was launched.

AUTHOR_GRADE: {"task":"feature","score":4,"difficulty":5,"rounds":6,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"The prior artificial-loss blocker is independently reproduced before the delta and resolved afterward. All 223 Maxwell, 21 QA and 27 targeted probe assertions pass; two non-blocking model docstrings need alignment with the expanded pattern and modal boundary term. Live CI remains unverified and is supplied as non-green."}

Head link: dfef81e


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d1c5-694f-78f0-b7b9-5638eeb83db2 (no session URL)

t and others added 2 commits November 12, 2026 22:12
…es of a model block

The port term is i beta L / mu_r p p^T / norm on the widened pattern, so a matrix from Ferrite.allocate_matrix no longer has the model's pattern.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The comment now states the boundary residual +(i beta/mu_r) c e - 2 (i beta/mu_r) E0 e that the operator and load implement.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #75

Reviewed head: f836a5d
Raw SHA-256: 4b90cb46506987a4e16fc8786f255a502ec05b79a940eab33e830b6c2a97edcb
Source SHA-256: a791408ce805096e9ee9db481b2a295a2887d9d3f560dd2611933e9a3216ca7b
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d222-7eb2-7ff2-88cd-fd0693e511dd
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: MERGE
  • Reviewed head: f836a5d

Review report

VERDICT: MERGE
Round: 7
Head: f836a5d
Slot: 1
CI: CI is not green
Session: 01a1d222-7eb2-7ff2-88cd-fd0693e511dd

Risk

medium-low (ML7: additive public Maxwell API, documented and exercised against analytic solutions; existing entry points remain unchanged).

Blocking findings

None confirmed.

  • Verdict: MERGE
  • Round: 7
  • Blocking priorities: None
  • Deferred P2 issues: Not applicable.

Non-blocking findings

None.

What I ran

Independent blind review by codex-cli 0.164.0, model gpt-6.1-sol; the Session above is the actual local session ID (no session URL available). No author rating, PR discussion or earlier review was read.

Julia 1.13.2; Ferrite 1.7.0. Commands used isolated scratch environments developed against this checkout, preserving the supplied layered JULIA_DEPOT_PATH and setting the requested TMPDIR. Paths below are relative to the checkout.

  • git diff origin/master...HEAD, affected source/tests/docs, and git diff --check origin/master...HEAD: inspected; whitespace check passed. Final git status --porcelain was empty and HEAD matched the SHA above.
  • GROUP=Maxwell JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 julia --project=../scratch/env -e 'using Pkg; Pkg.develop(path=pwd()); Pkg.test("FiniteElementMethod")': exit 0; 223/223 passed (manufactured 4, model 98, ports 121). Observed H(curl) convergence rates: lossless 0.982/0.997, lossy 0.967/0.993. Conducting-load reflection differed from its analytic reference by 0.003657.
  • julia --startup-file=no --project=../scratch/qa -e 'using Pkg; Pkg.develop(path=pwd()); Pkg.instantiate(); include(joinpath(pwd(), "test", "qa", "qa.jl"))': exit 0; 21/21 QA checks passed. The QA Project.toml was copied into scratch.
  • OPENBLAS_NUM_THREADS=1 julia --startup-file=no --project=../scratch/env ../scratch/probes.jl: unit scaling, rigid rotation/translation, field/curl transformation and power checks 7/7 passed; scattering differences were 1.75e-14 and 1.40e-14. The analytic slab accuracy check passed, but my pointwise monotonicity assertion failed: error 0.0072325 → 0.0088785.
  • OPENBLAS_NUM_THREADS=1 julia --startup-file=no --project=../scratch/env ../scratch/slab_diagnostics.jl: 5/5 passed. Independent analytic slab L2 errors were 0.048331/0.024125/0.016079 on meshes 4/8/12; field rates 1.002/1.001 and curl rates 0.996/0.998. This confirms first-order global convergence; monotonic error at a single evaluation point is not a valid general requirement. Positive dissipative quadratic form and operator recombination also passed. The failed initial probe remains recorded in scratch.
  • uv run --locked python --version: Python 3.15.0; uv warned that --locked has no effect outside a project. This Julia repository has no Python project/uv.lock or tracked Julia Manifest, so dependencies were resolved from Project.toml into scratch manifests.

What I did not verify

Remote CI, other test groups, documentation build, formatter/spelling jobs, Julia 1.10 or other platforms. The supplied non-green CI status remains a merge gate. No checkout files were edited and nothing was posted to GitHub.

AUTHOR_GRADE: {"task":"feature","score":5,"difficulty":4,"rounds":7,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"223 affected assertions and 21 QA checks passed; independent unit/frame, analytic global-convergence, dissipation and reuse probes found no confirmed blocker."}

Head link: f836a5d


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d222-7eb2-7ff2-88cd-fd0693e511dd (no session URL)

Add discrete adjoint material sensitivities for Maxwell S-parameters
Antenna and filter optimisation needs gradients of S-parameters with respect to material parameters. A(omega) is complex symmetric, so the adjoint of each wave port's output is the forward field with that port driven: s_parameter_sensitivities gives dS/dp for eps_r, Im eps_r, mu_r and sigma of named cell sets from the sweep's fields with no extra solve, including the absorbing boundary's dependence on the adjacent material. adjoint_gradient covers real field functionals with one adjoint solve through the pluggable solver interface. Validated against central finite differences of the forward sweep (relative agreement 1e-10 to 2e-8) and against the closed-form WR-90 dielectric slab.

Agent-Review: unreviewed
Merge maxwell/3-sweep-abc into maxwell/8-adjoint (PR workflow triggers)
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into maxwell/8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Adjoint sensitivities: reject nonsymmetric added terms
The adjoint of a port is its forward field, and the adjoint solve uses A, only when A is symmetric; add_term! accepts any block of the right pattern, so the three entry points now check the blocks are symmetric and throw an ArgumentError otherwise.

Agent-Review: unreviewed
Adjoint sensitivities: scale-free symmetry check
The absolute floor accepted a tiny nonsymmetric block with a huge coefficient; the check is now relative to the block.

Agent-Review: unreviewed
Adjoint: absorbing coefficient derivative is 0 at omega = 0
Consistent with the forward absorbing coefficient.

Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Adjoint: check symmetry on the free dofs only
A large symmetric entry on a constrained dof could hide a nonsymmetric free operator, so the sensitivities accepted models whose adjoint is wrong. The relative skew is now measured on the unconstrained sub-block, with the same tolerance.

Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Adjoint: differentiate the outgoing-branch absorbing admittance
The absorbing term now takes the outgoing root for a lossless negative eps_r/mu_r; the derivative uses the same branch.

Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Adjoint: the absorbing admittance derivative follows the sign of omega
Uses the same outgoing branch as the operator.

Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed
Merge forge/mwsync-3-sweep-abc into 8-adjoint
Agent-Review: unreviewed

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.319
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Harness: Claude Code 2.1.322
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