Skip to content

Build a large free-space launch in seconds, with the same bits - #523

Closed
jtravs wants to merge 11 commits into
fix/host-crossingfrom
fix/setup-cost
Closed

jtravs wants to merge 11 commits into
fix/host-crossingfrom
fix/setup-cost

Conversation

@jtravs

@jtravs jtravs commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

A draft, stacked on #517, then #516, which should land first. No number changes: every bit of a launch and every digest is as it was, and tests hold both.

What changed

  • A large launch builds in threads, with its admittance formed once. The passes over a beam's elements ran on one thread, and the admittance ran twice. The sum that scales the field stays one sum in one order, so it stays on one thread.
  • The transverse residual comes from exact squares and math.fsum, the same bits as the rational sum, without a Python Fraction per node.
  • Digesting an array not held in its order works block by block. A broadcast input no longer becomes a whole volume to digest, and a byte-swapped one no longer takes a copy. Closes ArrayDigest.of expands a broadcast input to a full volume #493.

Why

At 768 × 768 × 600, a free-space launch took about three minutes to build, longer than the steps of a short point.

Intel Xeon Gold 6240, 18 cores, 18 threads, twice each, unprofiled before (s) after (s)
Simulation.from_free 169, 179 14.9, 14.9
translate 30.3, 27.5 7.2, 7.8
runner 3.8, 3.0 3.5, 3.3

A shared machine, so read these as sizes rather than exact ratios.

How it was verified

Local, on the stack: tests/test_pulses.py, test_cartesian_precision.py, tests/output/test_field_retention.py, test_monitor.py, test_process.py and test_structure_figures.py, 724 passed before the last merge from #517, and rerun after it; ruff clean.

Tests hold the launch's bits across thread counts (tests/test_pulses.py), the residual against the rational sum (tests/test_cartesian_precision.py) and a broadcast input's digest and peak memory (tests/output/test_field_retention.py).

What's left of the plan for this

Not run

No GPU run, since this changes host Python only. macOS, Windows, the slow lane and coverage: left to CI.

Links

Closes #493, by hand once the stack lands, since Closes only acts on a PR based on main. Relates to #347. Depends on #517 and #516.

Suggested labels: performance.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ

jtravs and others added 9 commits November 4, 2026 15:03
A broadcast input no longer becomes a whole volume to be digested, and a byte-swapped one no
longer takes a copy. Every digest is as it was, which the record tests hold.

Closes #493.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
The same bits as the rational sum, which a test holds, without a Fraction per node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
The passes over a beam's elements ran on one thread, and the admittance ran twice. The sum that
scales the field stays one sum in one order, so every bit of the launch is as it was, which a
test holds across thread counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGENPtq9Gp7VCh5QmcDdzQ
@jtravs jtravs added the performance Slower or larger than it should be, with no wrong result label Nov 4, 2026
@read-the-docs-community

Copy link
Copy Markdown

@jtravs

jtravs commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #520, at the maintainer's request for far fewer PRs: each one and each push costs a full CI run. This description keeps its tables and per-section verification, and the code is in that branch.

@jtravs jtravs closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Slower or larger than it should be, with no wrong result

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant