# SEP 55 — Per-channel frequency support on the general modal route | | | |---|---| | **SEP** | 55 | | **Title** | Per-channel frequency support on the general modal route | | **Author** | John Travers | | **Drafting agent** | Claude Fable 5.2 | | **Status** | Draft | | **Review status** | In review | | **Reviewers** | Opus 5.5 (AI) | | **Type** | Feature | | **Created** | 2026-12-04 | | **Resolution** | — | | **Requires** | — | | **Supersedes** | — | | **Superseded-by** | — | | **Implementation** | — | | **Manual pages** | — | ## Part I — Proposal ### 1. Abstract A general modal guide must today hold every one of its channels as a bound mode over the run's whole active band, which reaches down to half the lowest declared frequency. A high-order channel that is bound at the pump and cut off in the infrared therefore removes itself from the guide, and the channel count of a run is set by the longest wavelength of its grid, not by what the light occupies. This SEP proposes **per-channel frequency support**: each channel is carried over the part of the active band where its provider certifies it bound, and is absent below its own limit, with a zero amplitude, a zero reference field and no noise there. The model is a truncation of the modal basis that depends on frequency, of the same kind as the fixed channel count a run already declares. It becomes the default, because it acts only on guides that are refused today. The kernel contract gains a per-channel active mask so that an absent bin is exactly zero. The run this makes possible is far larger than any the route has been timed on, and at present it does not fit in memory, so the SEP's first phase is a performance phase, held to a stated target. Success is judged by four things: a guide whose channels all cover the band gives today's results exactly; the limits agree with an independent calculation of the cut-offs; absent bins stay exactly zero; and a graded-index fibre of 52 µm core pumped at 1064 nm builds and steps with its seven radially symmetric channels on a grid that holds both first-order sidebands of the geometric parametric instability. ### 2. Motivation and scope **Use case.** Supercontinuum generation in graded-index multimode fibre pumped at 1064 nm starts from the geometric parametric instability (GPI): the periodic self-imaging of the beam phase-matches sidebands far from the pump [1, 2]. For the fibre of ref. [1] (nominally 50 µm: core radius 26 µm, index contrast $\Delta = 0.0088$) the first pair lies near 737 nm and 1913 nm. A grid that holds the long sideband ends near 2.1 µm, so its active band reaches 4.2 µm. The table below is the number of `LP0m` channels `GradedIndexProvider` accepts for that fibre, with 96 elements and solprop's default silica law on the axis ($n_1 = 1.450$ at 1064 nm), beside the estimate of §4.2: | Wavelength, nm | $V$ | Estimate $\lfloor (V+2)/4 \rfloor$ | Accepted, `extent=1.6` | Accepted, `extent=3.0` | |---:|---:|---:|---:|---:| | 450 | 70.6 | 18 | 17 | 17 | | 737 | 42.8 | 11 | 10 | 11 | | 1064 | 29.5 | 7 | 7 | 7 | | 1913 | 16.3 | 4 | 4 | 4 | | 2100 | 14.8 | 4 | 3 | 4 | | 4200 | 7.1 | 2 | 1 | 2 | With `extent=3.0` the counts are the same at 64 elements. Seven channels are bound at the pump and two at the foot of the active band, so the run is limited to two channels. The graded-index worked example avoids this with a 100 µm core and a grid that ends at 1.8 µm, and still keeps four channels where the pump supports more. The same limit applies to any solid guide used over more than an octave. **The material law limits the band first.** The frame channel, `LP01`, keeps its full support, so the glass law must be defined down to half the lowest declared frequency. Malitson's Sellmeier fit, which the worked example and the suite's `grin_nonlinear` use, ends at 3.71 µm and refuses the 4.2 µm foot of this grid. The default silica law (optmat's `fit/SiO2`) reaches it; a lossless guide takes its transparent approximation and warns that it drops an absorption of several hundred per metre there. That foot lies inside the spectral collar, where the run holds no light. **In scope.** - A per-channel lower frequency limit on a constant (snapshot) guide built from a provider, on the general modal route, on `numpy_ref` and the native CPU build. - `GradedIndexProvider` as the first provider that reports a partial channel set. - The table, translation, linear-operator, noise, launch and coupling changes that carry the support; a per-channel active mask in the kernel contract; the record of the supports in the run's identity; and a report of the light at each limit. - The performance of the general modal route at the scale of the use case (§6.2): many channels, long time windows, tens of thousands of steps, in time and in memory. **Out of scope.** - Moving guides. On a taper the cut-off moves with the radius; a support that varies along $z$ would make the linear operator and the maps discontinuous in $z$ inside a bin. A guide with a declared path and a channel that is not bound over the whole band is refused, as today. - An upper frequency limit per channel, and supports that are not one interval. - Declared bases and degenerate blocks that mix channels of different support. - The step-index providers; they can follow in the same form. - Leaky modes as channels, cladding modes, and any loss model for light below a limit other than its absence. - The position of the grid's low-frequency collar foot (§10). - Any change of model made for speed. The performance phase keeps the grid and the physics of the run. One candidate changes the quadrature inside a declared error budget, and says so; a faster approximate model would be a proposal of its own. ### 3. Context **What solprop does today.** The general modal route is described in `docs/guide/waveguides/general-modal.md` and `docs/guide/waveguides/modal-projection.md`. A `ModalGuide` (`src/solprop/modes/guide.py`) solves a provider at frequency knots; a `DenseModalTable` (`src/solprop/modes/tables.py`) interpolates the solved fields with one cubic spline per field component, fitted over all knots and all channels; `modal_transform_tables` (`src/solprop/translate/modal_tables.py`) samples the table on the run's grid into the synthesis and projection maps. Five statements of the present design bear on this SEP. - `Grid.active_mask` is $\omega_{\min}/2 < \omega < 1.1\,\omega_{\max}$ (`docs/guide/setup/grids.md`, "The active band and absorbing collars"). The kernel contract defines it as one mask of shape `(n_omega,)`, the hard band mask, and says that the linear operator and the prefactor are zero outside it (`docs/dev/kernel-contract.md`). - "A guide must be solved over at least twice the band a run declares", and outside the table's knots the stored reference is an explicit zero; a run that reaches there is refused, in `_check_active_band` (`src/solprop/translate/general.py`) and in `_check_general` (`src/solprop/translate/validation.py`). - The manual lists, among what the route does not do, "a guide sampled over a support narrower than the run's active band", and gives the reason: "the linear operator asks every channel for a propagation constant across the whole active band, through the one site every route in the package shares". It sketches a fallback for the whole guide: "the field zero-filled outside the support, the run warning by name when energy reaches its edge". This SEP builds that fallback per channel, warning included. - A provider refuses a channel that is not bound. `GradedIndexProvider` refuses a channel below cut-off, and one with more than `MAX_EXTERIOR_TAIL_FRACTION` ($10^{-4}$) of its power beyond the matching radius (`docs/guide/waveguides/graded-index.md`). - The record carries three field components at every node. `MAX_N_COMPONENTS = 3` is enforced by `ModalTransformTables`; the native kernel itself is written for one, two or three components, and refuses a delayed (Raman) response on fewer than three. **Hooks that already exist.** `ModalSample.valid` is a per-channel mask whose documentation says it "exists so that a future provider which can genuinely return a partial set has somewhere to say so". `ModalTransformTables.valid` has shape `(n_z, n_modes, n_omega_fine)` and is filled today with one mask shared by all channels. The linear operator and the prefactor of the general route already have one row per channel. Free-space routes already treat each (column, frequency) bin on its own: an evanescent bin has a capped attenuation, a clamped prefactor and no noise (`src/solprop/spatial.py`; `docs/guide/media/noise.md`). **Prior decisions.** SEP 31 (simulation coupling) defines the incident-beam launch this SEP restricts to the channels present at each bin. SEP 21 (absorbing boundaries) defines the collars and their rates. ADR-066 governs the resume identity. **Open issues.** A search on 2026-12-04 found none that asks for this. Related: - #215, the graded-index exterior-tail floor is not tied to any observable's error. This SEP makes that floor decide where a channel's support begins, and puts the place where a channel's tail is largest inside the band that holds light, so it raises the priority of #215 and does not resolve it. - #209, graded-index guides refuse hybrid `HE`/`EH` sectors: unchanged. - #198, `couple` into a general guide checks angular admission at no more than five bins: the block of channels present changes with frequency, so the probe bins include one on each side of every limit. - #213 and #196: unchanged. - Moving guides and the step-index providers with per-channel support are left to issues opened with the tracking issue. ### 4. Theory #### 4.1 The modal equations At each frequency the field at the quadrature nodes $q$ is synthesised from the channel amplitudes $a_m(\omega, z)$, in $\sqrt{\mathrm W}$: $E_{qc}(\omega) = \sum_m S_{qcm}(\omega)\, a_m(\omega)$, where $S_{qcm} = e_{m}(q, c)$ is component $c$ of the field of channel $m$ at node $q$. The nonlinear polarisation $\mathbf P_q$ is evaluated in time at each node and projected back (`docs/guide/waveguides/modal-projection.md`): $$ \partial_z a_m(\omega) = D_m(\omega)\, a_m(\omega) - i\omega\, s \sum_{q,c} Q_{mqc}(\omega)\, P_{qc}(\omega), \qquad Q_{mqc} = \tfrac14 \sum_n \big[W^{-1}\big]_{mn}\, \overline{e_n(q,c)}\; w_q . $$ $D_m$ is the linear operator of channel $m$ in the run's frame, with the collar rates; $w_q$ are the node weights; $W(\omega)$ is the flux Gram of the sampled fields, close to the identity; and $s = n_t/n_{to}$ is the spectral crop scale, the same for every channel, which is all the prefactor row holds on this route. $Q$ is the source projection. It is not the coordinate dual, which the record also carries and which recovers amplitudes from a physical field. Nothing in this SEP changes these equations; it changes the set of pairs $(m, \omega)$ over which they are posed. #### 4.2 Where a graded-index channel ends For the unbounded parabolic profile $n^2(r) = n_1^2\,(1 - 2\Delta\, r^2/a^2)$ the scalar modes are Laguerre–Gauss functions with [3] $$ \beta_{ml}^2 = k^2 n_1^2 - \frac{2 k n_1 \sqrt{2\Delta}}{a}\,(2m + |l| - 1), \qquad m = 1, 2, \dots $$ A real fibre ends the parabola at $r = a$ on a cladding of index $n_2 = n_1\sqrt{1 - 2\Delta}$. Taking a mode as bound while $\beta > k n_2$ gives, with $V = k a n_1 \sqrt{2\Delta}$, the estimate $$ 2m + |l| - 1 < V/2, \qquad\text{so for } l = 0:\quad m < \frac{V + 2}{4}. $$ It is an estimate, because the truncation of the parabola changes the modes near cut-off; the table of §2 shows it within one channel of the provider's count at every wavelength tried. Two limits must be told apart. The **cut-off** $\omega^{\mathrm{c}}_m$ is where $\beta_m = k n_2$. The **support limit** $\omega_m$ of this SEP is where the provider can still certify the channel on its finite domain: above cut-off, and with no more than `MAX_EXTERIOR_TAIL_FRACTION` of its power beyond the matching radius. Hence $\omega_m \ge \omega^{\mathrm{c}}_m$ up to the discretisation error of the solve, and $\omega_m$ approaches $\omega^{\mathrm{c}}_m$ as `extent` grows (compare the last two columns of §2). **Between cut-off and limit the fibre guides and the model does not.** Over $\omega^{\mathrm c}_m \le \omega < \omega_m$ channel $m$ is a bound mode that the provider's finite domain cannot certify. The model drops it there, and so is silent where the fibre would carry light. A run must therefore say when light reaches a limit (§4.4), and the remedy is the one the provider already names for a refusal near the floor: a wider matching radius. **Below cut-off.** A guide of this provider carries one azimuthal order. Ref. [4] (chapter 24, worked for the step profile) distinguishes two kinds of leaky mode. For order zero, the case of a centred launch, there is no tunnelling region: below cut-off a mode becomes a refracting leaky mode, and [4] says of refracting leaky modes that even their smallest attenuation is relatively high, so that they disappear rapidly along the fibre. In a ray picture the light leaves at its first arrival at the core boundary, within about half a ray period, a fraction of a millimetre for the fibre of §2; that length is this SEP's estimate and is not taken from [4]. Absence is then a fair model, with one exception that [4] also states: close enough to cut-off the attenuation of a leaky mode can be small, and the light persists as a spatial transient. The model has none of that transient, and the edge report of §4.4 marks the runs in which light reaches it. A guide of order $l \ge 1$ has in addition tunnelling leaky modes just below cut-off, which can travel a considerable distance [4]; the model drops them too, and the manual will say that a run of such a sector whose result depends on them is outside it. **Ordering.** The channels of one sector are ordered by eigenvalue, and a cut-off is that eigenvalue crossing $k^2 n_2^2$, so a channel can be above cut-off only if every channel below it is. The provider's rule (§6.1) ends the valid block at the first channel that fails, which makes the supports nested by construction. The model does not need nesting; the rule is the simplest one that keeps the channel labels. For a custom radial law the tail fraction need not grow with the order, so the rule can drop a channel that would pass on its own; it never keeps one that fails. #### 4.3 The model: a truncation that depends on frequency Let $\omega_m$ be the lower limit of channel $m$ and $\mathcal{M}(\omega) = \{m : \omega \ge \omega_m\}$ the channels present at $\omega$. The proposal is the equations of §4.1 posed on the pairs $\{(m, \omega) : m \in \mathcal{M}(\omega)\}$, with $a_m(\omega) \equiv 0$ elsewhere: - synthesis sums over $\mathcal{M}(\omega)$ only, which is the same as $S_{qcm}(\omega) = 0$ for $\omega < \omega_m$; - projection is $Q_{\mathcal M} = \tfrac14 W_{\mathcal{M}}^{-1} S_{\mathcal{M}}^\dagger w$, with $W_{\mathcal{M}}(\omega)$ the flux Gram of the fields present at $\omega$, and $Q_{mqc}(\omega) = 0$ for $\omega < \omega_m$. The set of pairs is fixed along $z$, and the span it selects differs from one frequency to the next. At each frequency the projection is a Galerkin one in the pairing $\sum_q w_q\, \overline{\mathbf E}\cdot\mathbf P$, weighted by $W_{\mathcal M}^{-1}$. A run that declares `count` channels already makes such a projection: it drops whatever part of the polarisation its channels do not span. Per-channel support drops, in addition, the part that falls on channel $m$ below $\omega_m$. In the fibre that light is radiated; in the model it is never generated. **What is conserved.** Take the quantity $N = \sum_\omega a_{\mathcal M}^\dagger W_{\mathcal M}\, a_{\mathcal M}$. Because the absent amplitudes are zero, $E = S_{\mathcal M} a_{\mathcal M}$ at every bin, and $$ a_{\mathcal M}^\dagger W_{\mathcal M}\, Q_{\mathcal M} P = \tfrac14\, a_{\mathcal M}^\dagger S_{\mathcal M}^\dagger w P = \tfrac14 \sum_q w_q\, \overline{\mathbf E_q}\cdot\mathbf P_q . $$ The nonlinear term therefore changes $N$ at the rate $$ \frac{dN}{dz}\Big|_{\mathrm{NL}} = 2 s\,\mathrm{Re} \sum_\omega (-i\omega)\, \tfrac14 \sum_q w_q\, \overline{\mathbf E_q(\omega)}\cdot\mathbf P_q(\omega) , $$ which by Parseval's theorem is proportional to $\sum_q w_q \int \mathbf E_q\cdot\partial_t \mathbf P_q\, dt$. - For the real cubic, $\mathbf P = \varepsilon_0\chi^{(3)}(\mathbf E\cdot\mathbf E)\mathbf E$, the integrand is $\tfrac34\varepsilon_0\chi^{(3)}\,\partial_t(\mathbf E\cdot\mathbf E)^2$ and the integral vanishes over the periodic window: $N$, the energy, is conserved by the Kerr term. - For `kerr_form="analytic"` the same steps hold after dividing each bin by $\omega$: the photon number $\sum_\omega a^\dagger W a/\omega$ is conserved, which is what the manual means by calling that form number-conserving. - A delayed (Raman) response conserves photon number and not energy, as on every route. The algebraic step holds at each bin and the conservation is of the sum over bins; both need the absent amplitudes to be exactly zero. That is why the contract gains a per-channel mask (§6.1) instead of a rate that damps whatever leaks. **The metric.** The conserved $N$ is in the sampled Gram $W_{\mathcal M}$, the matrix $Q$ inverts. The route's `physical_energy` uses the identity. The two differ by the Gram defect $\lVert W - I\rVert$, which a table admits up to `DEFAULT_GRAM_ATOL`, $10^{-4}$, a budget set equal to the tail floor because the sampled Gram is short by the power beyond the matching radius. With $W \ne I$ the linear part also makes $a^\dagger W a$ beat at the size of the defect. Today the defect is largest at the foot of the active band, inside the spectral collar, where there is no light. Under this SEP each partial channel has its largest defect at its own limit, and those limits lie where light is: for the fibre of §2 with `extent=3.0`, `LP05`, `LP06` and `LP07` end at 1.75, 1.44 and 1.22 µm (`LP03` and `LP04`, at 3.04 and 2.23 µm, end beyond the declared grid; these are for 96 elements, and 64 moves them by less than 3 nm). The reported energy is therefore conserved to the integration error plus a term bounded by the Gram defect times the energy held by channels near their limits. The defect meant is the interpolated one: the largest $\lVert W(\omega) - I\rVert$ over a channel's first knot gap, which the route already measures over the whole band as its active-band departure. It is not the value at the knot alone. The guide reports each channel's tail fraction and interpolated defect at its limit, so that the bound can be read. Two consequences of the model follow directly. - **Noise.** Input shot noise is one photon per bin in each power port. A pair $(m, \omega)$ with $\omega < \omega_m$ is not a port and carries none, as for the nonpropagating bins of a free-space grid (`docs/guide/media/noise.md`). The random stream is drawn over every bin and masked afterwards, so a seed gives the same draw in the bins that are present. - **Launch.** The flux pairing of an incident field with the channels is solved at each occupied bin on the block $\mathcal{M}(\omega)$. Incident light that the absent channels would have taken is not launched, and the coupling report counts it with the light the guide misses. A named-channel launch meets its declared energy before the mask is applied; what the mask removes is reported and not restored. #### 4.4 The edge of a support **At build.** A guide that drops a channel anywhere in the active band issues a warning of a named category when it is built, listing each such channel with its limit. Without it a declared `count=7` could mean four channels over half the band and the user would learn of it only from a log. **Report.** For each partial channel the run records the energy it holds in the edge band $[\omega_m, \omega_m(1+\epsilon)]$ as a statistic, and warns by channel name when that energy exceeds a declared fraction of the run's energy. The width $\epsilon$ is fixed by the manual and does not depend on the collar below (Q4). This is the warning the manual's sketch asked for. It marks the cases in which the model is least faithful: light that the fibre would guide between cut-off and limit, light in a weakly leaky field just below cut-off, and light in a field whose certified tail is at the floor. **Collar.** A support that ends abruptly leaves the spectrum of channel $m$ with a step at $\omega_m$ whenever light reaches it, and a step in frequency is a slow tail in time, which the temporal collar then has to absorb. The grid's own band edges have the same property, and solprop tapers them with a Planck window turned into an absorption rate (`docs/guide/numerics/boundaries.md`). The proposal offers the same for a channel: a **channel collar**, a window $w_m(\omega)$ rising from 0 at $\omega_m$ to 1 at $\omega_m(1 + \delta)$, converted to a rate by the function that converts the grid's collar, over the same reference length $\ell$ (`length / boundary_N` by default) and with the same cap ($\alpha\ell \le 60$), and added to $D_m$. A channel whose limit is the lowest knot has its full support and no collar. Whether the collar is on by default, and its width $\delta$, are set by measurement in phase 3 (Q1). #### 4.5 Absent bins For $\omega < \omega_m$ the amplitude, the prefactor and $D_m$ are zero, as the contract already says of every bin outside the active mask. The mask is per channel (§6.1), so no rate is needed to hold those bins at zero and none is applied. ### 5. Proposed interface ```text guide = ModalGuide.from_provider(provider, knots, nodes=nodes) # cutoff="drop" guide = ModalGuide.on_grid(grid, provider, knots=193, n_r=2, cutoff="refuse") print(guide) # each channel's support, tail fraction and Gram defect at its limit run = prop_waveguide((), None, provider=guide, grid=grid, incident=beam, ...) ``` - `cutoff`: `"drop"` (the default) or `"refuse"`. Under `"drop"` a channel the provider cannot certify at a knot is absent there, and the guide warns when it is built (§4.4). Under `"refuse"` the guide is refused by name, as today. A provider that cannot report a partial set (under this SEP, every provider but `GradedIndexProvider`) refuses on its own under either value, as today. - `limits`: an optional mapping from channel label to a frequency in rad/s, which raises that channel's limit above the provider's. A limit below the provider's is refused. It lets a run drop a channel where it is certified but not wanted, and gives the verification a case with an exact reference (§7). - `cutoff_collar`: the relative width $\delta$ of the channel collar; `0` for no collar. It does not change the edge band of §4.4. - The limit of a channel is the lowest knot from which it is valid at every knot up to the top of the band (Q2). It is reported per channel by the guide and recorded in the run's metadata. - The statistic of §4.4 is on for a guide with a partial channel. **The provider's side.** `solve` stays strict, and a provider that can report a partial set says so through a refinement of the provider protocol, in the way `ParameterisedMode` refines `Mode`: `PartialModalProvider(ModalProvider, Protocol)` in `src/solprop/modes/vector.py`, with one method, `solve_partial(omega, z, *, nodes)`. It returns a sample whose `valid` is false for the channels the provider cannot certify. Under `"drop"` the guide calls `solve_partial` on a provider of that protocol, and `solve` on any other. Every other caller of `solve`, the moving-guide paths among them, keeps today's refusal by name without a change to its code. A node rule is different. Its mesh does not depend on the frequency or on the channels; only its tail certificate does, and today `GradedIndexProvider.node_rule` refuses unless every channel is bound at the rule's frequency. The usual script builds the rule at the lowest knot before it builds the guide, so that refusal would come before the guide could drop anything. `node_rule` therefore certifies the channels that are bound at its frequency and records which they are; it still refuses when the first channel is not bound. A caller that has not asked for partial sets still meets the strict `solve`, so the wider rule cannot let an unbound channel through. The guide takes each other channel's certificate at that channel's own limit and keeps the certificates per channel in the table. Under `"refuse"` the guide refuses a rule whose certificate does not cover every channel, by the name used today. **Refused, by name:** - a channel valid at fewer than four knots (a cubic needs four); - a channel whose valid knots are not one interval reaching the top of the band; - the frame channel (the first) with less than the full band; - a launch that puts a named channel's whole spectrum outside its support; - an input state given to `Simulation.with_input` with content in absent bins; - a resume whose guide has different supports from the file's (the identity differs); - a moving guide, a declared basis or a degenerate block with a partial channel. Each point of a scan builds its own guide, so a scan over the grid or the geometry moves the limits from point to point; that is allowed and each point records its own. Recipes and the front end take the keywords as they take the other guide options. Output files keep their schema. The modal identity records `cutoff`, `limits`, `cutoff_collar` and the supports, at their defaults too (§9). ### 6. Implementation strategies #### 6.1 Carrying the support **Option A (recommended): carry a validity mask through the existing objects.** The provider reports `valid` per channel at each knot; the table interpolates each channel over its own knots; the transform tables zero the maps outside each support and fill `valid` per channel; the consumers that today reduce `valid` over channels read it per channel; the backends mask per channel. **Option B: one table per frequency segment.** The band is cut at the limits and each segment gets a guide with its own channel count. The low channels' splines would then break at every limit, and every consumer would need a notion of segment. Rejected. **Option C: zero-filled fields with the present shared spline.** A spline through a channel's zero and non-zero knots rings into its valid region. Rejected. For Option A, by layer: - **Physics (`src/solprop/modes/`).** - `PartialModalProvider` joins `ModalProvider` in `vector.py`, and `GradedIndexProvider` implements it: in `solve_partial` channels are solved in order, and the first that fails the cut-off probe or the tail floor ends the valid block. `solve` is unchanged. `node_rule` and `tail_bound`, which today call `_require_bound_channels` for every channel at the rule's frequency, certify the channels bound there and record them (§5). - `ModalSample` admits a flux metric that is positive definite on the valid block, with the identity on the rest (the convention `interpolated_gram` already uses outside the band). `align_modal_sample` tracks the valid block. - `DenseModalTable` keeps one spline per channel over that channel's knots when some channel is partial, and the present joint spline when none is, so a guide with full supports takes today's code path. Its construction check and Gram gate act on the valid block. - `ModalGuide`: the held-out checks, the profile error and the area knot are taken per channel over its own knots. `ProviderChannelMode` exposes its support, and its callers that today ask for $\beta$ anywhere in the band are restricted to it: the `zdw` statistic's search window, the recipe preview's `zdw`, and `aeff` at the area knot. The frame reads the first channel, which keeps the full band. - **Translation (`src/solprop/translate/`).** - `modal_transform_tables` fills `valid` per channel, inverts the Gram on the valid block for $Q$ and for the coordinate dual, and leaves zeros elsewhere. - `interpolated_gram` and `metric_departure` (`translate/general.py`), which gate the route on the interpolated Gram over the band, take the identity on the absent block; without that an absent channel reads as a departure of one and the guide is refused. The departure is also reported per channel over its first knot gap (§4.3). - `_check_active_band` and `_check_general` require the union of the supports to cover the active band and each limit to lie on a knot. The debug summary of `translate/problem.py`, which reduces `valid` over channels, reports the supports. - `dispersion_operator` gains an optional per-bin support, so the shared site stays one site: it asks `neff` over the support only and writes zero elsewhere. The channel collar joins the absorber rate, which becomes per channel on this route. `_general_prefactor` is zero outside a support. `walk_off_buckets`, whose `active` argument is `(n_omega,)` today, takes the per-channel mask and treats absent bins as unreadable. - **The kernel contract and the backends.** `grids.active_mask` stays what it is: the band mask of shape `(n_omega,)` that every route shares and that `norm_mask` defaults to. The general route gains a per-channel leaf, `channel_mask` of shape `(n_modes, n_omega)`: the band mask restricted to each channel's support. On this route it takes the band mask's place wherever a channel's spectrum is written, which is the in-stage absorber term and the hard mask of every march, under both absorber schemes. Without it the temporal absorber, a multiplication in time of a channel's whole spectrum, writes into that channel's absent bins, and the next stage reads them back; the stored output, the energy and flux statistics, the controller's error norm and the boundary monitor all read those bins. The first-same-as-last identity depends on the absorber term being masked as the state is (the term's own documentation records $7.4\times10^{-7}$ without the mask against $1.8\times10^{-16}$ with it), so both are changed together. Synthesis and projection are linear contractions of the maps, with no division by a norm or a propagation constant, and need no change. - In `numpy_ref` the sites are `absorber_term` and `apply_hard_mask`. The contract page, the frozen tables of `tests/backends/test_driver.py` and a release note change with them, in phase 3. - In the native build the band mask is read in the trial sources of each march (`trial_stage`, `trial_finish`, `trial_low_storage`, `trial_split_step`, `trial_adams` and `trial_separable` under `native/src/general/`), in the set-up and in the statistics. Phase 5 goes through each. - Between phases 3 and 5 the native build refuses, by name, a problem whose channel rows differ, as SEP 0 requires of a backend that has not yet built a feature. A problem whose rows are equal runs as it does today, on either backend. - **Driver.** - Noise is masked after the draw, in both noise models, and the masked draw is the one stored, so the boundary monitor's floor and `noise_floor="subtract"` read it. - Named-channel launches and `with_input` states follow §4.3 and §5. - The incident launch (`_vector_paraxial` in `src/solprop/coupling/coupler.py`) solves on the full channel block in three places: `_vector_coordinates` (two solves against the flux matrix and a call of `_whitened_extremes`), `_closure_item` (a whitened eigenproblem against the Gram of the closed fields) and `_target_angular_vector`. With absent channels the full block is singular, so each runs on the block present at its bin. The same holds for `_flux_recovery` on the same-basis path. - `_probe_bins` returns at most `_TARGET_BINS` (five) bins. With partial channels it adds one bin on each side of every limit inside the occupied band, beyond that cap. - **Processing, recipes, front end.** The functions of `solprop.processing.modal` rebuild the reference from the guide and inherit the supports; the recipe metadata takes the keywords. - **GPU.** Nothing specific: the mask and the maps are data. **Cost of the support itself at run time.** None in time or memory: the maps keep their shape and the mask is one array of booleans. Building a guide costs the same number of provider solves. #### 6.2 Performance at the scale of the use case The general modal route has been timed on one graded-index case, `grin_nonlinear` of the standard suite: four channels, 412 nodes, 1537 frequency bins, 198 steps. The use case of §2 is a different regime: a 10 ps pulse in a declared window of 40 ps (the boundary monitor needs a window about four times the pulse to admit the launch), on a 600 nm to 2.1 µm grid. That grid has 40 961 coarse bins, 26 137 of them active, a realised window of 54.7 ps and a fine axis of 163 840 samples. The pump and its sidebands walk apart by 12 to 24 ps/m, so the pulse cannot be much shorter. The worked example declares `dz_max` as a tenth of the self-imaging period, 0.061 mm here; that is a choice, not a necessity, and at that step a metre is about 16 300 steps of six evaluations. **Measured.** solprop 0.4.0 on an Apple M5 Max, native CPU build, the default six threads; the fibre of §2 with **two** channels, 64 elements and 768 nodes (`extent=3.0`, `n_r=2`; 96 elements would be 1152 nodes and half as much again in time and memory), Kerr only (no Raman), `RungeKutta()`. The first three rows are the timed evaluations of `Simulation.estimate()`. The last is the median wall time of the first 120 accepted steps of a 10 cm run, 11.3 s, divided by the six evaluations of a step, so it includes the step's other work. | Declared window | Coarse bins | Time per source evaluation | |---:|---:|---:| | 2 ps | 2 049 | 0.020 s | | 6 ps | 6 145 | 0.11 s | | 25 ps | 24 577 | 0.99 s | | 40 ps | 40 961 | 1.9 s | Twelve and eighteen threads were no faster than six at 6 145 bins. At 40 961 bins the process held up to 51 GB, and building the guide and the record took 167 s. A stack-sampling profile of the last row during stepping gives, of the calling thread's samples inside a source evaluation, the fraction in each part. It is not a division of wall time among threads. | Part | Share | |---|---:| | The two transform passes (fine axis, per node and component) | 83 % | | The cubic at the nodes | 11 % | | Synthesis, projection and the rest | 6 % | During the transforms about three of the six threads were doing arithmetic; the others were waiting. **Estimates, not measurements.** At six evaluations a step and 16 300 steps a metre, the last row is about 51 hours for a metre with two channels. The transforms depend on the nodes and components and not on the channel count, so seven channels cost little more in time; in memory they do not fit. In units of `16 × nodes × 3 × channels × n_omega` bytes the record of a snapshot guide holds fourteen: - the synthesis and projection maps (2); - E, H and their two reciprocal partners, each tabulated at two positions of which the second is a copy of the first (8); - the six-component coordinate dual, also at two positions (4). The unit is 3.0 GB for the two-channel run, so its record is 42 GB, against the 51 GB peak measured. For seven channels the unit is 10.6 GB and the record 148 GB; with the same margin the run as it stands would need about 180 GB. It fits no workstation and no single 80 GB device. **The phase.** Phase 1 profiles ten-step windows at this scale on the native CPU build, and ranks what it finds by time and by memory. The candidates below are hypotheses to test, in the order they will be examined. Each one that is implemented is measured as an A/B comparison by the rules of `docs/dev/benchmarking.md`, on windows only. *Exact: results equal to rounding.* - **Field components that are identically zero.** An `LP` sector of `GradedIndexProvider` fills one Cartesian component of $\mathbf E$ and leaves the other two zero. The record is fixed at three, and both backends transform and contract all three. Carrying only the components that are non-zero at every node, channel and bin is a change to the record and the contract (`MAX_N_COMPONENTS` stays the bound; the count becomes the guide's). The native kernel is already written for one to three components, but refuses a delayed response on fewer than three, and a silica supercontinuum run declares Raman, so the delayed pass must be extended to the reduced count (one pair history in place of six). Expected: three times fewer transforms and a third of the map memory. - **Quadrature nodes that repeat by symmetry.** For azimuthal order zero the `LP` rule has two angular nodes, at $\theta$ and $\theta + \pi$, with equal weights and, for a field that does not depend on angle, identical values. Folding them into one node with the summed weight halves the nodes of such a run. - **Inactive coarse bins.** The 36 % of coarse bins outside the active band (27 % above $1.1\,\omega_{\max}$ and 9.5 % below $\omega_{\min}/2$) are zero columns of every map, stored and contracted. Maps held over the active bins only are a third smaller. - **Absent bins.** With per-channel support a further block of each map is zero: about 15 % of the (channel, bin) pairs of the seven channels of §2, more for guides with many high-order channels. - **The duplicated position.** A snapshot guide tabulates E, H, their partners and the dual at two positions and copies the first into the second. Holding one removes six of the fourteen units. - **The reciprocal partners.** For this provider the backward fields are the conjugates of E and H, one with its sign changed. Deriving them where they are used removes two more of the units that remain. - **What must stay resident.** Twelve of the fourteen units are the reference (E, H, the partners and the dual), which the stepping does not contract, and which processing already rebuilds from the guide. If the run does not need it after the launch, only the two maps remain (Q5). - **Threading of the transforms.** With half the threads idle during 83 % of the evaluation, the first thing to try is one single-threaded transform per row with the rows shared among the threads, against the present threaded plans. - **Building the record.** `modal_transform_tables` loops in Python over every bin inside the table's band, with a spline evaluation and an inverse in each, and its cost grows with channels and bins. The profile says how the 167 s above divide between it and the provider's solves. *Inside a declared budget.* - **The radial rule.** The quadrature panels are the finite elements of the mode solve, with `n_r` Gauss points in each (four by default; the worked example and the runs above use two), so the node count follows the mesh that resolves the eigenproblem. The profiles are piecewise linear with kinks at the element edges, so a rule that is not split there is no longer exact for the quartic integrand; a coarser rule is adopted only with its quadrature error measured against the present one and that budget stated in the manual. *To measure.* - **The step and the stepper.** Whether `dz_max` of a tenth of the period is needed, and whether `Multistep()`, with one evaluation a step in place of six, holds its accuracy there, are decided by a work–precision comparison on a short window. - **The Raman pass.** None of the timings above has Raman on. The delayed pass adds work at every node, and is profiled with the rest. - **A GPU.** Worth timing only once the run fits a device. **Target and end of the phase.** Two benchmarks are added to the standard suite. Both run today, and each is a ten-step window on the native CPU build: - *long*: the two-channel run measured above (the fibre of §2, 64 elements, 768 nodes, 40 961 bins); - *wide*: seven channels on the same mesh with 6 145 bins, on a guide whose core is wide enough that today's route admits its seven channels (a record of 22 GB). The target, on both, with results equal to rounding (inside the declared budget for a changed rule): at least four times less wall time per accepted step, and at least four times less peak resident set size of the process over the build and the ten steps. The baseline is the value measured on the same machine at the start of the phase. Every candidate above is either implemented or rejected with its measurement. A target only just met leaves the seven-channel use case at about 45 GB. The exact candidates, if all of them hold, leave the two maps at one component, half the nodes and the active bins: a few gigabytes. Phase 6 records the *long* window on the fibre of §2 with its seven channels. #### 6.3 Cost in code and dependencies **Cost in code (estimates, to compare at Final).** For the support: about 800 lines of source, 1100 of tests and 300 of documentation, most of the source in `tables.py`. The performance phase is not estimated before its profile. **Dependencies.** None. ### 7. Verification and validation | | Check | Quantity | What sets the tolerance | |---|---|---|---| | V1 | Full supports | A guide whose channels all cover the band, built under `cutoff="drop"`, against the same guide under `"refuse"`: the tables (phase 2), and a ten-step run on the same backend and thread count (phases 3, 4 and 5, as each adds code on the path) | Bit identity: the joint spline, equal mask rows, no collar on a channel whose limit is the lowest knot, the unmasked noise draw and the same node rule are the same code path | | V2 | Limits | Each $\omega_m$ against a cut-off computed independently, and against $(V+2)/4$. The reference is a deliverable of phase 2: the layer oracle of the modal-design tests covers the TE0 and TM0 sectors at one wavelength today, and gains an `LP` residual of order $l$ ($J_l$ and $Y_l$ inside, $K_l$ outside) and a root for the cut-off $\beta = k n_2$, compared with the provider on a non-dispersive profile | $\omega_m \ge \omega^{\mathrm{c}}_m$ less the oracle's measured discretisation error; the gap does not grow over `extent` 1.5, 2, 3 at knot resolution; the estimate within one channel | | V3 | No ringing | A partial channel's interpolated field and $\beta$ at held-out frequencies in its first knot gaps, against fresh solves | The existing `beta_rtol` and profile-error budgets, per channel | | V4 | Linear propagation | A pulse in one partial channel whose spectrum straddles the limit, set as a masked state at the problem level: the part above acquires the phase $\beta_m z$ of fresh provider solves at those bins; the part below is absent | `beta_rtol` times $\beta_m z$ | | V5 | Absent bins | Every absent (channel, bin) of the state and of each stage derivative over ten steps of a Kerr run with light at a limit, temporal absorber on, under both absorber schemes and for each march the route offers (`RungeKutta`, low-storage, split-step, `Multistep`) | Exactly zero | | V6 | First-same-as-last | The stored last stage against a fresh evaluation at the accepted state, with partial channels, for each march that reuses a stage | Rounding, as the absorber term's documentation records for the route today | | V7 | Conservation | (a) The rate of $N$ from one source evaluation, at a state with light at a limit. (b) The reported energy over ten steps of a Kerr run with light at a limit, collars off; photon number for the analytic form | (a) The value the same rate takes for the same state on the guide with full supports, where aliasing of the quartic on the fine axis sets it and the support does not. (b) The integration error at the run's `rtol`, plus the largest interpolated defect over the first knot gaps times the energy in channels within their edge bands | | V8 | Raised limits | A guide whose channels all cover the band (today's route is the reference), against the same guide with the limits of its upper channels raised into the lit band through `limits`, noise off. Observable: the relative 2-norm of the difference of the two states over the bins present in both, after ten steps, at three positions of the raised limits | The difference is first order in the dropped amplitude, so it is compared with $\sqrt{\eta}$, where $\eta$ is the fraction of the reference run's energy below the raised limits. The ratio is reported and must not grow as $\eta$ falls; with the limits below all of the reference's content the difference is at the level of that content | | V9 | Knot placement | Shift the knots so a limit moves by one gap | The change in V8's observable, reported, not gated | | V10 | Noise | The masked draw against the unmasked one for one seed | Equal in present bins, zero in absent ones | | V11 | Launch | A `vector_paraxial` incident beam into a guide with limits raised by `limits`: amplitudes at bins where all channels are present against the same guide without the raised limits; amplitudes at a bin where $k$ channels are present against the same provider declared with `count` $= k$ | Rounding | | V12 | Walk-off | `walk_off_buckets` with a limit inside the band | Absent bins contribute no rate | | V13 | Identity | A resume across a change of supports; a rebuild of the reference by the processing functions | Refused by name; equal to the run's tables | | V14 | Limit report | The tail fraction and Gram defect each guide reports at each limit, against direct evaluation | Rounding | | V15 | Parity | `numpy_ref` against native, ten steps, partial channels | The existing parity tolerance of the general route | | V16 | Performance | Each change of phase 1: time per evaluation and per step and resident memory on a ten-step window of the use-case benchmark, before and after | Results equal to rounding for the exact changes, inside the declared budget for a changed rule; the target of §6.2 for the phase | | V17 | Published physics | First GPI sidebands of the fibre of §2 against 125 THz from the self-imaging period and $\beta_2$, and the 123.5 THz measured in [1] | Reported in the worked example; the formula keeps only $\beta_2$, so a few per cent | | V18 | Edge report | The edge statistic against a direct sum over the edge band; the run warning on each side of its threshold; the build warning for a guide that drops a channel and its absence for one that does not | Rounding; fires and does not fire | | V19 | Channel collar | The rate added to $D_m$ against the grid collar's conversion of the same window; its cap; its absence outside $[\omega_m, \omega_m(1+\delta)]$ and on a channel with full support | Rounding | No test or timing runs a full-length propagation. In phase 3, before launches are masked, the run-level checks set masked states at the problem level and bring light to a limit by raising the limit into the pulse's spectrum with `limits`. V17 has two parts. The gallery example is a short case sized to the gallery's budget: a pulse of about a picosecond at a few hundred kilowatts over a few centimetres, a few minutes of run time, with its output committed like the other galleries'; phase 6 fixes its numbers. The comparison with [1] at the experiment's power needs the use-case run, tens of hours long, which is a user's run and not a check of this SEP; its result is recorded in Part II when it exists. ### 8. Documentation - `docs/guide/waveguides/general-modal.md`: a section on per-channel support, the default, the edge report, and the entry under what the route does not do rewritten. - `docs/guide/waveguides/graded-index.md`: the near-cut-off paragraph, with what `"drop"` does at the tail floor and the gap between cut-off and limit. - `docs/guide/waveguides/modal-tables.md`: the statement that every sample is valid, and the Gram gate per channel. - `docs/guide/waveguides/radial-quadrature.md`: folded nodes and any changed rule (phase 1). - `docs/guide/waveguides/solid-fibres.md`: the sentence that bounds the channel count by the long end of the active band. - `docs/guide/media/noise.md`: absent channel bins carry no photon. - `docs/dev/kernel-contract.md`: the per-channel active mask and the component count. - `docs/guide/performance/resources.md` and `docs/dev/benchmarks.md`: the memory of a general modal run, the use-case benchmark and what phase 1 measured. - A worked example in the waveguide gallery: the fibre of §2 with seven channels. ### 9. Compatibility and impact - **Default.** `cutoff="drop"` is the default. For a guide whose channels all cover the band the results are unchanged. A guide that is refused today builds, with a warning that names the dropped channels and their limits. `cutoff="refuse"` restores the refusal. - **Direct callers of the provider.** `GradedIndexProvider.node_rule` and `tail_bound` return where today they refuse for a channel that is not bound at the rule's frequency (§5). `solve` is unchanged, and so are the other providers. - **Kernel contract.** At least two changes, each with a release note: the general route gains the per-channel mask leaf, and the record's component count becomes the guide's. Phase 1 may add others (maps over the active bins only, one tabulated position, a reference that is not resident); each is recorded on the contract page when it is made. The frozen tables of `tests/backends/test_driver.py` are rewritten with each. - **Identity and resume.** The modal identity records the new fields at their defaults, so the configuration hash of every general modal run changes with the release that carries them, and a file written before it does not resume after it. That is the project's rule for new configuration fields. Reading older files is unaffected. - **Output schema.** Unchanged. - **Luna.jl.** It has no general modal route, so there is no difference to record. ### 10. Alternatives considered - **Move the foot of the grid's low-frequency collar.** The factor one half in the active band is a convention of the grid. A foot at $0.9\,\omega_{\min}$ would shorten the band a guide must cover from a factor 2 to about 1.1 below the declared edge. For the fibre of §2 that admits three channels, not seven, and it changes a grid convention that the output record and several routes assume. It is independent of this SEP and is not proposed here. - **Close the outer boundary.** A finite cladding ending at a wall keeps every channel bound at every frequency: below its core cut-off a channel continues as a cladding mode. It is a small change confined to the provider. It models a bare fibre in air; in a coated fibre the cladding light is stripped, and the model would keep it. It remains a possible separate option of the provider. - **A double-clad profile through a custom radial law.** Needs no code, but the `LP` family's contrast limit of 0.02 is measured from the axis to the outer medium, and a fibre of numerical aperture 0.2 is already at 0.019. - **A damping rate in absent bins in place of a mask.** The first draft kept the shared mask and proposed to measure what leaked into absent bins, with a capped rate to remove it. Leaked content is read back by the next stage's absorber term and by the statistics, and the conservation identity of §4.3 needs exact zeros, so the mask is adopted outright. - **Opt-in.** The first draft kept refusal as the default. The author chose `"drop"`, because it acts only where a guide is refused today and the build log and the edge report make it visible. - **Performance as a separate proposal.** Optimisations that leave results unchanged need no SEP. It is kept here, first, because the use case does not fit in memory without it and because the component count and the per-channel mask revise the same contract. - **Leave it to the user.** Declaring a shorter grid loses the long sideband, and with it the four-wave mixing that produces the short one. ### 11. Phases 1. **Performance.** The profile, the candidates and the two benchmarks of §6.2, on the native CPU build with `numpy_ref` kept in step where the record changes. Qualified by V16 and the target. 2. **Modes.** `PartialModalProvider`, `solve_partial` on `GradedIndexProvider` and the per-channel certificate of the node rule; per-channel knots, splines, checks and limit reports in the table and the guide; `limits`; the build warning; the `LP` cut-off oracle. Verifies V1 (tables), V2, V3, V14. 3. **Translation and `numpy_ref`.** Transform tables, the Gram gate, the two checks, the linear operator, prefactor, walk-off mask and channel collar; the per-channel mask leaf in the contract and in `numpy_ref`, with the frozen tables; the native build's refusal of unequal rows. Measures the collar of Q1. Verifies V1 (run), V4 to V9, V12 and V19, on states masked at the problem level. 4. **Driver.** Noise, launches, the coupling solves, the edge statistic and warning, the processing rebuild, identity and resume. Verifies V1 (run), V10, V11, V13, V18. 5. **Native.** The per-channel mask in every march of the native CPU build. Verifies V1 (run) and V15, and V5 and V6 on native. 6. **Documentation.** The manual pages of §8, the recipe metadata, the gallery example and the *long* benchmark window on the fibre of §2. Records V17. ### 12. Open questions - **Q1 (phase 3).** Channel collar on or off by default, and its width $\delta$, from the sensitivity of V8's observable and of the temporal window's edge energy to both. - **Q2 (phase 2).** Whether a limit snaps to a knot, as proposed, or the guide refines it by bisection and adds a knot there. - Q3, the provider's side of `"drop"`, was decided by the author on 2026-12-04 as §5 states it. The other numbers are kept. - **Q4 (phase 4).** The width $\epsilon$ of the edge band and the default threshold of the edge warning. - **Q5 (phase 1).** Whether the reference (E, H, the partners and the dual) must stay resident during a run. ### 13. References 1. K. Krupa, A. Tonello, A. Barthélémy, V. Couderc, B. M. Shalaby, A. Bendahmane, G. Millot and S. Wabnitz, "Observation of geometric parametric instability induced by the periodic spatial self-imaging of multimode waves," *Phys. Rev. Lett.* **116**, 183901 (2016). doi:10.1103/PhysRevLett.116.183901 2. S. Longhi, "Modulational instability and space time dynamics in nonlinear parabolic-index optical fibers," *Opt. Lett.* **28**, 2363 (2003). doi:10.1364/OL.28.002363 3. D. Gloge and E. A. J. Marcatili, "Multimode theory of graded-core fibers," *Bell Syst. Tech. J.* **52**, 1563 (1973). doi:10.1002/j.1538-7305.1973.tb02033.x 4. A. W. Snyder and J. D. Love, *Optical Waveguide Theory* (Chapman and Hall, 1983), chapter 24, "Leaky modes", and chapter 7 on leaky rays. ## Part II — Implementation record ## Part III — History - 2026-12-04: Drafted. The provider counts of §2 and the timings of §6.2 were computed and measured the same day with solprop 0.4.0. The DOIs of references 1 to 3 were checked against the Crossref registry. References 3 and 4 were not re-read by the drafting agent: the formula of §4.2 was re-derived, not transcribed, and the statements of §4.2 about refracting and tunnelling leaky modes rest on reference 4 as cited by the first review, so they must be checked against the book before acceptance. Tracking issue and pull request: opened on the author's word, not yet. - 2026-12-04: First AI review (Opus 5.5), recorded below, and the revision that answers it. The author decided four points raised by it: the per-channel active mask is adopted in the contract (R2); the performance phase is held to a ratio target (R9) and comes first; and `cutoff="drop"` is the name and the default. - 2026-12-04: Second AI review (Opus 5.5, clean context), recorded below, and the revision that answers it. The drafting agent checked the review's statements about the code before acting on them, and recomputed the counts of §2 and the limits of §4.3 at 64 elements. It also read reference 4, in a copy whose edition it could not confirm against a registry: section 24-19 and the paragraph on attenuation that follows equation (24-38), and the passage of chapter 7 on refracting rays. They support what §4.2 now says: order zero has no tunnelling region, refracting leaky modes are strongly attenuated, and a leaky mode close enough to cut-off can have a small attenuation. Those passages treat the step profile. The attenuation curves for order zero (figure 24-4(b)) and the transmission of a clad parabolic profile were not read, and the half-ray-period length of §4.2 is the drafting agent's estimate. Reference 3 is still not re-read. The changes made in answer to the second review have not themselves been reviewed. - 2026-12-04: The author decided Q3. `solve` stays strict; a provider reports a partial set through `solve_partial`, declared as the refinement protocol `PartialModalProvider`; and `node_rule` certifies the channels bound at its frequency. The alternative, a `solve` that always returns a flagged partial set, was set aside because an unadapted caller would then receive zero fields where today it receives a refusal. The drafting agent also corrected §5, which had placed the provider protocol in `modes/protocol.py`; it is `ModalProvider` in `modes/vector.py`. - 2026-12-04: Tracking issue #966 opened, and the draft's pull request, on the author's word. ### AI review — 2026-12-04 Reviewer: Opus 5.5 (AI). I read Part I against SEP 0 §6 and §7 and checked it against the code on `docs/sep-0055-per-channel-frequency-support` (based on `main` at 0f0013f0). Nothing in the draft was edited. To check the §2 table and the grid sizes I reran them with `PYTHONPATH=src`, the provider at 96 elements and the default `fused_silica()` law. --- **R1. The use case needs about 76 GB of resident memory, and the SEP says nothing about it** (§1, §2, §6.1 "Cost of the support itself", §6.2). Priority: **high**. *Problem.* The support itself costs no memory, as the draft says. But the run it is meant to make possible does not fit, and §6.2 only looks at time. On this route the record holds the following for every node, every one of three components, every channel and every coarse bin, as complex128: - the synthesis map S and the projection map Q; - the dense E and H; - the coordinate dual, which has 6 components. `general_memory` counts all of these as resident (`src/solprop/backends/numpy_ref/general_modal.py:555-652`; shapes in `src/solprop/translate/modal_tables.py:620-641`). For 768 nodes, 7 channels and 49 153 bins: - one 3-component array is 768·3·7·49 153·16 B ≈ 12.7 GB; - S, Q, E and H come to 4 × 12.7 GB, and the dual to 2 × 12.7 GB, so about **76 GB** before any transient copies; - `ModalTransformTables.__post_init__` copies each leaf with `frozen_copy`, and the native backend uploads its own copy of S and Q, so the peak is higher still. That rules out an 80 GB device, so "A GPU" in §6.2 is not a real candidate as things stand. The 2-channel, 24 577-bin case that was timed holds about 11 GB, which is why this did not show up there. *Recommendation.* - Add memory to the use-case analysis: the ledger rows at the use-case scale, and a statement of which machine can hold them. - Have the performance phase rank its candidates by memory as well as time. The exact candidates are also the memory remedies: about 3× from the components that are identically zero, 2× from folding the duplicate angular nodes, and about 1.5× from the inactive coarse bins (R7). - Say whether the resident E, H and dual must stay resident, or can be rebuilt from the guide, as processing already does. --- **R2. "No kernel-contract change" is not credible: the shared active mask writes into absent bins, and that content does reach the field** (§6.1 "Backends", §4.5, §9, §12 Q1). Priority: **high**. *Problem.* Q1 says leaked content "cannot reach the field, because the synthesis map is zero there". That is wrong. The in-stage absorber is a time-domain multiply on each channel's whole spectrum. Today its result is masked with the one shared `active_mask` (`passes/stepping.py:286-369`), so it writes into channel m below ω_m. The next stage's absorber term then reads those bins back into the present bins. The split scheme does the same: `apply_temporal_rate` followed by `apply_hard_mask`, which is again the shared `(n_omega,)` mask (`stepping.py:372-407`). Content in absent bins is also read by all of the following: - the stored output and the processing accessors; - `physical_energy`, `analytic_flux` and `spectral_flux`; - the controller's `error_norm` over `norm_mask` (`stepping.py:229-283`); - the boundary monitor's per-channel time-domain energy. The FSAL identity is exposed too. `absorber_term`'s own docstring records 7.4e-7 before the band mask was applied to it, against 1.8e-16 after (`stepping.py:318-323`). If a later fix zeroes absent bins only in the hard mask, that defect comes back. The contract today defines `active_mask` as `(n_omega,)` and says "`D` and the prefactor are zero outside it" (`docs/dev/kernel-contract.md:340`). The per-channel prefactor (`translate/assembly.py:849-876`) is already a per-channel source mask, so the absorber term and the hard mask are the only shared-mask consumers left. Gating the decision on "below the run's `atol`" judges a structural defect by a step-size tolerance. *Recommendation.* Decide Q1 now, in favour of a per-channel active mask, `(n_modes, n_omega)` or derived from `valid`, applied to both the absorber term and the hard mask on both backends. Name the phase that rewrites the frozen tables of `tests/backends/test_driver.py` and adds a release note (SEP 0 §7, "The seam"). The cap in §4.5 then becomes a safeguard, not the mechanism. --- **R3. Theory §4.1 and §4.3: the projection is misstated, and the conservation claim has no derivation and the wrong metric** (§4.1, §4.3, V5). Priority: **high**. *Problems.* 1. §4.1 calls Q "the flux dual of S", and §4.3 writes $Q = W_{\mathcal M}^{-1}S_{\mathcal M}^\dagger w$. - The code is $Q[m,q,c] = [W^{-1}]_{mn}\,\overline{e_n(q,c)}\,w_q/4$ (`translate/modal_tables.py:502-533`): the factor 1/4 is missing from the draft. - The manual says explicitly that the flux (coordinate) dual is *not* the nonlinear projection (`docs/guide/waveguides/modal-projection.md`, "Source projection and amplitude recovery are different operations"). - $P_m$ in §4.1 is in fact the crop scale $n_t/n_{to}$, identical for every channel, and $-i\omega$ is the separate `source_frequency_factor` (`assembly.py:849-870`). 2. Conservation is "expected", not derived. The derivation is short and should be in the SEP. With $E=S_{\mathcal M}a_{\mathcal M}$ at every bin: $$a_{\mathcal M}^\dagger W_{\mathcal M} Q_{\mathcal M} P = \tfrac14\sum_q w_q\,E^*\!\cdot P,$$ because absent channels have zero amplitude. Hence $$\frac{d}{dz}\sum_\omega a^\dagger W_{\mathcal M} a = 2\,\mathrm{Re}\sum_\omega(-i\omega)\,\tfrac14\sum_q w_q\,E^*\!\cdot P,$$ and the right-hand side vanishes: - for the real cubic, because $\int E\,\partial_t(\chi E^3)\,dt=0$ (energy is conserved); - for the analytic form, only after dividing by $\omega$ (photon number, which the manual calls "number-conserving"). The draft never says which quantity is conserved for which `kerr_form`. 3. The invariant uses the *sampled* $W_{\mathcal M}$, which is the matrix Q inverts. The route's `physical_energy` uses the identity metric. The two differ by the Gram defect, which the table admits up to `DEFAULT_GRAM_ATOL` = 1e-4, a value set equal to `MAX_EXTERIOR_TAIL_FRACTION` (`modes/tables.py:64-87`). Today that defect peaks at the foot of the active band, inside the spectral collar, where there is no light. Under this SEP every channel's low end sits *inside the requested band* where light is (LP05–LP07 end between about 1.2 and 1.9 µm in the use case). So "conserved to the same accuracy as today" does not follow, and V5's "the run's `rtol`" has no source. 4. "Galerkin projection onto a fixed subspace": the subspace is fixed in z, but it is a different span at each frequency. It is Galerkin in the pairing $\int E^*\!\cdot P$ weighted by $W^{-1}$. Say so, and say that the identity holds bin by bin only while the absent amplitudes are exactly zero (R2). *Recommendation.* Fix the formula and the wording. Add the derivation above. State the conserved quantity for each `kerr_form`. Derive V5's tolerance from rtol plus a bound of the form $\max\|W_s-I\|$ × the energy exchanged by channels near their limits. --- **R4. The use-case numbers are partly inconsistent or untraceable, and the material law limits the band before any cut-off does** (§1, §2, §6.2). Priority: **medium**. *Problems.* - I reproduced the §2 table exactly with `fused_silica()`, for both extents (17/10/7/4/3/1 and 17/11/7/4/4/2). - The worked example and `grin_nonlinear` use Malitson's law (`benchmarks/guides.py:238-266`). Its provider support ends at ω = 5.08e14 rad/s, i.e. 3.71 µm, and a solve at 4.2 µm raises "frequency is outside radial provider support". - So the use-case grid, whose active band reaches 4.2 µm, is refused for the frame channel LP01 whatever happens to the cut-offs. The default law reaches 4.2 µm but warns that it drops 417 /m of absorption. - "A 40 ps window … about 49 000 bins": a 40 ps realised window on 600 nm–2.1 µm gives 32 769 coarse bins (trange 32 ps). 49 153 bins needs trange 50 ps, a 65.6 ps window. The draft mixes up trange and the realised window. - 36 % of the coarse bins lie above 1.1 ω_max, outside the active band. For trange 50 ps that is 31 363 active bins out of 49 153. - "Standard 50 µm fibre" against a core radius of 26 µm: ref. [1] gives ρ = 26 µm and n_co = 1.470, whereas the default silica law gives n₁ ≈ 1.45 at 1064 nm. *Recommendation.* Name the material law and its domain. Note that the frame channel's full support needs a law reaching ω_min/2. Give trange, the realised window and n_omega consistently, along with the active-bin count. Use 52 µm, or say "nominal 50 µm". --- **R5. Several verification checks do not test the feature, or have no stated source for their tolerance** (§7). Priority: **high**. - **V1.** This is admissible as a class-P "explicitly exact no-op" (`docs/dev/testing.md` §3) only on the same backend and thread count, and only if nothing else changes. If the channel collar is on by default (Q2), a full-support channel whose limit is its lowest knot still gets a collar over [ω_m, ω_m(1+δ)], which lies inside the active band, and V1 fails. State "collar off, or no collar on a channel whose limit is the lowest knot". Also list everything that must take an identical code path: per-bin `dispersion_operator`, the per-channel walk-off mask, the noise multiply, the node rule and the tail certificate. - **V2.** "ω_m ≥ ω^c_m always" leaves no room for the FE discretisation error in the provider's own cut-off. "The gap shrinks monotonically" cannot be strict when limits snap to knots: the table already shows ties. Make it non-strict at knot resolution, with an FE-error allowance taken from the layer oracle's convergence (`tests/modes/test_graded_index.py:68-85`). - **V4.** "Today's table" for a partial-support channel does not exist, because today it is refused. Name the reference, for example a guide sampled from the limit upward on the same knots. The tolerance is then rounding only if the spline knots are the same. - **V5.** See R3. - **V6.** In the worked example (a = 50 µm, Δ = 0.0095, active band down to 3.6 µm), the 5th and 6th LP0m channels end at about 3.5 and 2.8 µm, inside the spectral collar [1.8, 3.6] µm where there is essentially no light. The check therefore barely exercises a support edge where light lives. Choose added channels whose limits fall in the requested band, or use the 50 µm fibre. - **Missing checks:** - a structural (class P) check that absent bins stay exactly zero over ten steps, with the absorber on, under both schemes (this is R2's regression test); - FSAL first-same-as-last identity with partial supports; - walk-off buckets at a limit; - the coupler on partial blocks (R6); - masked noise: the same stream, zero in absent bins; - the resume identity, refused across a change of support; - processing reconstruction from the guide; - a per-channel tail and Gram defect report at each limit. --- **R6. §6.1 misses consumers of the full-band assumption** (§6.1, §5). Priority: **medium**. - **Coupler.** `_flux_recovery` calls `np.linalg.solve(flux[k], …)` on every occupied bin. Its comment reads "off the guide's support its stored E/H are explicit zeros, F is singular there" (`coupling/coupler.py:668-760`). With per-channel support, F has zero rows and columns at bins inside the band, so the call raises LinAlgError. `_whitened_extremes` (Cholesky, `:548-568`) also fails. Both must be restricted to the valid block. #198's probe bins (`_probe_bins`, `:2373`) should include each limit. - **`translate/problem.py:2245`.** The debug summary computes `np.any(np.all(tables.valid, axis=1), axis=0)`, which becomes the intersection of the supports. `translate/validation.py:448` (`_check_general`) uses `np.all(valid, axis=1)` and would refuse every partial run. The draft names that function, but not problem.py. - **`ProviderChannelMode`** (`modes/guide.py:371-470`): `neff`/`dneff_domega` are a per-channel table that refuses outside its knots. These callers then ask a partial channel for β below its limit: - the `zdw` statistic's search window; - the recipe preview's `zdw`; - the frame; - `aeff` at the median `area_knot`. - **Provider and tracking.** `GradedIndexProvider.node_rule` calls `tail_bound`, which needs every channel bound at that frequency (`_require_bound_channels`). `align_modal_sample` refuses any sample that is not all-valid (`tables.py:219`), as does `DenseModalTable.__post_init__` (`:679`). - **Driver.** - `Simulation.with_input` states and resumed states that carry content in absent bins must be masked or refused. - The kept-apart draw of the `modified` noise model must be masked. - Say whether `energy=`/`peak_power=` are met before or after a named-channel launch is masked. - Say whether the boundary monitor's floor and `noise_floor="subtract"` use the masked draw (`monitor.py:665`, `processing/fields.py:647-676`). They read the stored draw, so this works if the masked draw is what is stored. - **Missing refusals in §5:** - `with_input` content in absent bins; - a resume across a change of `cutoff` or of the supports; - a scan point whose grid moves a limit. --- **R7. The performance candidates are partly misdescribed, and important items are missing** (§6.2). Priority: **medium**. - **Zero components.** It is true that an LP sector fills `e[:,0]` only (`modes/graded_index.py`, LP branch of `solve`), and that numpy_ref transforms all 3 components. - The native kernel already supports 1–3 components (`native/src/response/general_modal.cpp:161-165`, with `respond_components<1|2|3>`). - What fixes the count at 3 is the record: `MAX_N_COMPONENTS` = 3 is enforced in `ModalTransformTables._validate_arrays` (`modal_tables.py:385-399`). So dropping components *is* a contract change. - Native refuses a delayed (Raman) response on fewer than three components (`general_modal.cpp:225-227`). The candidate is therefore incompatible with Raman, which a silica supercontinuum run would declare, unless the kernel changes. - **Duplicate angular nodes.** True: for l = 0 the default `n_theta` = 2 rule (`graded_index.py:801-809`) gives two nodes at θ and θ+π with equal weights and identical values. Folding them is exact. - **The radial rule.** - "Two Gauss points in every finite element" is not right as stated: the default is `n_r` = 4 (`graded_index.py:798`). The example and the benchmark choose 2. - The panels do coincide with the solve's elements. - The P1 profiles have kinks at the element edges. A rule not split there loses its exactness for the quartic integrand, so "several times fewer nodes" faces a specific obstacle the draft should name. - **Real-signal transforms.** Native already uses a complex-to-real inverse and a real-to-complex forward transform for the real cubic (`general_modal.cpp:363-385`). numpy_ref uses a complex `ifft` (`general_modal.py:734`). Say which backend each candidate targets. - **Missing items:** - The Raman pass: the six pair histories convolved on the doubled axis per node. Say whether the timings had Raman on. - The inactive coarse bins: 36 % zero map columns that are still contracted (`general_modal.cpp` synthesis loops over all `n_omega`). - Translation build cost: `modal_transform_tables` loops in Python over every active bin, doing a spline evaluation, the dual and an `inv` (`modal_tables.py:650-673`), for about 31k bins. - Memory (R1). - **The step.** "The step is held at a tenth of the self-imaging period" is a declared `dz_max` (`benchmarks/guides.py`, `dz_max=period / 10`), not a necessity; say so. - **Extrapolation.** The per-metre column extrapolates a short window, and `AGENTS.md` says to "report the window, never extrapolate it". Label it as an estimate and keep V10 to window comparisons, as it already is. --- **R8. §4.2: the leaky-mode statements are unsupported or moot, and the SEP drops the diagnostic the manual sketched** (§4.2, §4.3, §5). Priority: **medium**. - **"Radiates into the cladding within a few wavelengths."** This is asserted without support. A refracting (no-barrier) leaky ray leaves the core within about half a ray period, about 0.3 mm here, which is hundreds of wavelengths. Snyder and Love ch. 24 ("Leaky modes": tunnelling against refracting leaky modes) is the place to cite; I found it in the group library, identity unverified. - **The l ≥ 1 discussion is moot for this provider.** `GradedIndexProvider` carries one family and one azimuthal order per guide, and there is no composite provider. Channels with l ≥ 1 cannot share a guide with LP0m. Say this, and narrow the manual sentence to match. - **The cut-off–to–limit gap.** Between ω^c_m and ω_m the mode is *bound* but dropped. The model is lossless where the fibre is not, and silent where the fibre would carry light. The manual's fallback included "the run warning by name when energy reaches its edge" (`general-modal.md:483-489`); the SEP silently drops that. - **Recommendation.** Add a per-channel edge-occupancy statistic or warning: the energy in [ω_m, ω_m(1+δ)]. Fold Q4 into it. --- **R9. Open questions and phases do not meet SEP 0's acceptance criteria** (§11, §12). Priority: **medium**. - **Q5** is marked "before acceptance". It has to be resolved, not left open. - **Q1** changes the contract and phase 4 (R2), so it must be settled now. - **Q7** decides what qualifies phase 5, so it must be settled now. - **Q6** names no phase. Move it to issues: it is out of scope. - **Phase 5** has no target and no end criterion, so it cannot be independently qualified. It also "needs none of phases 1 to 4". Make it a separate SEP or issue, or give it a stated target and qualification. - **Phase 2** verifies V5, which depends on R2 and R3. - **Part III** says "Tracking issue: to be opened" (SEP 0 §6, Drafting step 5). --- **R10. Nestedness is unexplained, and redundant by construction** (§4.2, §5, §6.1). Priority: **low**. - "The first failure ends the valid block" makes supports nested at every knot automatically: channels are ordered by eigenvalue, and a cut-off is the k-th eigenvalue crossing $k^2 n_{\rm ext}^2$. - The refusal "supports that are not nested within one sector" can therefore never fire. Only the interval refusal can. - TE and TM are separate providers, and each guide is one sector. - For a custom radial law the tail fraction need not increase with channel order, so the rule can drop a certifiable channel. Say so. - Explain what nestedness is needed for at all. The model of §4.3 does not need it. --- **R11. The placeholder operator is under-specified** (§4.5). Priority: **low**. - Name the cap. `EVANESCENT_RATE` (200 /m, `spatial.py:121`) is a free-space constant. The route already has the spectral cap α·ℓ ≤ 60 and the length-derived `LossPolicy` limit (`linear.py:575-577`). - In the interaction picture the right-hand side is back-propagated by exp(+αh/2), so the cap must be no larger than the spectral one (`docs/guide/numerics/boundaries.md:242-248`). - State that `walk_off_buckets` treats absent bins as unreadable. Its `active` argument is `(n_omega,)` today (`translate/linop.py:2448-2584`). --- **R12. Form** (§7, Part III). Priority: **low**. - A blank line separates row V10 from the V-table, so it renders as a headerless table. - References: ref. [1] checks out against the library — ρ = 26 µm, Δ = 8.8e-3, ξ = 0.615 mm, 125 THz predicted, 123.5 THz measured, κ'' = 16.55e-27 s²/m. Ref. [3] is not in the library, but the §4.2 formula re-derives correctly. Ref. [4]'s chapter is ch. 24. - Naming the hardware ("Apple M5 Max") is consistent with the manual's practice. --- **Statements checked and found correct** - `Grid.active_mask` is ω_min/2 < ω < `omega_max_window` (`grid.py:1359-1369`), and the manual quotation from `docs/guide/setup/grids.md`. - "A guide must be solved over at least twice the band a run declares" (`general-modal.md:216`); `_check_active_band` (`translate/general.py:1848`) and `_check_general` (`translate/validation.py:391`, mask at 448). - Both manual quotations under "not implemented" (`general-modal.md:483-489`). - `MAX_EXTERIOR_TAIL_FRACTION` = 1e-4; providers refuse rather than mask. - The `ModalSample.valid` docstring quotation (`modes/vector.py:243-246`). - `ModalTransformTables.valid` has shape `(n_z, n_modes, n_omega_fine)` and is broadcast from one mask (`modal_tables.py:702`). - The general route has per-channel operator and prefactor rows (`assembly.py:849-876`). - `DenseModalTable` uses one `CubicSpline` per field component, fitted over all knots and channels jointly (`tables.py:695-713`). - Noise: "nonpropagating, inactive and zero-frequency bins are not power ports and carry no photon; the random stream is still drawn over every bin" (`docs/guide/media/noise.md:255-257`). - The §4.2 mode formula and the estimate m < (V+2)/4, re-derived; V = 29.5 at 1064 nm. - The GPI sideband at 125 THz from ξ and β₂; sidebands near 737 and 1913 nm. - The §2 table, reproduced exactly with `fused_silica()`. - About 15 % absent pairs, consistent with the cut-off estimate over the active band. - `grin_nonlinear`: 4 channels, 412 nodes, 1537 bins (`benchmarks/registry.py:336`, `benchmarks/guides.py:222-307`). - LP fills one Cartesian component; the l = 0 two-node angular rule gives identical values. - The timing-table arithmetic: per step = 6 × per evaluation; per metre = 16 300 steps. - Issues #215, #209, #198, #213, #196 are open with the stated titles. ADR-066 sets resume on an exact configuration hash. The interface signature `on_grid(grid, provider, *, knots, n_r)` matches. - The double-clad alternative (contrast ≈ 0.019 at NA 0.2) and the collar-foot alternative (3 channels at 2.33 µm). **Could not check** - The measured times, and the 6/12/18-thread scaling. - The 198 steps of `grin_nonlinear`. - Whether `Multistep` holds its accuracy at z_p/10. - Gloge and Marcatili's page details: not in the library. - The 1213 GB/s-style bandwidth attribution (not asserted in the draft) and the cause of the superlinear growth with bin count. - GPU behaviour. **Overall assessment.** Part I is not ready to accept. The idea is sound: a frequency-dependent truncation of the modal basis is a coherent model, and Option A fits the existing objects. The §2 numbers, the parabolic-fibre estimate and most of the descriptions of the code hold up. Four points block acceptance: - **R2:** the shared active mask makes absent bins non-zero through the temporal absorber, so the per-channel mask and the contract change it needs must be decided now, not after a measurement. - **R3:** the projection formula is wrong as written, and the conservation claim needs a derivation that names the conserved quantity per `kerr_form` and its metric, with a tolerance that accounts for Gram defects up to 1e-4 now sitting in the lit band. - **R1:** the use case needs about 76 GB of resident maps and reference, so its feasibility must be stated. - **R5:** V1, V4, V5 and V6 need sound references and tolerances, plus a structural check that absent bins stay zero. R6 (the coupler's singular solves and the other missed consumers) and R9 (Q1, Q5 and Q7 settled; phase 5 qualified or split off) should also be resolved before acceptance. ### Response to review — 2026-12-04 - **R1 (memory).** Taken. §6.2 now gives the resident ledger at the scale of the use case, the 51 GB measured for two channels, and the estimate for seven; the candidates are ranked by memory as well as time; the target includes memory; and whether E, H and the dual must stay resident is Q4. The reviewer's 76 GB was for 49 153 bins; the grid of the run has 40 961 (see R4), which gives 63 GB. - **R2 (the shared mask).** Taken, by the author's decision. §4.3, §4.5, §6.1 and §9 adopt a per-channel active mask on both backends, applied to the absorber term and the hard mask, and name the phases that change the contract and the frozen tables. The capped rate of the first draft is gone (§4.5) and recorded under §10. - **R3 (theory).** Taken. §4.1 states $Q$ with its factor one quarter and the Gram inverse, distinguishes it from the coordinate dual, and says what the prefactor row holds. §4.3 gives the derivation, names the conserved quantity for each `kerr_form` and for a delayed response, says in which pairing the projection is Galerkin, and treats the metric: the conserved quantity is in the sampled Gram, the reported energy differs by the defect, and the defect now sits in the lit band. V7 takes its tolerance from that. The guide reports the defect and tail at each limit (V14). - **R4 (use-case numbers).** Taken. §2 names the material law and its domain and says why the frame channel needs it; §6.2 gives the declared window, the realised window, the coarse and active bin counts and the fine axis of the grid that was run (40 ps, 54.7 ps, 40 961, 26 137, 163 840). The first draft's "about 49 000" was wrong. The fibre is called nominally 50 µm, with its 26 µm radius. The axis index is the silica law's, and is stated. - **R5 (verification).** Taken. V1 states its conditions. V2 is non-strict with the oracle's error. V4 has a reference that exists. V5 of the first draft is V7. The first draft's V6 is replaced by V8, which uses the new `limits` keyword to put limits in the lit band against an exact reference. The missing checks are V5, V6 and V10 to V14. - **R6 (consumers).** Taken. §6.1 names the coupler's two solves and its probe bins, the debug summary of `translate/problem.py`, the callers of `ProviderChannelMode`, `node_rule` and `tail_bound`, tracking, the table's construction check, both noise models and the stored draw, and `with_input`. §5 adds the three refusals; a scan whose points move a limit is allowed and recorded, and §5 says so. - **R7 (performance candidates).** Taken. §6.2 says what fixes the component count, that the change is to the record and the contract, and that the Raman pass must be extended; corrects the description of the radial rule and names the obstacle to a coarser one; adds the inactive bins, the build of the record, the Raman pass and memory; says that `dz_max` is a choice; and separates measurements from estimates. A profile taken after the review is added. The per-metre figures are kept as one labelled estimate, because the feasibility of the use case is the reason for the phase; every comparison in the phase is on windows. - **R8 (leaky modes and the edge).** Taken. §4.2 describes the order-zero field below cut-off as a refracting leaky field with its length scale, cites reference 4, and narrows the statement about $l \ge 1$ to a guide of that order. The gap between cut-off and limit has its own paragraph, and §4.4 and §5 add the edge statistic and warning the manual's sketch asked for; the first draft's Q4 is folded into it. The statements about leaky modes still need checking against the book (first entry of this history). - **R9 (questions and phases).** Taken. The first draft's Q1, Q5 and Q7 are decided (the mask, the names and default, the target). Q6 is out of scope and goes to issues (§3). The performance phase has a target and an end, and is first by the author's decision; §10 records why it is not a separate proposal. The tracking issue and the pull request wait for the author. - **R10 (nestedness).** Taken. §4.2 explains that nesting follows from the rule and that the model does not need it, with the caveat for a custom law; the refusal that could never fire is removed from §5. - **R11 (placeholder operator).** Superseded by R2: absent bins are zero and carry no rate (§4.5). The channel collar names its cap (§4.4), and §6.1 says how `walk_off_buckets` treats absent bins. - **R12 (form).** Taken. The verification table is one table; reference 4 names its chapter. ### AI review — 2026-12-04 (second) Reviewer: Opus 5.5 (AI). I read Part I and Part III against SEP 0, the template and `AGENTS.md`, and checked every claim I could against the code on this branch (based on `main` at 0f0013f0). I edited nothing. I ran short checks with `PYTHONPATH=src`: the grid of §6.2; a bisection of the support limits at `extent=3.0` with 96 elements; quadrature node counts for 64 and 96 elements; the record arrays that `_snapshot_reference` builds for a small two-channel guide of the §2 fibre; and the material walk-off. No propagation was run. **Overall assessment.** Not ready to accept. The model, the per-channel mask and most of the theory now hold up. Five things block acceptance: - **Phase 1 target (S1).** The target cannot be measured, because its baseline does not fit in memory. - **Memory ledger (S2, S3).** The ledger in §6.2 miscounts the record and is inconsistent with the mesh of §2. - **V2 reference (S4).** The reference that V2 names does not exist. - **Missed consumers and interface (S5, S6).** The coupler functions that the incident launch actually uses are not named. The provider–guide interface for `"drop"` is not specified. - **Phases 3 to 5 (S7).** How the contract change reaches the native build between phases 3 and 5 is not said. S8 to S10 (the tolerances of V7 and V8, and the edge band) should also be fixed before acceptance. **S1 (high): The phase-1 target has no baseline that can be run.** §6.2 sets the target at four times less time per step and resident memory "than at the start of the phase", on a seven-channel cost-equivalent guide with 768 nodes and 40 961 bins. The same section estimates that this run needs about 180 GB and "fits no workstation and no single 80 GB device". So the start-of-phase measurement that the ratio is taken against cannot be made on the measured machine, or on any other named one. "Resident memory" is also not defined. It could mean the peak RSS including the 167 s build (the 51 GB is that kind of figure) or the steady-state ledger. Recommendation: - Define the benchmark at a size that runs today, for example the two-channel use case that was measured, or the seven-channel guide on fewer bins, and take the ratio there. - Define "resident memory" as one named quantity. - State, as a consequence of the target, the absolute memory the seven-channel use case will need after it. **S2 (high): The memory ledger counts 6 arrays where the record holds 14; the missing exact candidates follow from this.** The snapshot record is tabulated at two positions, `z=[0.0, z_end]` (`src/solprop/translate/general.py:901`). E, H and the dual are allocated per position (`src/solprop/translate/modal_tables.py:620`) and the first row is copied into the second (`:653`). `GradedIndexProvider.solve` also returns reciprocal partners, `e.conj()`, `-h.conj()` and `-4*metric` (`src/solprop/modes/graded_index.py:967-969`), so the backward E and H are stored as well. For a two-channel, 192-node guide I measured these shapes: - `synthesis` and `projection`: one interval each; - `electric`, `magnetic`, `backward_electric`, `backward_magnetic`: each `(2, n_nodes, 3, 2, n_omega)`; - `coordinate_dual`: `(2, 2, n_nodes, 6, n_omega)`. In units of `16 × nodes × 3 × channels × n_omega` bytes that is 2 (S, Q) + 2 × (E, H, backward E, backward H) + 2 × 2 (dual) = 14 units. `general_memory` counts all of them (`src/solprop/backends/numpy_ref/general_modal.py:603-609`). The consequences: - **Two channels.** The ledger is 14 × 3.02 GB ≈ 42 GB, not 18 GB. The 51 GB measured is about 1.2 times that, not 2.8 times. It matches the ledger plus a native copy of S and Q, if native holds one as the first review says. - **Seven channels.** The ledger is about 148 GB, not 63 GB. The "of the order of 180 GB" survives only because the wrong ledger and the wrong multiplier cancel. - **What must stay resident.** It is 12 of the 14 units, not "four of the six arrays". - **Missing candidates.** Two exact candidates that need no study are missing: the duplicated snapshot row (6 units) and the backward partners of a reciprocal provider, which are conjugates of E and H (4 units). Recommendation: rewrite the ledger paragraph from `general_memory` and add the two candidates. **S3 (medium): The mesh of §6.2 is not the mesh of §2.** At `extent=3.0` and `n_r=2`, 768 nodes is 64 elements; 96 elements gives 1152 nodes. I measured 64 → 768 and 96 → 1152, and `grin_nonlinear`'s 412 nodes is 64 elements at `extent=1.6`. §2 counts channels with 96 elements. If the use case needs 96 elements, every time and memory figure in §6.2 grows by 1.5×. Recommendation: state the element count used in §6.2 and check that the channel counts and limits of §2 hold at that count. **S4 (high): The reference that V2 names does not exist.** The "independent layer oracle of the modal-design tests" (`tests/oracles/modal_design/graded_index.py`) does not provide what V2 needs: - Its docstring scopes it to the TE0/TM0 sectors and calls LP spacing "a separate weak-guidance witness". - `layer_frame` (`:81-118`) uses order-1 Bessel functions (J1, Y1, K1), not the J0 and K0 of LP0m. - Its `Grin` has a fixed index, not a dispersive one. - It finds β at one wavelength (`layer_root`) and has no cut-off routine. Recommendation: make the oracle an explicit phase-2 deliverable. It needs an order-l LP layer residual (J_l and Y_l inside, K_l outside) and a cut-off root at β = k n₂, compared with the provider on a non-dispersive material. Alternatively, name another reference that exists. **S5 (medium): The coupler functions named are not the ones the incident launch uses.** `_flux_recovery` is the plane-to-port recovery inside `_same_basis` (`src/solprop/coupling/coupler.py:571-609`). The incident `vector_paraxial` launch, which the use case and the worked example use, runs `_vector_paraxial`. That path has these full-block solves: - `_vector_coordinates` (`:2006`): `np.linalg.solve(flux[k], …)` at `:2046` and `:2055`, and `_whitened_extremes(flux[k], native_q)` at `:2058-2059`; - `_closure_item` (`:2391`): a whitened eigenproblem against the Gram of the closed fields (`:2420`), which is singular when absent channels have zero fields; - `_target_angular_vector` (`:2432`, `:2475`). `_probe_bins` also truncates to `max(_TARGET_BINS, 3)` = 5 bins (`:92`, `:2373-2388`). "One on each side of every limit" (10 bins for five partial channels) therefore needs that cap changed. Recommendation: name these functions. In V11, exercise `vector_paraxial` and use an independent reference at the partial bins: the same provider declared with `count` equal to the present block. **S6 (medium): The interface between guide and provider for `"drop"` is not specified, and the standard recipe still refuses.** The `cutoff` keyword sits on `ModalGuide`, but `GradedIndexProvider.solve(omega, z, *, nodes)` has no way to receive it (`graded_index.py:839`). The refusal is raised in `_require_bound_channels` (`:662-683`), which `tail_bound` and `node_rule` (`:745-837`) call. The usual pattern builds the rule first, as in `nodes = provider.node_rule(low, n_r=2)` (`benchmarks/guides.py`) and in `on_grid`, "the provider's own rule at the lowest" knot. So under the default `"drop"` the user's own call to `node_rule` refuses before the guide can drop anything. Recommendation: say which of two designs is meant. - If the provider always returns partial sets, its public behaviour changes for direct callers, and §9 should say so. - If the provider protocol gains a keyword, `src/solprop/modes/protocol.py` changes, and every other provider must refuse `"drop"` by name. Either way, say how the rule's single `tail_power_bound_omega` becomes one certificate per channel. The §5 sentence "the node rule is built from the channels present at the lowest knot" means little: the mesh does not depend on the channels, only the certificate does. **S7 (medium): How the contract change reaches native between phases 3 and 5 is not said, and "two places" undercounts the native sites.** `grids.active_mask` is shared by every route, and `norm_mask` defaults to it (`docs/dev/kernel-contract.md:340,345`). Native lowers it as a vector (`native/src/solprop_native/_lowering.py:405`) and requires length `n_omega` (`native/src/general/checks.cpp:95`). Reshaping it to `(n_modes, n_omega)` in phase 3 would therefore break every general run on native until phase 5. SEP 0 requires a backend to refuse by name until it implements a feature. Native also reads `active_mask_` in more than two places: `trial_low_storage.inc`, `trial_split_step.inc`, `trial_adams.inc`, `trial_finish.inc` and `trial_separable.inc` under `native/src/general/`. Recommendation: - Add a per-channel leaf on the general route, and keep `grids.active_mask` as the band mask. - Have native refuse a problem whose channel rows differ until phase 5. - Run V5 and V6 for each march: `RungeKutta`, low-storage and `Multistep`, which is a phase-1 candidate. **S8 (medium): V7 contradicts §4.3, and the metric bound looks only at knots.** §4.3 says that with W ≠ I the linear part makes $a^\dagger W a$ beat at the size of the defect. V7 nevertheless holds N to "the integration error". With W ≠ I neither N nor the reported energy is exactly conserved by the full flow. Recommendation: either measure N with the linear flow removed, which is what the identity actually states, or give N the same defect term as the reported energy. Two further points: - **Interpolated defect.** The bound uses $\lVert W(\omega_m)-I\rVert$ at the limit knot. The route measures the interpolated departure over the band and only warns on it (`active_departure`, `src/solprop/translate/general.py:836`). Use the largest interpolated defect over each channel's first knot gap. - **Wording.** "The identity holds bin by bin" should be narrowed. The algebraic step holds per bin; the conservation needs the sum over bins. **S9 (medium): V8 has no observable and no derived tolerance.** "The energy those channels hold below the raised limits" is a tolerance with no quantity named to compare against it, and V9 refers to "V8's observable", which is not defined. The difference between the two runs is first order in the dropped amplitude, multiplied by the nonlinear coupling over the window. It is not bounded by the dropped energy itself. Recommendation: name the observable, for example the relative 2-norm of the state in the present bins after ten steps, and derive its bound. **S10 (medium): `cutoff_collar` also sets the edge band, so `0` switches the warning off.** §5 makes `cutoff_collar` the width δ of both the collar and the edge band of §4.4. Setting it to `0` for "no collar" makes the band $[\omega_m,\omega_m]$ empty, so the statistic is zero and the warning can never fire. Recommendations: - Give the edge band its own keyword or a fixed default. - Add V checks for the edge statistic and warning (against a direct sum, and firing above the threshold) and for the channel collar (its rate, its cap, and its presence on $[\omega_m,\omega_m(1+\delta)]$ only). - Correct §4.4: ℓ is the reference length `length / boundary_N`, not "the grid's length" (`docs/guide/numerics/boundaries.md:56-63,242`). **S11 (medium-low): Some phase-3 checks depend on phase-4 code.** - V4 launches a pulse that straddles a limit in a partial channel, but launch masking is phase 4. - V1 at run level claims the noise path is unchanged, but noise masking is phase 4. Either say that phase-3 tests build masked states at the problem level, with light reaching a limit through XPM from a full channel and a limit raised by `limits`, or repeat V1 in phases 4 and 5. "V1 (table level)" in §11 is not defined in §7. **S12 (low-medium): The identity promise conflicts with `AGENTS.md`.** `AGENTS.md` says to "Record new configuration fields even at their defaults, and allow the hash to change across versions". §9 instead promises that full-support files keep their identity and resume, and Q3 asks a question that rule already answers. Recommendation: record `cutoff`, `limits` and `cutoff_collar`, drop the resume promise, and close Q3. **S13 (low-medium): The `"drop"` default is visible only in a log.** A declared `count=7` can silently mean four channels over half the band. The edge warning fires only if light reaches a limit. Recommendation: issue a warning category at build time, not only a log line. §9 should also mention the change for direct callers of the provider (S6). **S14 (low): Success criterion 4 has no budget.** §1 says the seven-channel fibre "runs", and V17 makes it a gallery example. Even at the target, a metre is about 13 h on the measured machine (51 h ÷ 4, before the seven-channel cost). State the gallery's length and whether its output is prebuilt. **S15 (low): Smaller errors and omissions.** - **Inactive bins.** 36 % of bins are inactive, but they are not all "above 1.1 ω_max": 26.7 % lie above it and 9.5 % below ω_min/2 (computed). - **Record loop.** `modal_transform_tables` loops over every bin inside the table's band (`modal_tables.py:656`), not only the active ones. - **Gram gate.** `interpolated_gram` and `metric_departure` (`general.py:827-836`, `:1413-1440`) are not named among the consumers. They must see the identity on the absent block, or the route sees a departure of 1 and refuses the guide. - **Manual pages.** §8 omits `docs/guide/waveguides/modal-tables.md`, whose line 71 says "every sample is still `valid`", and `radial-quadrature.md` for folded nodes. - **Profile.** "Share on the calling thread" is not a share of wall time. - **Contract changes.** §9's "two changes" is premature while phase 1 may also drop inactive columns or stop holding the reference. **S16 (low): Process and sources.** - The tracking issue is not opened (SEP 0, drafting step 5). - The author's four decisions should be recorded beside the review points they settle (SEP 0, "Review"). - The leaky-mode statements of §4.2 still await a reading of Snyder and Love, as Part III says. **On the response to the first review.** - **R1:** partly. Memory is now treated, but the ledger miscounts the record (S2) and the target cannot be measured (S1). The first review's 76 GB had the same undercount. - **R2:** answered for numpy_ref. Native has more mask sites than two, and native's state in phases 3 to 5 is not addressed (S7). - **R3:** mostly answered. The formula with its factor ¼, the derivation, the conserved quantity for each form and the metric are now correct. V7's tolerance for N contradicts §4.3 (S8). - **R4:** answered. 40 961 bins, 26 137 active, a 54.7 ps window and 163 840 fine samples all check. The bins above 1.1 ω_max are misattributed, and the mesh is inconsistent (S3, S15). - **R5:** partly. V1 and V4 are now sound. V2's reference does not exist (S4), V8 has no observable (S9), and the edge statistic and collar have no checks (S10). - **R6:** partly. The coupler functions named are the wrong ones (S5), the provider interface is left open (S6), and the Gram gate is not named (S15). - **R7:** mostly answered. The two largest exact memory candidates are missed (S2). - **R8:** answered in the text. The edge band is tied to the collar (S10), and the leaky-mode statements are still unverified. - **R9:** answered on the questions. The target's baseline cannot be measured (S1), and the tracking issue is still unopened. - **R10:** answered. - **R11:** superseded correctly. The cap's length scale is misstated (S10). - **R12:** answered. **Checked and found correct.** - The projection Q with its factor ¼ and the Gram inverse (`modal_tables.py:502-533`). The prefactor row holds only the crop scale (`translate/assembly.py:849-876`). - The conservation algebra: $a^\dagger W Q P = \tfrac14\sum_q w_q\bar E\cdot P$, and the ¾ factor for the cubic integrand. - The masked temporal absorber stays dissipative, since P A P is positive semidefinite. - `DEFAULT_GRAM_ATOL` = 1e-4 and its link to the tail floor (`modes/tables.py:64-87`). - The FSAL figures 7.4e-7 and 1.8e-16 (`numpy_ref/passes/stepping.py:318-323`). - The limits at `extent=3.0`, 96 elements: LP03 to LP07 at 3.043, 2.228, 1.749, 1.436 and 1.217 µm. - About 15 % of the (channel, bin) pairs are absent. - The grid figures of §6.2, the 51 h arithmetic and the 16 300 steps per metre. - The walk-off: 23.7 and 12.5 ps/m from material dispersion. - The default silica law's absorption warning: 438 /m at 4.22 µm. - The manual quotations of §3. - `MAX_N_COMPONENTS` and native's refusal of Raman on fewer than three components. - `_TARGET_BINS` = 5. - The declared-basis coupled block is out of scope and refused. - The V-checks map onto the phases with none left out. **Could not check.** - The measured times, the thread scaling, the 51 GB, the 167 s and the profile shares. - Whether native holds its own copy of S and Q. - Whether `Multistep` keeps its accuracy at the declared `dz_max`. - Snyder and Love ch. 24, and Gloge and Marcatili. - The claim that the boundary monitor needs a window about four times the pulse. - Whether SEP number 55 collides with an open pull request: I made no external queries. A local branch already holds SEP 54. ### Response to the second review — 2026-12-04 The drafting agent confirmed in the code every statement of this review that it acted on. Open-question numbers below are those of §12 as it now stands: the first draft's question on identity is closed (S12), Q3 is the provider interface, Q4 the edge band and Q5 the resident reference. - **S1 (target).** Taken. The target is now taken on two benchmarks that run today, *long* (the two-channel run that was measured) and *wide* (seven channels on 6 145 bins, a record of 22 GB). Memory is defined as the peak resident set size of the process over the build and the ten steps. §6.2 states what the target leaves the seven-channel use case needing. - **S2 (ledger).** Taken. The record holds fourteen units, not six: 42 GB for two channels against the 51 GB measured, and 148 GB for seven. The duplicated position and the reciprocal partners are added as exact candidates, and the reference is stated as twelve of the fourteen units. - **S3 (mesh).** Taken. §6.2 states 64 elements. The counts of §2 at `extent=3.0` are the same at 64 elements, and the limits move by less than 3 nm; both sections say so. - **S4 (V2's reference).** Taken. The `LP` cut-off oracle is a deliverable of phase 2, described in V2. - **S5 (coupler).** Taken. §6.1 names `_vector_paraxial`, `_vector_coordinates`, `_closure_item`, `_target_angular_vector` and the cap of `_probe_bins`. V11 uses the `vector_paraxial` launch, with the provider declared at the present count as the reference at partial bins. - **S6 (provider interface).** Taken, as a proposal for the author to confirm (Q3). §5 specifies an optional `solve_partial` on the protocol, leaves `solve` as it is, and changes what `node_rule` certifies; §9 records the change for direct callers. A provider without `solve_partial` refuses on its own, as today, so the default does not break it. - **S7 (native between phases).** Taken. `grids.active_mask` is kept; the general route gains a `channel_mask` leaf; the native build refuses unequal rows until phase 5; the native sites are listed; V5 and V6 run for each march. - **S8 (V7).** Taken. V7(a) tests the identity itself, the rate of $N$ from one source evaluation, against the same rate on the full-support guide. V7(b) bounds the reported energy with the interpolated defect. §4.3 is reworded on what holds per bin. - **S9 (V8).** Taken in part. The observable is named and V9 now refers to something defined. No a-priori bound is derived: the difference is first order in the dropped amplitude, so the check reports its ratio to the square root of the dropped energy fraction, requires that it not grow, and requires the difference to vanish with the dropped content. A sharper gate needs the phase-3 measurement. - **S10 (edge band).** Taken. The edge band has its own width, fixed by the manual (Q4), so a collar of zero does not silence the warning. V18 and V19 check the edge report and the collar. §4.4 names the reference length correctly. - **S11 (phase order of checks).** Taken. Phase-3 checks act on states masked at the problem level; V1 at run level is repeated in phases 4 and 5; "tables" and "run" are defined in V1. - **S12 (identity).** Taken. The new fields are recorded at their defaults, the resume promise is withdrawn, and the question is closed. - **S13 (visibility of the default).** Taken. A guide that drops a channel warns when it is built (§4.4, V18). §9 records the change for direct callers of the provider. - **S14 (the gallery).** Taken. §7 says what the gallery example is and that the comparison with [1] at the experiment's power needs a run of tens of hours that is not a check of this SEP. The first success criterion of §1 that mentioned the fibre now says "builds and steps". The gallery's numbers are set in phase 6. - **S15 (smaller points).** Taken: the split of the inactive bins, the loop over the table's band, `interpolated_gram` and `metric_departure`, the two manual pages, the wording on the profile, and "at least two" contract changes. - **S16 (process and sources).** The tracking issue and the pull request wait for the author's word. The author's decisions are recorded in the history above and in the responses to R2 and R9. Reference 4 has now been read in part; the history entry says which passages and what remains unread.