7 Commits

Author SHA1 Message Date
xfy
b787a4c54c fix(web): enable getrandom js feature for wasm32 target
rand 0.8 depends on getrandom 0.2, which refuses to compile on
wasm32-unknown-unknown without its "js" feature (it needs to call into the
Web Crypto API via wasm-bindgen). Bevy's own rand usage sits on getrandom
0.3+, which enables this by default, so the web build only broke once we
added a direct rand 0.8 dep in 76be513.

Force-enabling getrandom/js in the wasm32 target deps section unblocks
`trunk build`. Desktop is unaffected (the cfg gates it to wasm only).
Caught by the Task 8 wasm cargo-check gate.
2026-07-16 18:29:11 +08:00
xfy
76be513bb5 deps: add rand + rand_chacha for deterministic planet seeding
ChaCha8Rng needs both crates: rand (the core traits Rng/SeedableRng) and
rand_chacha (the ChaCha8Rng type, split out of rand since 0.9). rand was
already a transitive dep via bevy_math but not declared directly.

Pinned to 0.8/0.3 (LTS, API-stable with the Bevy 0.19 ecosystem) rather
than the newer 0.10 line, which would force a wider dep upgrade.
2026-07-16 17:41:56 +08:00
xfy
614bd1d88c perf(build): add fat LTO + single codegen-unit to desktop release profile
The renderer is GPU-bound, but Bevy's CPU path (resource management,
system scheduling, egui, wgpu command submission) still benefits from
cross-crate inlining. Cargo's default release profile skips LTO and
splits codegen across 16 units, leaving inter-crate trampolines through
Bevy/wgpu in the hot path.

- lto = "fat": whole-program cross-crate inlining.
- codegen-units = 1: best optimization (slower compiles, accepted).
- panic = "abort": smaller binary, no unwind tables.
- strip = "symbols": drop debug symbols from the shipped binary.

wasm-release inherits release then overrides opt-level to "z", so web
builds keep their size focus. Release build verified; cargo test green
(14 passed).
2026-07-16 13:23:01 +08:00
xfy
d5e3008343 test: CPU-mirrored geodesic physics + bcrit/capture unit tests 2026-07-10 10:43:11 +08:00
xfy
9c8f384d0e feat: web build via trunk with WebGPU detection + fallback 2026-07-10 10:12:57 +08:00
xfy
ea6b15524d build: add bevy 0.19 and bevy_egui 0.41 dependencies 2026-07-10 09:45:59 +08:00
xfy
3d34c0920d Initial commit: scaffold Rust project with Cargo 2026-07-09 17:55:14 +08:00