Repository navigation
feat(sky): a stated sky can stand at a tick and ask for the game look - #41
Merged
Merged
Conversation
StatedSky gains `tick: Option<StatedTick>` (time, look, render distance).
At a stated tick the environment is sampled at it, HQ mode weights the
stated look through the one `look_weight` (`sky::day_weight` for
`ByTime`) that `Sky::Vanilla` uses, and both modes draw the tick's sunrise
glow, moon and stars through the one `tick_celestials` the vanilla arm
uses. `QuickSkyColours::vanilla` is the vanilla arm's colour derivation,
public so a caller can state Lumenwright's reading. At no stated tick
(`StatedSky::new`) the frame is 0.2.0's. StatedSky and StatedTick are
`#[non_exhaustive]` with constructors.
Tests: a stated sky at tick T equals `Sky::Vanilla { time: Some(T) }`
with the same sun, byte for byte; at no tick it equals 0.2.0 as published
(a dev-dependency on lumenwright =0.2.0), byte for byte.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ba8LkuKW2bd5C5HCDo7p2
… the tests CHANGELOG [Unreleased] records the stated tick, QuickSkyColours::vanilla, the non_exhaustive constructors (a breaking change for 0.2.x), and weather as not expressed: the game's look draws a clear sky. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ba8LkuKW2bd5C5HCDo7p2
`cargo publish --dry-run --workspace` refused lumenwright-cli: a published crate may not depend on lumenwright 0.2.0 twice under two names (the path dependency and the =0.2.0 oracle). The oracle test moves to `crates/lumenwright-compat` (publish = false), a workspace member that `cargo test --workspace` runs and the package job skips. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ba8LkuKW2bd5C5HCDo7p2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A stated sky can stand at a tick and ask for the game's look
A caller that states its sky (
Sky::Stated) used to get Chunky's look every time. 0.2.0'sStatedSkyhad no field for a tick or a look. The HQ day weight was fixed at 1, the environment was sampled at the world'sDayTime, and the stated quick sky drew no sunrise glow, moon or stars. A frame that states its sky at dusk therefore came out with Chunky's yellow cast where the game shows orange.API
StatedSky::tick: Option<StatedTick>.StatedTick { time, look, render_distance }is built byStatedTick::new(time, look);StatedSky::at(tick)sets it.StatedSky::new(quick, hq)is a stated sky at no tick, and draws what 0.2.0 drew.QuickSkyColours::vanilla(env, biome, time, sun_dir, forward, draw_distance)returns the coloursSky::Vanilladerives, so a caller can state Lumenwright's own reading.StatedSkyandStatedTickare#[non_exhaustive].Semver: this breaks 0.2.x. Adding a field to an exhaustive public struct breaks every struct literal, and that is true whether the new field has a default or comes with a constructor. Neither option keeps semver. The constructors together with
#[non_exhaustive]make this the last such break: a later field is additive. Under Cargo's rule for 0.x, the next release containing this is 0.3.0. Callers move fromStatedSky { quick, hq }toStatedSky::new(quick, hq).Behaviour at a stated tick
tick.time.look_weight, the one functionSky::Vanillaalso uses.ByTimecallssky::day_weight,Gameis 0,Chunkyis 1.StatedSky::hqis Chunky's part of the frame.tick_celestials, the one function the vanilla arm also draws them with. UnderSky::Vanilla,quick_skynow gets its colours fromQuickSkyColours::vanilla, so the stated and vanilla arms differ only in where the colours come from.Tests
a_stated_sky_at_a_tick_is_the_vanilla_sky_at_it(lumenwright-cli/tests/library.rs) statesQuickSkyColours::vanillaandsky::hq_skyat the same sun. Each frame must equalSky::Vanilla { time: Some(T), sun_dir: Some(sun) }byte for byte on the CPU. Cases: quick at 12800 and 18000; HQGameat 12800 and 18000; HQByTimeat 12800. The same stated sky with no tick must draw something different, which proves the tick is not vacuous.a_stated_sky_at_no_tick_draws_as_0_2_0_did(lumenwright-compat/tests/stated_sky.rs) renders one request through this tree and throughlumenwright =0.2.0as published on crates.io. The world'sDayTimeis midnight. Quick and HQ must be byte-identical on the CPU.lumenwright-compatis a new workspace member withpublish = false. A published crate cannot depend onlumenwright 0.2.0under two names (cargo publish --dry-runrefused it), so the oracle lives in its own crate.cargo test --workspaceruns it, and the package job skips it.Red before, green after. Each perturbation below was applied to a scratch copy of the tree:
DayTimea_stated_sky_is_drawn_as_given)ByTimeas the default look at no tickThe treehouse dusk reference through the stated path
Camera: 140,118,14 looking at 56,82,58, fov 60, render distance 12, tick 12800, HQ, 8 bounces. Rendered on Apple M2 Pro Metal at 2048 spp. The stated sky is
QuickSkyColours::vanillaplussky::hq_skyat the environment's sun,StatedTick::new(12800, ByTime).Sky::Vanilla { time: Some(12800), sun_dir: None }at the same budget: byte-identical, 0 of 921 600 pixels differ.docs/renders/treehouse-camp-dusk-hq.png(CUDA, 16 384 spp): mean |d| 1.83/255.Measured with
measure.py:--sky chunky)Not expressed
Weather: the game's look draws a clear sky, both under
Sky::Vanillaand at a stated tick, and applies no rain or thunder. This is recorded in CHANGELOG[Unreleased].Docs
[Unreleased]docs/library.md: the stated tickdocs/SCOPE.md: G10docs/testing.md: the release tests🤖 Generated with Claude Code
https://claude.ai/code/session_016ba8LkuKW2bd5C5HCDo7p2