Skip to main content

haxball_core — headless, vectorized Haxball physics

This is the RocketSim-equivalent for Haxball: a standalone physics core with no game engine and no rendering, designed to run thousands of matches in parallel for reinforcement learning.

It replaces the Ursina/Panda3D-based simulation in Ursinaxball, which made every disc a 3D-engine Entity and capped throughput at low-thousands of steps/sec for a single game. The physics math is identical — this is a faithful port of Ursinaxball's pure-numpy fn_base.py, verified bit-for-bit (see Fidelity below).

Why this design

RLGym is "a million times faster" than a naive Python clone for one reason: the physics lives in a headless native core (RocketSim, C++) behind a single TransitionEngine interface, and is stepped in batches so the Python↔native boundary is crossed once per batch of envs, not once per game step.

haxball_core copies that win:

  • Rust core, f64 math — same numbers as the original numpy, native speed.
  • Batched VecEnv — N matches stepped in parallel with rayon, GIL released. One step(actions) call advances all N envs.
  • One source of truth — the same crate compiles to a Python extension (for training) and, next, to WASM (so a human can play the bot in-browser — Haxball is a browser game, so the renderer and the human-play client live there).

Measured (Apple Silicon, single process)

Mode 1v1 3v3
Raw sim (no Python in loop) ~50M env-steps/s ~18M env-steps/s
Full env.step (obs + reward + done numpy I/O) ~12.5M env-steps/s ~6.5M env-steps/s

Ursinaxball reference: a single game at low-thousands of steps/sec → this is a ~1,000–10,000× speedup, and it scales to 2v2 / 3v3 (the regime that was out of reach before).

Fidelity

tests/test_fidelity.py imports Ursinaxball's fn_base.py directly (it has no ursina import) and feeds 25,000 random inputs through both implementations:

disc_disc OK
disc_vertex OK
disc_plane OK
segment_no_curve OK
segment_curve OK
ALL FIDELITY TESTS PASSED — Rust port matches fn_base.py to 1e-9

Build & run

This crate is the haxball_core member of the repo's uv workspace. From the repo root:

uv sync                                              # builds this crate (maturin) + deps
uv run rust/haxball_core/tests/test_fidelity.py      # fidelity (1e-9)
uv run rust/haxball_core/bench.py                    # throughput

Iterating on the Rust? uv run maturin develop --release rebuilds in place faster than a full uv sync.

Status / what's ported

  • All 5 collision resolvers (disc-disc, disc-vertex, disc-plane, segment straight + curved, segment bias) — verified vs fn_base.py
  • Integration (update_discs), player movement + kick (resolve_movement), goal detection (check_goal), spawn/reset.
  • Classic stadium (planes + straight ball-area segments + goalposts + goals).
  • Batched VecEnv with rayon, obs/reward/done numpy I/O.
  • Curved goal-net arcs + kickoff-barrier semicircle (math is ported and tested; not yet wired into the classic World — minor, affects only in-net ball behavior).
  • .hbs stadium loader (currently the classic stadium is built in code).
  • WASM target for in-browser play.

Next (the RLGym playbook, in order)

  1. Wrap VecEnv in an RLGym-v2-style API: TransitionEngine (this core) + StateMutator / ObsBuilder / ActionParser / RewardFunction / DoneCondition — composable, the env design HaxballGym already half-has.
  2. PettingZoo-parallel multi-agent + a single shared, permutation-invariant policy → 1v1/2v2/3v3 from one network.
  3. Train with PufferLib (highest SPS) or CleanRL PPO, self-play vs a past-policy pool.
  4. Compile to WASM; export the policy to ONNX; play it in the browser.

Metadata

Release files for haxball-core 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for haxball-core 1.0.0
File Size Uploaded
haxball_core-1.0.0.tar.gz 29.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for haxball-core 1.0.0
File
haxball_core-1.0.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
haxball_core-1.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
haxball_core-1.0.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details
haxball_core-1.0.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
haxball_core-1.0.0-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details
haxball_core-1.0.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
haxball_core-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
haxball_core-1.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
haxball_core-1.0.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
haxball_core-1.0.0-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details

Total release size: 4.3 MB

Release files / haxball_core-1.0.0.tar.gz

