17 Commits

Author SHA1 Message Date
xfy
4de7800beb docs(plan): UI panel redesign implementation plan
12 bite-sized tasks: module-dir split → style.rs → preset.rs (TDD) →
wire setup_egui_style → group/collapsing helpers → collapsing_with_toggle
→ sections.rs (4 cards + 6 collapsing) → preset_bar → ui_system rewrite
→ acceptance (build/test/desktop/web).

Testable surface is preset.rs's hash logic (tests/preset_test.rs via new
lib.rs exports); everything else verified by the visual/web acceptance
checklist, matching the codebase convention that rendering isn't unit-tested.
2026-07-17 14:46:19 +08:00
xfy
c260b6fbfb docs(spec): UI panel redesign — SidePanel + sci-fi theme + presets
Design spec for the egui control panel overhaul. Addresses the
user-reported 'settings all look bad' by fixing the structural root
causes (flat 11-CollapsingHeader scroll, no styling, ragged sliders,
no presets) rather than a cosmetic reskin.

Key decisions captured:
- Chassis: right SidePanel (replaces floating Window)
- Theme: deep-space cyan/orange, hand-applied over Visuals::dark()
- Structure: 4 always-open framed cards + 6 collapsing sections
  (11→10 groups; Renderer merges into Quality, fixing a latent
  duplicate render_scale slider bug)
- Preset bar: Cinematic/Performance/Web/Custom with per-frame hash
  detection of hand-edits
- Two-column Grid rows with unit suffixes + log scales on wide ranges
- Group-enable toggles in collapsing headers; standardized warning text

Non-goals explicit: no params/shader/physics changes, no custom font
binary, no painted toggle, no new deps.
2026-07-17 14:39:43 +08:00
xfy
6ff5a05e74 docs(spec): correct Ω_θ cross term (a√M/r^1.5, not a·Ω_φ/r)
The vertical epicyclic frequency's cross term is a√M/r^1.5 (radius to the
−1.5), following Okazaki 1987. The spec previously wrote a·Ω_φ/r, which makes
Ω_θ too large and breaks monotonic growth of precession with spin. Caught
during Task 1 implementation by the grows_with_spin test; syncing the spec
to the corrected formula that shipped in 891eadf.
2026-07-16 17:53:12 +08:00
xfy
27e5e8b1f6 docs(plan): Kerr orbiting planets implementation plan (Phase 3.4)
9-task TDD plan implementing the Phase 3.4 spec. Path A: all orbital physics
on CPU, shader untouched.

Task ordering enforces a buildable chain:
- Task 0: add rand + rand_chacha (currently only transitive via bevy)
- Task 1: physics.rs Ω_φ + Ω_LT with 5 failing-first tests (χ=0 degeneracy,
  strong-field > weak-field, monotonic-in-spin)
- Task 2: OrbitParams + orbit_position pure fn with 3 geometry invariants
  (radius preserved, equatorial χ=0 stays in plane, motion over time)
- Task 3-4: orbit_system + BlackHoleParams fields (coupled, committed together)
- Task 5: spawn_planet_system (ChaCha8Rng, replaces spawn_default_planet) +
  PlanetSystemDirty resource + plugin registration
- Task 6-7: UI header + dirty-flag wiring on seed/count/k change
- Task 8: integration test + visual tuning

Each task is bite-sized (2-5 min steps), exact file paths/line numbers,
complete code blocks, exact test commands. Self-reviewed against spec: all
sections covered, no placeholders, type names consistent across tasks.
2026-07-16 16:50:18 +08:00
xfy
95968c0575 docs(spec): Kerr orbiting planets design (Phase 3.4)
Spec for 5-8 planets on Kerr circular orbits with strong-field Lense-Thirring
nodal precession. Path A: CPU computes position each frame, uploads to the
existing storage buffer; shader unchanged.

Physics: closed-form Ω_φ (Bardeen 1972 eqn 2.16) and Ω_θ (Caltech Ph236
epicyclic vertical frequency), giving exact nodal precession Ω_φ - Ω_θ.
χ=0 degenerates exactly to Schwarzschild (Ω_LT = 0, Newtonian Ω_φ).

Explicitly rejects Mino-time analytic geodesics (Fujita-Hikida): circular
orbits collapse the three-frequency decomposition to Ω_φ alone, elliptic
functions have no WGSL/std backing, and it would break physics.rs's
single-testable-mirror design. Closed-form Kerr frequencies are the right
tool for circular orbits.

Orbit radius bound to k·kerr_isco(χ), so planets track the disk inner edge
as spin changes and span the strong-field region (k=2.5 → r ∈ [1.25, 7.5]).
Random initial attitudes (ChaCha8Rng + UI seed) so the three orbital planes
precess at different Ω_LT rates — the visible Kerr signature.

Decomposes Planet into OrbitParams (immutable elements) + Planet (derived
center), keeps SphereData GPU layout untouched. Adds time_scale UI knob
because Ω_LT at r=8 needs ~25 min per revolution otherwise.
2026-07-16 16:46:10 +08:00
xfy
3ab432417a docs(plan): volumetric accretion disk implementation plan
9-task plan for the volumetric disk spec. Tasks are ordered for
independent compilability (a temporary disk_color shim in Task 5 keeps
the build green until Task 7 restructures the main loop):
  1. DiskQuality enum + 8 params + defaults (params.rs)
  2. 9 uniform fields, Rust + WGSL in lockstep (material.rs, shader)
  3. mirror_params copies (plugin.rs)
  4. ridged_fbm noise (shader, inert)
  5. shared helpers + DiskSample + disk_color_flat (shader refactor)
  6. disk_color_volumetric: ridged + density + spiral arms (shader, inert)
  7. main-loop restructure: in-slab sampling + edge-capture + tier dispatch
  8. Disk Turbulence egui panel (ui.rs)
  9. full verification: cargo test, desktop + web visual + perf check
2026-07-15 11:31:33 +08:00
xfy
d1ea789274 docs(spec): volumetric accretion disk design
Design for replacing the smooth zero-thickness disk with a Gargantua-style
volumetric gas disk. Supersedes the Phase 3 non-goal "disk stays a zero-
thickness plane" - user feedback identified zero thickness as a root cause
of the disk looking too smooth.

Key decisions captured:
- Approach A volumetric integration: in-slab sampling reuses the existing
  RK45 adaptive step (dense where light bends, sparse where straight),
  no separate ray-march. Midplane edge-capture retained for straddling steps.
- Ridged multifractal noise (ridge^2) for sharp bright filaments, replacing
  the smooth FBM blobs that produce the current mushy texture.
- Separate density field (smoothstep-gated FBM) for gas clumping, plus a
  logarithmic-spiral arm modulation riding the Keplerian shear.
- DiskQuality tier enum (Off/Low/Medium/High) gates octave counts; Off is
  a full revert to the flat disk as perf escape hatch + visual A/B.
- physics.rs untouched: volumetric integration is render-sampling layer,
  never enters the geodesic solver; existing tests stay green.
2026-07-15 11:17:12 +08:00
xfy
d32ea10aec docs: implementation plan for cinematic rendering
10-task plan (Tasks 0-9) for the HDR bloom + FBM disk + ACES + AA
pipeline. Each task is a standalone commit: Rgba16Float offscreen →
FBM disk → gaussian-speck stars → brightpass → blur pyramid →
composite+ACES → BloomQuality enum → Quality panel → verification.

Conventions established upfront (camera orders, RenderLayers, the
QuadScaleFactor/CompositeQuad/Nudgable markers) so each task references
them rather than re-deriving. The naga var<private> array fix for the
blur kernel is baked into the shader from the start.
2026-07-14 23:24:14 +08:00
xfy
5c6c20fa00 docs: spec cinematic rendering (HDR bloom + FBM disk + ACES + AA)
Design for raising the renderer from geometrically-correct-but-flat to
Gargantua-reference fidelity. Four user-selected traits:

- HDR color + ACES tone mapping (Rgba16Float offscreen, Narkowicz fit)
- Multi-pass HDR bloom (bright-pass → down-pyramid → up-pyramid → composite)
- Domain-warped FBM disk texture (replaces two-sine noise)
- Anti-aliasing via render_scale + gaussian-speck stars

All quality options configurable via a dedicated egui Quality panel,
with tiered web defaults (Low bloom, no MSAA/star-AA) vs desktop (High).
BloomQuality::Off falls back to the original LDR path for WebGPU
browsers without float-filterable support.

Geodesic integrator (deriv/rk45_step/is_captured_rk45) untouched —
the physics.rs mirror contract is unaffected. No new tests.
2026-07-14 18:24:36 +08:00
xfy
d5c0998537 docs: sync project status to shipped Phase 2 (Kerr) reality
The docs described Phase 2 as 'future work' while the code had already
shipped it: spin is wired through the uniform into the shader's Kerr deriv(),
the integrator is adaptive RK45, disk_inner is ISCO-derived, render_scale
runs a real offscreen render-to-texture + upscale pass, and the UI exposes a
Spin slider with live ISCO/Horizon readouts. Anyone reading the docs got a
wrong picture of completeness.

