Skip to content

Add lumped ports and Z/S-parameters to the Maxwell sweep - #79

Open
xtalax-droid wants to merge 29 commits into
maxwell/3-sweep-abcfrom
maxwell/4-lumped
Open

xtalax-droid wants to merge 29 commits into
maxwell/3-sweep-abcfrom
maxwell/4-lumped

Conversation

@xtalax-droid

Copy link
Copy Markdown
Collaborator

Depends on #75 (this PR targets its branch, so the diff shows only this layer; it will be retargeted once the layers below merge).

Adds LumpedPort(facetset; direction, Z0 = 50): a rectangular facet sheet bridging a gap between conductors, on the boundary or inside the mesh.

What's added

  • Port model. The port carries a uniform sheet current along direction; its gap voltage is the sheet-averaged line integral V = (1/w) ∮ E·l̂ dS. Every port is loaded by its reference impedance through a rank-one term iωμ0 L/(w² Z0) g gᵀ with gᵢ = ∮ l̂·Nᵢ dS, and the driven port adds a 1 A Norton source iωμ0 g/w.
  • Exact discrete circuit identities. Load, source and voltage share one functional, so Sᵢⱼ = 2Vᵢ/sqrt(Z0ᵢZ0ⱼ) − δᵢⱼ holds exactly for the discrete system and S is unitary for a lossless structure. (A distributed resistive sheet would dissipate σ∫|E_l|² ≥ |V|²/Z0, i.e. more than the lumped circuit whenever the gap field is non-uniform.)
  • Mixed ports. Wave and lumped ports mix freely in ports and in solve_sweep: one factorisation per frequency, one right-hand side per port, an N×N S-matrix normalised to power waves. model.ports now holds both kinds.
  • Pattern. The rank-one block couples every edge dof of a sheet, so the shared sparsity pattern is widened by those cliques (unchanged without lumped ports). This suits gaps a few elements across; a sheet with n edge dofs adds about n² nonzeros.
  • Checks. Sheets must be planar (normals and positions), rectangular with one side along direction; a facet listed from both of its cells counts once (interior sheets).
  • Helpers (not exported): port_voltage, port_current, z_parameters.
ports = [LumpedPort("bottom"; direction = (0, 1, 0)), LumpedPort("top"; direction = (0, 1, 0), Z0 = 75.0)]
model = MaxwellModel(grid; pec = ["front", "back"], ports, length_scale = 1.0e-3)
sweep = solve_sweep(model, 2π .* [3.0e9]; fields = true)

Validation (Maxwell group, ~24 s added)

PMC-sided parallel-plate line, W = 10 mm, h = 5 mm, L = 20 mm, 3 GHz, against transmission-line closed forms:

case dofs computed exact error
two-port, 50 Ω 221 / 1,426 / 10,148 S11 0.84657+0.13598i, S21 0.08162−0.50810i (finest) 0.84651+0.13600i, 0.08165−0.50820i 1.6e-3 / 4.0e-4 / 9.9e-5 (O(h²))
matched, Z0 = Zc = 188.365 Ω 836 |S11| 6.6e-4, S21 0.3076−0.9515i 0, exp(−ik0L) < 2e-3
shorted one-port ~800 Zin 583.09i Ω 581.45i Ω 0.3 %
lossy (εr = 2.2−0.3i, σ = 0.05), 50/75 Ω 836 S21 −0.21482−0.60320i −0.21422−0.60438i 1.2e-3; reciprocal to 1e-8; passive
interior port with an open stub ~1,100 S21 0.03163−0.51460i 0.03187−0.51498i 4e-4
WR-90 wave port to 100 Ω lumped port, 9/10/11 GHz ~4k |S11|²+|S21|² = 0.99985 / 0.99976 / 0.99981 1 reciprocal to 1e-8

Also: multiple right-hand sides from one factorisation equal separate solves to 1e-10; Z recovers the open-circuit impedances; invalid sheets are rejected. Maxwell group (lumped 60, manufactured 4, model 80, ports 49) and QA 21/21 pass.

Docs: a lumped-port section in docs/src/maxwell.md.

Review pointers

  • The rank-one uniform-current port model (above) is the main choice.
  • model.ports changed element type and the ports keyword default is now [].
  • Polarity: V > 0 means the start of direction is the + terminal.

