jze9 7803e147a7 Add GPU/CPU batch sweep for single-stage configs (gausse sweep --gpu)
Finishes the GPU path to a usable state: run_gpu_sweep vectorizes the
expensive discharge across N single-stage configs via the validated
batch integrator (numpy CPU / cupy GPU, same code). Setup (decode +
build_stage_physics) is a fast python loop; the ODE batch is one call.

- Extracted sim/stage.build_stage_physics so the CPU path (run_stage) and
  the GPU batch build IDENTICAL physics (coil model, eddy, saturation,
  circuit params) -- no divergence by construction.
- Batch integrator hardened: stiff configs that overflow fixed-step RK4
  are marked infeasible (blew_up), feasibility = actually-commutated
  (committed), warnings silenced via seterr. Single-pulse + eddy mirrored.
- Analytic sensor trigger (constant-velocity approach) for the batch;
  inductive threshold check preserved.

Honesty gate: test_batch_sweep validates GPU-path exit velocities against
the CPU run_coilgun -- 0.0% divergence on the checked configs. Limitation
stated plainly: single stage only (multi-stage stays on the CPU sweep);
cupy on the server GPU (1070 passthrough) is the remaining infra step.
91 tests pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-07 16:00:49 +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%