README:
- Intro: 'Schwarzschild' -> 'black-hole (Kerr at spin>0, Schwarzschild at 0)'.
- How it works: RK4 -> adaptive Dormand-Prince RK45; add the frame-dragging
  term to the bending accel; capture radius r+(chi); ISCO-tracked inner edge.
- Controls: add Black Hole section (Spin, ISCO/Horizon); render_scale slider.
- Performance: render_scale now wired (0.75 desktop / 0.5 web), not reserved.
- Status: Phase 1 shipped; Phase 2 implemented-pending-human-validation;
  Phase 3 (exact pseudo-Hamiltonian) is the actual future work.

AGENTS.md:
- Intro + mirror contract: name the Kerr/RK45 functions the mirror must track
  (kerr_bending_accel, rk45_step, is_captured_rk45) and the exact shader lines.
- Conventions: 'render_scale and spin are reserved' is false now — both wired;
  update the perf-lever and web-defaults notes accordingly.
- Reference docs: list both Phase 2 docs, not just Phase 1.

Phase 2 plan (docs/superpowers/plans/2026-07-13-...-kerr.md):
- Status banner: Tasks 1-7 implemented+committed, Task 8 (human visual/perf
  checklist) is what remains.
- Check the Task 1-7 step/commit boxes; leave all Task 8 manual steps and the
  visual/fps acceptance items unchecked. Check only the code-verifiable
  acceptance items (cargo test green, RK45+render_scale running, Spin slider
  shipped).
2026-07-14 15:52:49 +08:00
xfy
15cbf52fb6 docs: Phase 2 (Kerr) implementation plan 2026-07-13 18:36:12 +08:00
xfy
0693c3d165 docs: Phase 2 (Kerr) design spec 2026-07-13 18:24:49 +08:00
xfy
02368a0a74 docs(plan): Phase 1 Schwarzschild implementation plan
20 tasks covering: deps, minimal window, web/Trunk/WebGPU, full-screen
Material2d pipeline, orbit camera, params resource, uniforms+mirror, ray
gen, RK4 Schwarzschild integrator, CPU physics tests, lensed starfield,
Doppler accretion disk w/ Einstein halo, egui panel, storage-buffer
planets, Flamm grid, cubemap skybox, render scale, web verification,
README. Verified against Bevy 0.19 API (group-2 material bind group,
component spawning, WgpuSettings defaults).
2026-07-09 18:57:42 +08:00
xfy
041e8f3b21 docs(spec): correct Bevy 0.19 API details (verified)
- Material2d bind group is group 2 (#{MATERIAL_BIND_GROUP}), not group 1
- RenderPlugin has no wgpu_backends field; enable bevy 'webgpu' feature instead
- WgpuSettings::default() auto-selects BROWSER_WEBGPU on wasm32
- Imports from bevy::sprite_render (Material2d, AlphaMode2d)
- Component-based spawning (Camera2d, Mesh2d/MeshMaterial2d), no bundles
- getrandom 0.4/wasm_js handled transitively by Bevy
2026-07-09 18:47:44 +08:00
xfy
c1bfe2b25e docs(spec): add desktop + web (WebGPU) platform support
- WebGPU-only web target (Bevy forces WebGPU/WebGL2 at build time; WebGL2
  lacks storage buffers our planets feature needs)
- Add §13 Platform support: build toolchain (trunk/wasm32), backend gating,
  fallback message, web defaults (render_scale 0.75, steps 200)
- Add src/web.rs, web/index.html, Trunk.toml to file structure
- Add web-sys dep; add web build + perf verification milestones
- Update storage-buffer risk note: valid on native + WebGPU
2026-07-09 18:30:56 +08:00
xfy
60bfdb9ca6 docs(spec): add egui parameter UI (bevy_egui 0.41) + dependencies section
- Switch interaction from keyboard to a collapsible egui 'Controls' panel
  with grouped sections (Camera/Disk/Doppler/Renderer/Background/Grid/Planets)
- Pin bevy_egui 0.41.0 (verified against crates.io: bevy ^0.19 + egui ^0.35)
- Add Dependencies section §0; add src/ui.rs to file structure
- Clarify mouse-input routing between egui panel and orbit controller
2026-07-09 18:26:24 +08:00
xfy
c2d4bf779a docs: add Interstellar black hole renderer design spec
Analyzes reference video (BH + tilted Doppler disk + lensed halo + stars),
specifies full 8-feature scope (adds cubemap skybox, lensed planets, Flamm
grid), Schwarzschild Phase 1 with Kerr Phase 2 follow-up, Bevy 0.19
full-screen Material2d architecture.
2026-07-09 18:20:38 +08:00