Download URL haxball_core-1.0.0.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
26b5cc83de00d5850fe02954324a2cd7e6d1a63d580bc66c6b40365693c03578
BLAKE2b-256 checksum
How to use checksums
34a024e591b1c4c68309a4991eac83b87e858ba78fa87ef76c7d46658a3b8d60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / haxball_core-1.0.0-cp313-cp313-win_amd64.whl

Download URL haxball_core-1.0.0-cp313-cp313-win_amd64.whl
Size 329.6 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
c8fc4194e6ebefb3f35816627675a3168d3b08c1e14d24211837f55fdce5579c
BLAKE2b-256 checksum
How to use checksums
90b25ed127ad17b0f1cc7c3e63f97f0b1e48aa63a03e9ced5c255d85f75126d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / haxball_core-1.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL haxball_core-1.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 473.6 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
abfe86ef42636c9664f8e27c0042e48dbaa740838ea872ccf8f28f18358d93d7
BLAKE2b-256 checksum
How to use checksums
f30db2ac8b481ad371ccba7db84a993ba922d36841a9f9047c03dad2faa52825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / haxball_core-1.0.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL haxball_core-1.0.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 462.4 kB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
37e2ab180f4c3be0351139997d55888f4dba58dea912188d6a0087c02c79f77a
BLAKE2b-256 checksum
How to use checksums
084371686e720a4013e3a8aead01336019cd14addce3be81b2ab57a19a6f6c66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / haxball_core-1.0.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL haxball_core-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Size 416.2 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
20a7405e4f5cc66cd679cdb5879dee0fb8959646440d0c5a655981796d77189d
BLAKE2b-256 checksum
How to use checksums
c0a35e2007c9aed1e736bdd714ec012d8d9b982e10198f3bf224ff0b794d8443
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / haxball_core-1.0.0-cp313-cp313-macosx_10_12_x86_64.whl

Download URL haxball_core-1.0.0-cp313-cp313-macosx_10_12_x86_64.whl
Size 430.9 kB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
6ca35c97ab3cbf6db90d2b662e05307ebd75c579c11baff6df2af84aa30be697
BLAKE2b-256 checksum
How to use checksums
7f0c83ab9b2a334468c0abb3388c2d10f2061dc8237f0d2cf8be979ad48cef6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / haxball_core-1.0.0-cp312-cp312-win_amd64.whl

Download URL haxball_core-1.0.0-cp312-cp312-win_amd64.whl
Size 329.6 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
a42128d71659d06e7194f1e402b30aea5e515837b7f68abfbb0b9893f90b7c31
BLAKE2b-256 checksum
How to use checksums
2b6031d97b23c464ba1682c23111c6e7fbaa660431f6e59d2842d27ea289f8f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / haxball_core-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL haxball_core-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 473.7 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4b4f639a91d3aefaae765ba7803addeda34212a8861654943ee79eddeac6c01c
BLAKE2b-256 checksum
How to use checksums
939f1fc3cc9f692f2a9df56e1e5f4be21cd2e35b34222a4226d7cec053e02f17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / haxball_core-1.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL haxball_core-1.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 462.5 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
00fd8199d2bf0f048bd145bef6a8062f2ba8809d47a8ba2e357d456580ac7f2d
BLAKE2b-256 checksum
How to use checksums
918e9f7e558651e2356560b7bb1be53fc2fad1580139dbbb86cdaa965854289f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / haxball_core-1.0.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL haxball_core-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Size 416.2 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
720eae89a4e9a68832e78066bb52460ec87786f2b9bc5c39c767e47e6609b094
BLAKE2b-256 checksum
How to use checksums
c597fd1b107c4ac69a92c223eaa06e2e29d24d899002db06756cec23a70e1a3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / haxball_core-1.0.0-cp312-cp312-macosx_10_12_x86_64.whl

Download URL haxball_core-1.0.0-cp312-cp312-macosx_10_12_x86_64.whl
Size 431.1 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
9bf89bb786dbc5a4c7040408561c7dc57a133484d8c9c89131e86155be666045
BLAKE2b-256 checksum
How to use checksums
f94677f656ecdadaf5f91c26530235fb44b3d75c390a9ed9b3a59576caade3a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

11 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page