Skip to content

feat: constellations preset (seeded asterisms, template-held) - #59

Merged
tamirelazar merged 16 commits into
devfrom
feat/constellation-init
Jun 23, 2026
Merged

feat: constellations preset (seeded asterisms, template-held)#59
tamirelazar merged 16 commits into
devfrom
feat/constellation-init

Conversation

@tamirelazar

Copy link
Copy Markdown
Owner

Constellations preset

Adds a single constellations preset (quick-key 2, alias constellation) that seeds agents as real star asterisms and holds the figure crisp via a continuous template re-stamp.

What it does

  • New src/simulation/constellations.rs: 6 hand-placed canvas-filling asterisms (Orion, Ursa Major, Scorpius, Cygnus, Leo, Gemini), picked via the seeded sim RNG, fit to grid aspect, rasterized to an anti-aliased template (weighted star glows + thin edge lines).
  • Simulation::new/reset() pre-seed the trail map (figure visible at frame 1); a per-frame post-decay max-combine re-stamp (gated by SimConfig::constellation_restamp_floor) holds it.
  • Template is scaled to the trail white-point so stars render white and lines stay thin regardless of max_brightness.
  • Render: Points charset, Cosmic palette, linear_log_split(10) intensity mapping, fixed (non-auto) low white-point.
  • effective_init_mode made a deterministic pass-through (removed a thread_rng() reset re-roll).

Notes

  • Net preset count unchanged for this branch's surface: one constellations preset (the earlier drift/static A/B variants were collapsed into this single winner during review).
  • Determinism: everything random flows through the seeded Rng; same seed → identical figure, agent layout, and pre-seeded trail across new() and reset().

Tests

  • Unit + integration tests for data validity, aspect fit, rasterizer, seeding, brightness-scale invariant, deterministic reset, render defaults, and app-defaults (never auto-resets).
  • Config snapshot golden regenerated (only the constellations block).
  • Full gate green: cargo fmt + cargo clippy --all-targets --all-features -D warnings + cargo test (1022 lib + 56 visual_regression + 19 doc, 0 failed).

Add InitMode::Constellation variant, SimConfig::constellation_restamp_floor
field, Simulation::constellation_template, build-once layout in new()/reset(),
trail pre-seed via max-combine, and extend init_species with constellation_layout
param + dispatch arm. Add non-exhaustive arms in runner.rs and explorer.rs.
`effective_init_mode` was calling `InitMode::random(&mut thread_rng())`
for Constellation, making every auto-reset and manual restart choose a
different init layout. Now that the constellation figure is selected by
the seeded sim RNG inside `Simulation::new`, the reset path is fully
deterministic. The function becomes a pass-through and the `preset`
argument is dropped at the function and all three call sites. Stale
doc comments updated accordingly.
Add "constellationstatic" to the PRESETS array in preset_config_snapshot.rs
and regenerate tests/golden/preset_configs.txt. The constellation block now
reflects init_mode=Constellation (changed from Random), and a new
constellationstatic block appears with restamp_floor-discriminated scalars.

Fix two clippy field_reassign_with_default errors in constellation test
helpers in src/simulation/mod.rs (use struct-init syntax).

Full gate: 1017 lib + 56 visual_regression + 19 doc tests, all green.
…tars, retune presets

Template values (0..1) are now multiplied by max_brightness at every stamp
site (new(), reset(), update()) so the pre-seeded figure renders at full
trail-brightness range instead of ~3% white-point.  Star sigma tightened
to 2.2px; edge peak/sigma reduced to 0.45/0.55 for hairline linework.

ConstellationStatic: restamp_floor 1.0, decay 0.92, deposit 0.6, count 2500.
Constellation drift: decay 0.95, deposit 1.5, count 5000, floor stays 0.0.

Test rewritten to assert held > 1.5 (proves scaling happened) and that
drift decays strictly below the static floor after 20 frames.
…t, richer canvas-filling figures

- Render: both Constellation + ConstellationStatic switch Braille→Points charset,
  add IntensityMapping::linear_log_split(10.0), explicitly pin auto_normalize=false
- ConstellationStatic sim retune: max_brightness 30→10, deposit_amount 0.6→0.3
  (top-level and species[0]), count 2500→2000
- fit_to_grid margin 10%→5% so figures use more of the canvas
- Replace 6 figures (drop Cassiopeia/Crux): Orion(10s/11e) Ursa Major(10s/10e)
  Scorpius(10s/9e) Cygnus(7s/6e) Leo(9s/9e) Gemini(11s/10e)
- Update test: both_constellations_render_braille_cosmic →
  both_constellations_render_points_cosmic (asserts Points/Cosmic/false/lin-log-split)
- Regenerate preset_configs.txt golden (constellationstatic block only)
@tamirelazar
tamirelazar merged commit 2e1a429 into dev Jun 23, 2026
2 of 3 checks passed
@tamirelazar
tamirelazar deleted the feat/constellation-init branch June 23, 2026 03:50
tamirelazar added a commit that referenced this pull request Jun 24, 2026
origin/dev advanced past the first merge with the constellations preset.
Sole conflict was a both-sides test addition in runner.rs: keep the
UI-system Task-15 ambient-mode tests alongside dev's
constellation_reset_is_now_stable test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant