Skip to content

Admit delays by what wrapped light can do, not by a fixed share of the headroom - #19

Merged
jtravs merged 2 commits into
mainfrom
fix/delay-check-walkoff
Nov 30, 2026
Merged

jtravs merged 2 commits into
mainfrom
fix/delay-check-walkoff

Conversation

@jtravs

@jtravs jtravs commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Before this change, the delay check (pnps.simulate._check_delay) admitted only |tau| <= 0.75 * time_headroom. It now also admits a longer delay when the wrap coupling is at most 1e-5:

C(tau) = max over (t_s, t_t) of sqrt(P(t_s)) * P(t_t) * exp(-A(T - |tau| - |t_t - t_s|))
  • P is the input's temporal power over its peak, from the 1-D input spectrum (Setup.e_omega_input). The chirp or the injected field is included.
  • A(x) is pnps.absorber.wrap_attenuation: the least amplitude attenuation of any light that has walked x. Over the bins with walk-off w >= x, it is min gamma_omega * x * L / w, taken from the existing gamma_omega and group_walkoff.
  • C bounds the Kerr polarization that light wrapping the periodic window can drive at the other pulse, in units of the input's peak. It is computed by pnps.absorber.wrap_coupling, and the limit is pnps.absorber.WRAP_COUPLING_LIMIT.
  • Why 1e-5: the radiated light is at most 1e-5 of the signal's peak amplitude, so it moves a trace by at most 2e-5 of its peak. That is inside the 3e-5 the production step and windows are chosen for.
  • The absorber, the input and the propagation are untouched. One loss serves a whole scan, and a delay the old rule admitted gives bit-identical results. The old rule is kept beside the bound, so every previously admitted delay stays admitted.
  • run_scan and run_separation_scan check every chosen delay before building the backend. A refused delay now stops a scan before its first point instead of partway through. run_delay_point, simulate_delay_point, visit_nonlinear and Separation.point share the same guard.
  • The manual explains the criterion ("Which delays the window holds" in docs/model.md, plus trace-simulation.md and accuracy.md). The decision is recorded in docs/dev/decisions.md, and the change has a changelog fragment.

Why

The FROG2 campaign needs −40 to +80 fs for the 1 fs pulse and −60 to +80 fs for the chirped pulses, on the 600-point grid (trange 250 fs, which is 260.18 fs on the grid; time_headroom 55 fs; 40 µm). The old symmetric rule allowed ±41.25 fs. A delay point has only two pulse positions, so the old worst case (pulses at ±headroom) is not the right one.

What it admits on the production window (computed, build_setup on examples/runs/frog2_pilot.toml)

Input Largest admitted |tau| C at 80 fs
1 fs pulse 96 fs 2.6e-7
2 fs pulse 99.25 fs 2.8e-11
GDD ±2 fs² 81.75 fs 5.5e-6
TOD ±2 fs³, time_headroom 55 fs 62 fs 1.0e-3
TOD ±2 fs³, time_headroom 65 fs 81.5 fs 5.6e-6 (untouched band 153.8–600 nm, from 151.2)

The bound is symmetric in tau. TOD's late wing is extreme-UV light up to 35 fs behind the pulse, and it walks late. At +80 fs it reaches the other pulse after about 150 fs of walk-off, just where the lap budget starts, so it needs more headroom.

A bound that follows the transient grating was considered and not taken. The wrapped gate light needs both gates to make signal, so it enters at second order. That bound would admit TOD at 55 fs, but it holds only for the TG signal, and the large windows also collect the arms' own Kerr light. The generic bound holds for any layout and window.

Verified

  • uv run poe check: everything passes, 406 tests passed and 2 skipped.
  • uv run poe test-reference: 404 passed and 2 skipped (macOS, Apple silicon).
  • New tests in tests/test_delay_check.py:
    • the long ranges are admitted on the production time grid;
    • a delay whose wrap lands before the lap budget starts (110 fs) is refused, as is TOD at +80 fs with 55 fs of headroom;
    • every delay within 0.75 × headroom is still admitted on the tiny and the production grids;
    • on the tiny grid, the old rule is what admits its own edge, where C = 1.9e-5;
    • wrap_attenuation and wrap_coupling agree with direct evaluations;
    • C is monotone in |tau|;
    • both scan drivers refuse before their first point.
  • Supporting evidence, not the justification: the FROG2 campaign ran the S1 case and the three chirped pulses with the old check disabled (384², exact windows, 1 nJ, NVIDIA A40). Collected spectra at −60 to +80 fs on the 600-point window agree with a 1200-point window to at most 1.2e-8 of the zero-delay peak in the 0.5 mm window. In the 2.5 mm window they agree to 5.9e-6, the same as at the delays the old rule admits.

Not covered

  • P leaves out the chromatic holes. Their spectral edges give the formed input a pedestal of about 1e-6 of peak power across the whole window at every delay. Read through the formed input, C is already 1.1e-3 at zero delay (pilot at 192²). That is the holes, not the delay, and the docs say so.
  • uv run poe cov cannot reach 100 % on macOS: a CPU-affinity test is skipped there. CI's coverage lane is the gate.

🤖 Generated with Claude Code

…e headroom

The delay check admitted only |tau| <= 0.75 time_headroom. It now also admits a
longer delay when light that wraps the periodic time window can drive at most
1e-5 of the input's peak nonlinear polarization at the other pulse
(pnps.absorber.wrap_coupling, from the existing absorber, walk-off and input
spectrum). The absorber, input and propagation are unchanged, so every delay
admitted before gives bit-identical results. The scans check all their delays
before the first point. No number of the validation ladder moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jtravs jtravs added the enhancement New feature or request label Nov 30, 2026
@read-the-docs-community

read-the-docs-community Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

2e-5 of the trace peak is inside the 3e-5 target, not a third of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jtravs
jtravs merged commit 494703f into main Nov 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant