diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 34bc9fea..4107f615 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,6 +92,14 @@ jobs: - name: Build shell: bash run: | + # Release binaries target x86-64-v3 (AVX2/FMA/BMI — Intel Haswell/2013+, + # AMD Zen+; lets LLVM autovectorise wider than baseline SSE2). Dev/CI + # builds stay on the baseline for compatibility and fast compiles. + # aarch64 is excluded: the flag is invalid there, and ARM64 already + # has NEON in its baseline. + if [[ "${{ matrix.target }}" == x86_64-* ]]; then + export RUSTFLAGS="-C target-cpu=x86-64-v3" + fi args=(--release --locked --target ${{ matrix.target }} -p app -p route-editor -p vehicle-editor) if [ "${{ matrix.dlss }}" = "true" ]; then # Linux: libvulkan-dev puts the headers under /usr/include. Windows diff --git a/README.md b/README.md index 61e5988a..6755d086 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ For a faster edit-compile-run loop, add `--features dev` to any of the four bina (`app`, `route-editor`, `vehicle-editor`, `signal-editor`). It links Bevy as a shared library, which cuts the relink after a code change. The first build with the flag recompiles Bevy, and the resulting binary needs the Bevy DLL next to it — so use it for development only, never for a release. -Builds also use the toolchain's own `rust-lld` linker on Windows (see `.cargo/config.toml`), dependencies compile at `opt-level = 3` while the workspace itself stays at `1`, and `--release` adds thin LTO with a single codegen unit. +Builds also use the toolchain's own `rust-lld` linker on Windows (see `.cargo/config.toml`), dependencies compile at `opt-level = 3` while the workspace itself stays at `1`, and `--release` adds thin LTO with a single codegen unit. Release binaries for `x86_64` additionally build with `-C target-cpu=x86-64-v3` (see `.github/workflows/release.yml`) — needs an Intel/AMD CPU from ~2013+ (Haswell/Zen+); for a local release-equivalent build set `RUSTFLAGS="-C target-cpu=x86-64-v3"` yourself. On Linux the four programs run natively on **Wayland**: winit picks Wayland whenever `WAYLAND_DISPLAY` or `WAYLAND_SOCKET` is set and falls back to X11 (or XWayland) otherwise.