🤖 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 3 commits November 5, 2026 23:08
A LumpedPort is a rectangular facet sheet across a gap carrying a uniform sheet current; its Z0 load (iωμ0 L/(w²Z0) g gᵀ), Norton source and gap voltage V = L gᵀu/w share one functional g, so the circuit identities hold exactly for the discrete system. Wave and lumped ports mix in one model and one solve_sweep, both normalised to power waves. Validated against transmission-line closed forms on a PMC-sided parallel-plate line.

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>
Picks up the per-material complex permittivity on absorbing faces, the PEC-rim and port-face checks of wave ports and the u_cell rename.

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>
Parallel normals and a matching projected area do not make a sheet planar: two half-faces at different heights passed. Check the spread of the facet nodes along the normal, as WavePort already does.

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 62eee67... master / 62eee67...
construction/heat P1 10x10 7.93 ± 0.57 ms 7.66 ± 0.79 ms 1.03 ± 0.13
construction/heat P1 20x20 10.6 ± 0.72 ms 11.1 ± 0.79 ms 0.96 ± 0.094
time_to_load 5.68 ± 0.07 s 5.58 ± 0.0077 s 1.02 ± 0.013
Memory benchmarks
master 62eee67... master / 62eee67...
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

t and others added 3 commits November 10, 2026 20:13
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>
Conflicts: docs/src/maxwell.md kept both sections; src/maxwell/ports.jl keeps the lumped-port structure and applies the exact-cutoff ArgumentError (same message and test as the wave-port-only version) through _check_not_at_cutoff, which skips lumped ports.

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>
…c Ferrite API

Ferrite.reference_facets and dirichlet_facetdof_indices are not public; lumped.jl now uses the tables defined for the wave ports and the PEC edge dofs.

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 01a1c8f4-627a-7403-b745-eaea046773fb, reviewed head e3527fe

  • Verdict: CHANGES
  • Risk assessment: medium-low (ML7: additive documented Maxwell model, driven solver, ports and sweep API; existing entry points 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 documented Maxwell model, driven solver, ports and sweep API; existing entry points unchanged).

Blocking findings

  • Verdict: CHANGES
  • Round: 2
  • Blocking priorities: P2
  • Deferred P2 issues: None supplied; the finding remains blocking.

[P2] src/maxwell/sweep.jl:56 — Retained fields are overwritten when a custom solver reuses its solution buffer.

Confirmed by running. push!(kept, U) retains the solver-owned matrix without copying it. A solver that caches both its factorization and its output matrix satisfies the documented solver(A, B, cache) -> (U, cache) interface, but every stored frequency then refers to the final frequency's solution. The existing custom-solver tests delegate to umfpack_solver, which allocates a fresh solution, so they miss this case.

I used a 10 × 5 × 20 mm parallel-plate model, (2, 2, 8) tetrahedral subdivisions, PEC front/back, 50-ohm lumped ports on bottom/top, and frequencies 2π .* [1e9, 3e9]. The callback was:

function reuse_solution(A, B, cache)
    F = cache === nothing ? lu(A) : lu!(cache[1], A)
    U = cache === nothing ? similar(B) : cache[2]
    copyto!(U, F \ B)
    return U, (F, U)
end

With solve_sweep(model, ws; fields=true, solver=reuse_solution), fields[1] === fields[2] is true. The first field's relative error against the default solve is 0.35223778853776827; the last field and all stored scattering matrices match exactly. Independently checking the constrained equation gives first-frequency relative residual norm(A*U-B)/norm(B) = 0.581923294133007, versus 1.1694511854048878e-14 for the fresh solve. Thus the returned first-frequency field does not solve its advertised equation.

Suggested fix: snapshot U when retaining it and add a regression using a solver that reuses its output buffer. The two targeted assertions for field correctness and distinct stored matrices both fail on this head. No implementation was changed.

Non-blocking findings

None.

What I ran

Review by an AI agent using codex-cli 0.164.0, model gpt-6.1-sol; the session above is a local session with no available session URL. Risk was recorded independently before reading any author rating; no PR body, comments, earlier review or rating was read. Root AGENTS.md and CLAUDE.md are absent.

Exported the requested TMPDIR before commands. Preserved the supplied layered JULIA_DEPOT_PATH. Used an exact git archive HEAD snapshot at scratch/review-head so dependency resolution and tests could write without modifying the checkout. Julia jobs used memory-capped scopes, two Julia threads, four precompile tasks and one OpenBLAS thread.

  • git diff origin/master...HEAD, affected source/tests/docs, git diff --check origin/master...HEAD: inspected; whitespace check passed. Final git status --short is empty and HEAD matches the declared SHA.
  • julia --version: julia version 1.13.2. Ferrite in the test environment: 1.7.0. No checked-in Julia Manifest or interpreter pin exists; the scratch snapshot's declared project was instantiated and its generated Manifest retained.
  • uv run --locked python --version: Python 3.15.0, with warning that --locked has no effect outside a project. This Julia repository has neither uv.lock nor pyproject.toml; this does not establish a locked project Python environment.

With S denoting this review's scratch directory and the resource limits above:

GROUP=Maxwell julia --project="$S/review-head" --startup-file=no -e 'using Pkg; Pkg.instantiate(); Pkg.test()'
GROUP=QA julia --project="$S/review-head" --startup-file=no -e 'using Pkg; Pkg.test()'
julia --project="$S/review-head" --startup-file=no "$S/probes.jl"
julia --project="$S/review-head" --startup-file=no "$S/residual-probe.jl"
  • Maxwell: 193/193 passed — lumped 60, manufactured 4, model 80, ports 49; output ends Testing FiniteElementMethod tests passed. Manufactured H(curl) convergence rates were (0.982079, 0.997302) lossless and (0.967037, 0.993164) lossy. Parallel-plate analytic-reference errors decreased 0.00158975 → 0.000396811 → 0.0000991729.
  • QA: 21/21 passed, exit 0.
  • probes.jl: 3 invariance assertions passed; 2 retained-field assertions failed, exit 1. The passing probes cover equivalent physical geometry under coordinate/length-scale conversion and reversed frequency order. Failure evidence is reported above.
  • residual-probe.jl: exit 0; printed the independently recomputed equation residuals above. Last-frequency residual was 4.868197787131891e-15 for both solver variants.

Logs and probe scripts are in this review's scratch directory. All launched commands finished before this report was finalized.

What I did not verify

Other Julia versions/platforms, the full unrelated test suite, the full documentation build, CI results, and allocation/performance claims. No author PR claims were consulted. No owning-head issue links were supplied or checked, so this round-two P2 has no verified deferral. No commits, pushes, GitHub posts, or checkout edits were made.


🤖 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 5 commits November 11, 2026 23:54
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 solver that reuses its output buffer must not alias the stored frequencies; each stored field is checked against its own equation.

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 sheet listed from each of its two cells has disjoint FacetIndex sets but is one sheet; the overlap check of boundary conditions now compares sorted facet node identities.

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>
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 5e60574. 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).

Stacked on #75.

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 01a1ceeb-50ee-7b20-9035-e0048e5e55b3, reviewed head 5e60574

  • Verdict: MERGE
  • Risk assessment: medium-low (ML7: additive, documented Maxwell model, driven solver, ports and sweep API; existing entry points 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: 01a1ceeb-50ee-7b20-9035-e0048e5e55b3

Risk

medium-low (ML7: additive, documented Maxwell model, driven solver, ports and sweep API; existing entry points unchanged).

Blocking findings

None. The prior retained-field blocker is resolved by the snapshot at src/maxwell/sweep.jl:57, with failing-before/passing-after evidence below. No new blocker was found in the delta.

  • Verdict: MERGE
  • Round: 3
  • Blocking priorities: none
  • Deferred P2 issues: none supplied or needed.

Non-blocking findings

None.

What I ran

AI reviewer: codex-cli 0.164.0, model gpt-6.1-sol; local session identified above, no session URL available. Recorded risk before reading the designated prior-head review. Read that review, the delta from e3527fec2899f1361b0dafd941e70d6ba8b11bbb, and the whole change for context. No PR body, comments, author rating, or other review artifacts were consulted. Root AGENTS.md and CLAUDE.md are absent.

Exported the requested TMPDIR before commands and preserved the runtime's layered JULIA_DEPOT_PATH. Tested a git archive HEAD snapshot under this round's scratch/review-head; the checkout remained unchanged. Julia jobs ran serially in memory-capped scopes with two Julia threads, four precompile tasks and one OpenBLAS thread.

With S denoting this round's scratch directory:

GROUP=Maxwell julia --project="$S/review-head" --startup-file=no -e 'using Pkg; Pkg.instantiate(); Pkg.test()'
bash "$S/run-remaining.sh"
uv run --locked python --version
git diff --check origin/master...HEAD
  • Julia: 1.13.2, Ferrite 1.7.0. No checked-in Manifest or interpreter pin exists; instantiated the declared project in the snapshot and retained its generated Manifest.
  • Maxwell: 215/215 passed — lumped 64, manufactured 4, model 84, ports 63. The manufactured lossless/lossy H(curl) convergence rates remain approximately first order.
  • run-remaining.sh: current-head probes 39/39 passed, previous-implementation negative control exited 1 as expected, QA 21/21 passed; script exited 0. Probes exercised reused output buffers, cutoff rejection and nearby frequencies, empty sweeps, overlapping boundary aliases, partial PEC coverage, the absorbing DC limit, loss restrictions, and point-location fallback.
  • The same five retained-field assertions give four failures before / five passes after. The negative control loads only the prior solve_sweep definition into the current environment. At frequencies 2π .* [1e9, 3e9, 1e9], its matrices alias, middle-frequency relative field error is 0.299737, and equation residual is 0.375993. At HEAD, matrices are distinct, field errors and scattering-matrix differences against fresh solves are zero, and independently constrained equation residuals are at most 1.24324e-14.
  • The raw locator misses the large-tetrahedron probe point; field_values recovers its independently prescribed constant field with error 6.20e-15 and preserves outside-mesh NaNs. An initial scratch-probe run errored because its complex Ferrite-vector norm was compared with a real tolerance; corrected the probe to use an array norm and reran successfully. No package code was changed.
  • 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 pyproject.toml, so this establishes no locked project Python environment.
  • Whitespace check passed; final git status --porcelain=v1 was empty and HEAD matched the declared SHA. All launched commands finished. Scripts and logs are retained in scratch.

What I did not verify

Other Julia versions/platforms, unrelated test groups, the full documentation build, formatting/spelling checks, or performance. CI green is supplied task metadata, not independently inspected. No GitHub access, posts, commits, pushes, or checkout edits were made.


🤖 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 2 commits November 12, 2026 10:18
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 wave impedance is infinite below cutoff, so at omega = 0 the power-wave scale is 0/0 and the scattering matrix came out all NaN; s_parameters and port_excitations now throw an ArgumentError for a wave port at omega = 0.

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 a822abc: includes the base-branch ports fix, and wave-port S-parameters and excitations now raise an ArgumentError at zero frequency (the wave impedance is infinite below cutoff, and the normalisation previously returned an all-NaN matrix); a regression covers both entry points.

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 5 commits November 12, 2026 19:09
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>
…ation

At omega = 0 the propagation constant is -i kc and the wave impedance is 0, not infinite; the power-wave amplitude factor sqrt(beta/(omega mu)) diverges. The infinite-impedance explanation is kept for exact cutoff only. The guard and its tests are unchanged apart from the message match.

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>
…ports

Consistent with the below-cutoff note on WavePort.

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 lumped port tests read the local facet nodes from a function that is not public in Ferrite; the package's own table is now checked against the geometry in test/Maxwell/model.jl and used here.

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 01a1d11c-f713-7e31-a83b-1c1c175eb44b, reviewed head a822abc

  • Verdict: CHANGES
  • Risk assessment: medium-low (ML7: additive, documented Maxwell API; existing entry points and defaults unchanged).
  • Round / slot: 4 / 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: 01a1d11c-f713-7e31-a83b-1c1c175eb44b

Risk

medium-low (ML7: additive, documented Maxwell API; existing entry points and defaults unchanged).

Blocking findings

  • [P2] Select the outgoing absorbing-boundary branch for negative real permittivity. src/maxwell/ports.jl:106 takes the principal square root. For the accepted material eps_r = -1, sigma = 0, and normalized omega = eps0 = mu0 = length_scale = 1, its boundary coefficient is -1, selecting a growing exterior field. The outgoing exp(-z) field requires +1. Confirmed by running a unit-cube probe with PEC on front/back, absorbing top, natural remaining faces, and J = (0,i,0). The independent scalar problem is -E_y'' + E_y = 1, E_y'(0)=0, E_y'(1)+E_y(1)=0, whose solution is 1-exp(-1)*cosh(z). On a (4,4,8) mesh the computed midpoint field is -2.080154186, versus analytic 0.585169590. Changing only the material to -1-1e-12im gives 0.585164109 and flips the coefficient to +1. This discontinuity at zero passive loss and two failing assertions are recorded in scratch/regressions.log. Select the passive outgoing branch consistently, or explicitly reject this material domain; add the analytic regression.

  • [P2] Reject negative wave-port frequencies or choose their signed propagation branch. src/maxwell/ports.jl:202 squares omega and selects the positive real propagation constant at both signs; src/maxwell/ports.jl:242 rejects zero but accepts negative frequencies. Consequently, solve_sweep silently returns the same scattering matrix at omega=2 and omega=-2 for a real, lossless guide. Confirmed on a normalized 2 x 1 x 2 guide, (3,2,4) tetrahedral mesh, PEC side walls and two wave ports: both transmissions are -0.773435598 - 0.626837594im, and maximum(abs, S(-2)-conj(S(2))) = 1.253675188. A real system requires conjugate frequency symmetry. The targeted assertion fails in scratch/regressions.log. Either enforce and document positive frequencies throughout the wave-port API, or implement the signed branch and test this symmetry.

  • Verdict: CHANGES

  • Round: 4

  • Blocking priorities: P2, P2

  • Deferred P2 issues: None supplied or verified in this blind review. The round-two deferral requirements are not established.

Non-blocking findings

None.

What I ran

Reviewer: AI agent using Codex, model gpt-6.1-sol; harness version unavailable. Independent risk and verdict established without reading author ratings or previous reviews.

  • Exported the requested TMPDIR; preserved the supplied layered JULIA_DEPOT_PATH. Scratch scripts, logs and dependency environment are under round4/scratch. The checkout remains clean.
  • Read git diff origin/master...HEAD, affected source/tests/docs/workflows, and the risk criteria. Root AGENTS.md and CLAUDE.md are absent. Read the newest commit trailers only for required attribution.
  • julia --version → julia version 1.13.2. No Julia Manifest is checked in. Created a separate environment from the repository's declared dependencies, test extras and compat bounds, developed this checkout into it, and instantiated successfully. Resolved versions include Ferrite 1.7.0, SciMLBase 3.58.0 and SciMLTesting 2.13.3.
  • With JULIA_NUM_THREADS=2, JULIA_NUM_PRECOMPILE_TASKS=2, OPENBLAS_NUM_THREADS=2, and an 8 GiB memory scope: GROUP=Maxwell julia --startup-file=no --project=../scratch/env test/runtests.jl → 218 passed: lumped 64, manufactured 4, model 84, ports 66. Exit 0. Log: scratch/maxwell-tests.log. Analytic MMS H(curl) convergence rates were 0.982/0.997 (lossless) and 0.967/0.993 (lossy).
  • julia --startup-file=no --project=../scratch/env ../scratch/probes.jl → exit 0. Wave-port length-scale invariance with non-vacuum epsilon/mu passed two assertions; scaling lengths by 0.001 and frequency by 1000 changed S by at most 1.61e-15. Exploratory boundary probes exposed the findings above. Log: scratch/probes.log.
  • julia --startup-file=no --project=../scratch/env ../scratch/regressions.jl → 0 passed, 3 failed, 0 errored, 0 broken, exit 1. Two assertions cover the negative-permittivity boundary; one covers negative-frequency symmetry. The expected boundary solution and symmetry follow independently from the differential equation and real constitutive coefficients.
  • uv run --locked python --version → Python 3.15.0, with warning: --locked has no effect when used outside of a project. There is no uv.lock or pyproject.toml; this is not evidence of a locked project Python interpreter.
  • git diff --check origin/master...HEAD → exit 0; git status --porcelain → empty. All commands I started have completed.

What I did not verify

  • Other test groups, QA, docs rendering, Julia 1.10/prerelease, GPU/AD paths, and performance benchmarks.
  • No preexisting locked dependency environment or project Python interpreter was available; Julia dependencies were resolved within the declared compat bounds in scratch.
  • CI state is supplied by the review assignment, not independently inspected. No PR body, comments, author risk assessment, earlier review, or issue-deferral evidence was read. No fixes, commits, pushes or GitHub posts were made.

🤖 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 3 commits November 12, 2026 19:43
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>
At omega = 0 the Norton excitation and port loading vanish, leaving the singular curl-curl operator with a zero right-hand side, so a lumped-port sweep returned S = -I instead of failing; zero frequency is now an ArgumentError before any solve (no test or documented behaviour used it).

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>
t and others added 5 commits November 12, 2026 20:16
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>
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>
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 01a1d1c6-a35b-7a83-8a67-cf3870f6d9bd, reviewed head cd72766

  • Verdict: MERGE
  • Risk assessment: medium-low (ML7: additive, documented and tested Maxwell API; existing entry points and defaults unchanged).
  • Round / slot: 5 / 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: CI is not green
Session: 01a1d1c6-a35b-7a83-8a67-cf3870f6d9bd

Risk

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

Blocking findings

None. Both prior blockers are resolved by running the checks below. No additional blocker was confirmed in the delta.

  • Verdict: MERGE
  • Round: 5
  • Blocking priorities: None
  • Deferred P2 issues: None required.

Non-blocking findings

  • src/maxwell/model.jl:72 and src/maxwell/model.jl:236: update the operator and sparsity docstrings for the rank-one wave-port term. They still describe full tangential-mass loading and promise the cell sparsity pattern whenever lumped ports are absent. Confirmed by running: a wave-only model has 13,806 structural entries versus 12,258 from Ferrite.allocate_matrix, and passing that allocated matrix to add_term! throws the documented pattern error. Describe p pᵀ / norm and explain that both wave and lumped ports widen the pattern. The WavePort documentation already describes the implemented behavior correctly.

What I ran

Reviewer: AI agent using Codex, model gpt-6.1-sol; harness version unavailable. Established this risk and verdict without consulting an author rating. Read the supplied prior-head review, delta, whole PR diff and affected source/tests/docs. Root AGENTS.md and CLAUDE.md are absent.

  • Exported the requested TMPDIR and preserved JULIA_DEPOT_PATH. Used scratch environments and scripts outside the checkout, with two Julia/BLAS threads, two precompile tasks and an 8 GiB memory scope.
  • julia --version → julia version 1.13.2. No Julia Manifest is checked in. Resolved the declared dependencies and relevant test extras in scratch/env: Ferrite 1.7.0, SciMLBase 3.58.0, SciMLTesting 2.13.3.
  • GROUP=Maxwell julia --startup-file=no --project=../scratch/env test/runtests.jl → 292 passed, exit 0: lumped 67, manufactured 4, model 98, ports 123. Log: scratch/maxwell-tests.log.
  • Ran scratch/before-after.jl against an archived copy of a822abc30b2b36a6af1462eb26f7e652412726fe and this checkout, using the same dependency environment. Before: 4 failed, exit 1. After: 4 passed, exit 0. The negative-permittivity boundary coefficient changes from -1 to +1; midpoint field from -1.999565 to 0.596047, versus analytic 0.585170. Negative wave-port frequencies now throw. Lossless taper power changes from 0.771215663 to 1.0000000000000007, with final full unitarity defect 1.41e-15. Logs: scratch/before.log, scratch/after.log.
  • julia --startup-file=no --project=../scratch/env ../scratch/probes.jl → 74 passed, exit 0. Confirmed frequency rejection before any solver call, outgoing admittance for both constitutive/frequency signs, and rank-one loading without absorption of orthogonal traces. Analytic boundary L2 errors decrease 0.02625 → 0.01330 → 0.006681, rates 0.981, 0.993. Independent dielectric-slab transfer matrices, including below cutoff, give final maximum S errors 0.00321, 0.00731, 0.03136 at frequencies 1, 2, 2.7. Propagating cases also pass full unitarity and reciprocity checks. Log: scratch/probes-final.log.
  • Exploratory failures are retained: an unjustified pointwise 1e-3 bound failed on the coarse boundary mesh; L2 refinement above establishes convergence. Corrected my slab cell-set bounds, then refined the mesh to satisfy the original 0.07 accuracy threshold without loosening it.
  • uv run --locked python --version → Python 3.15.0, warning: --locked has no effect when used outside of a project. No uv.lock or pyproject.toml exists.
  • git diff --check origin/master...HEAD → exit 0; final git status --porcelain → empty. All commands started by this review have completed.

What I did not verify

Other test groups, QA, docs build/rendering, other Julia versions and performance benchmarks. No project-locked interpreter/dependency environment was available. CI status is supplied by the assignment; its non-green state was not investigated through GitHub. No PR body, discussion, author risk rating or sibling review artifacts were inspected. No checkout edits, fixes, commits, pushes or GitHub posts were made.


🤖 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)

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: #79

