jze9 4f94811b49 Stage 9 core: GPU-ready batched discharge integrator, validated vs scipy
The expensive part of the sim (the 4-state [Q,I,x,v] discharge ODE) now
has a vectorized fixed-step RK4 integrator that runs N configs at once as
arrays, with the same saturating-iron physics as the scipy path. One code
path runs on numpy (CPU) or cupy (GPU) via a backend shim
(gpu/backend.py) -- so it's developed and validated WITHOUT a GPU, then
runs on GPU unchanged.

Honesty gate (per the project's no-smoke-and-mirrors rule): validated
against the scipy solve_ivp reference on 4 configs -- exit velocity, peak
current, and dissipated energy all match within ~1-3%, plus a batched
energy-conservation check. GPU speed is worthless if the numbers differ,
so this test is the point.

Benchmark: 5000 configs in 6.8s = 733/s single-threaded numpy, already
faster than the 5-core scipy sweep (~430/s); cupy parallelizes the same
arithmetic for the real win at large N.

Not yet batched: flight-to-trigger, multi-stage chaining, genome decode
(so this isn't a drop-in sweep replacement yet -- it's the validated
core). Next: batch the full pipeline + run cupy on the server GPU.

89 tests pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-07 02:18:34 +05:00

gausse

Симулятор и оптимизатор многоступенчатого электромагнитного ускорителя (coilgun) на реальных, доступных в рознице компонентах.

Полный план и чек-лист этапов — в PLAN.md.

Установка (Docker — основной способ)

docker compose build
docker compose run --rm --entrypoint pytest gausse -q   # тесты
docker compose run --rm gausse sweep --n 1000            # CLI (после реализации Этапа 6)

Результаты (SQLite, отчёты) должны сохраняться в ./results, примонтированный в контейнер как /app/results (см. docker-compose.yml), чтобы переживать пересборку образа.

Установка без Docker (локальная разработка)

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
Description
No description provided
Readme 730 KiB
v0.1.0 Latest
2026-07-13 01:38:07 +05:00
Languages
Python 98.9%
Shell 0.9%
Dockerfile 0.2%