Reviewed head: e0a8f64
Raw SHA-256: 95dc101f1316d394203698fc531379b8cefcd8f6ce3774a3fb19057d819f3f42
Source SHA-256: aad1383e0b0702cd7d6ddbdc9c0580775c02419b1415e8cc6122a8267baaba38
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d233-41be-79d3-a0d6-9b4b78f2ff59
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

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

Review report

VERDICT: MERGE
Round: 6
Head: e0a8f64
Slot: 1
CI: CI is not green
Session: 01a1d233-41be-79d3-a0d6-9b4b78f2ff59

Risk

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

Blocking findings

None identified in the diff or reproduced by the tests and probes. Numerical evidence includes independent manufactured fields and analytic transmission-line references, rather than agreement with the implementation alone.

  • Verdict: MERGE
  • Round: 6
  • Blocking priorities: None
  • Deferred P2 issues: None supplied or inspected during this blind review.

Non-blocking findings

None.

What I ran

Reviewer: codex-cli 0.164.0, model gpt-6.1-sol. Read the checkout, complete diff, affected tests, documentation and risk criteria; neither root AGENTS.md nor root CLAUDE.md exists in this checkout. No PR discussion, author rating or earlier review was inspected.

All Julia runs used the supplied TMPDIR, preserved JULIA_DEPOT_PATH, four Julia threads, four precompile tasks and one OpenBLAS thread, inside a 10 GiB memory scope. Environment and probe files are under round6/scratch; the checkout remains clean.

  • julia --version: 1.13.2. Resolved the checkout's Project.toml and required test extras into scratch/env/Manifest.toml, developing this exact checkout. Relevant versions: Ferrite 1.7.0, SciMLBase 3.58.0, SciMLTesting 2.13.3.
  • GROUP=Maxwell julia --startup-file=no --project=../scratch/env test/runtests.jl: 292/292 passed — lumped 67, manufactured 4, model 98, ports 123. An initial isolated SafeTestsets run of all four files also passed 292/292.
  • Manufactured H(curl) convergence rates: lossless 0.9821, 0.9973; lossy 0.9670, 0.9932. Parallel-plate S errors decreased 0.001590 → 0.0003968 → 0.00009917 under refinement.
  • julia --startup-file=no --project=../scratch/env ../scratch/probes.jl: corrected probe run 17/17 passed. Metre/millimetre scaling and arbitrary rigid rotation preserved wave/lumped S within 1.13e-14, with matching transformed E and physical curl. Lumped negative-frequency conjugacy error was 0. Independent constant-field errors were 8.5e-16 and 5.6e-14. The initial probe run errored because its norm comparison used a complex Ferrite Vec directly; collecting that vector corrected the probe, without changing package code.
  • uv run --locked python --version: Python 3.15.0, with warning that --locked has no effect outside a project. This is a Julia repository with no pyproject.toml or uv.lock; no locked project Python interpreter is supplied.
  • git diff --check origin/master...HEAD: passed. git status --porcelain: empty.

What I did not verify

Full-package/QA groups, the complete documentation build, Julia LTS/other supported versions, or minimum dependency versions. No repository Julia Manifest or interpreter pin is supplied, so dependency verification uses the generated scratch manifest. CI was not inspected; the supplied non-green CI status remains a merge gate. MERGE is code-review advice only.

AUTHOR_GRADE: {"task":"feature","score":5,"difficulty":4,"rounds":6,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"All 292 affected assertions and 17 independent probes passed on the reviewed head, including analytic convergence, port scaling, rotation and field accuracy; CI, QA, documentation build and other supported environments remain unverified."}

Head link: e0a8f64


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d233-41be-79d3-a0d6-9b4b78f2ff59 (no session URL)

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