Repository navigation
AntHill demo: fix the ReadsSnapshot<Genetics> schedule error, add an on-screen control reference and a README - #669
Merged
Conversation
…on-screen control reference and a README FillRenderBuffer declared ReadsSnapshot<Genetics> while Genetics is a SingleVersion component, which RuntimeSchedule.Build has rejected since cbef4b6 (AC-05 / CM-04, #392). The demo has failed to start for ~5 weeks; nothing caught it because no CI job ever calls Build() on the AntHill schedule, and the breakage is Build-time-only so the compiler can't see it. Plain Reads is behaviour-identical here: the sole Genetics writer (AntUpdate) sits in the Simulation phase and FillRenderBuffer in Render, so the cross-phase deriver emits the same writer -> reader edge ReadsSnapshot did, and a snapshot read whose writer is in an earlier phase already degenerated to fresh semantics (RFC 07, "Semantic shift: cross-phase ReadsSnapshot"). It also makes Genetics consistent with WorldBounds and AntState, which the same system already read plainly and the same system writes. Verified with AntHill.Harness --duration 3: schedule builds, 181 ticks, clean shutdown. Adds a bottom-left keybinding panel whose visibility is tied to the debug HUD, anchored rather than positioned so it stays pinned to the corner across window resizes. Both F1 and the settings checkbox now route through a single SetDebugHudVisible, and F1 pushes the new state back into the checkbox via SettingsPanel.SetDebugToggle — previously F1 mutated the HUD directly and left the panel showing a stale tick. Replaces the startup GD.Print control list rather than duplicating it: that string had drifted and claimed wheel=zoom, mid-drag=yaw and 1-4=speed, none of which are the current bindings (wheel sets camera move speed, right-drag is mouselook, [ and ] step the time scale, 1-5 select tools). Space/Ctrl altitude and Shift sprint were undocumented entirely. New README.md for AntHill.Demo: what the demo is, what it simulates, how to run it, the full control reference, how to read the HUD, the four-phase tick pipeline, the simulation-to-render handoff, profiling, and the headless harness. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ETHnFHUeFTho3EAnXmXNdS
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.
Why
The AntHill demo has failed to start for ~5 weeks:
Not a recent regression — the two halves have simply been inconsistent since the validation landed:
a179e510(#352).ReadsSnapshot<Genetics>()toFillRenderBuffercbef4b61(#392/#395)3f3b88b1(#514)The
NullReferenceExceptionflood that follows inMain._Processis pure cascade:_Ready()aborted before the HUD labels were assigned.The fix
.ReadsSnapshot<Genetics>()→.Reads<Genetics>(). Behaviour-identical, not a compromise:AntUpdate(the soleGeneticswriter) is in the Simulation phase;FillRenderBufferis in Render. AC-02 only forbids plainReadsagainst a same-phase writer, so this is legal.AntUpdate → FillRenderBuffer(deriver table row 1:sys_a.Writes<T> ∩ sys_b.{Writes,Reads,ReadsFresh,ReadsSnapshot}<T>). The DAG is unchanged.ReadsFreshsemantics. The observed value is the same this-tick value it was before.WorldBoundsandAntStatein that same system are written by the sameAntUpdateand already used plainReads. OnlyGeneticswas the odd one out — leftover from when Phase 5 promoted it fromReadstoWriteson the sim side.Also in this PR
On-screen control reference (bottom-left, toggled with the debug HUD). Anchored rather than positioned — point-anchors at the bottom-left corner with
GrowVertical = Begin/GrowHorizontal = End, so it stays pinned across window resizes (the demo persists window geometry). Kept to a narrow column because the minimap is anchored bottom-right at 256 px.Single owner for debug-overlay visibility.
SetDebugHudVisible()now drives both the stat HUD and the help panel;F1and the settings checkbox both route through it.F1additionally pushes state back into the checkbox via the newSettingsPanel.SetDebugToggle()— previouslyF1mutated_hudRightdirectly and left the settings panel showing a stale tick. Mirrors howH/pheromone already worked.Deleted the drifted startup control list. The
GD.PrintatMain.cs:114claimedwheel=zoom,mid-drag=yawand1-4=speed— none of which are the current bindings (wheel sets camera move speed, right-drag is mouselook,[/]step the time scale, 1-5 select tools).Space/Ctrlaltitude andShiftsprint were undocumented entirely. Replaced with a pointer to the on-screen panel rather than a second hand-maintained copy.README.mdforAntHill.Demo— what the demo is and what it simulates, how to run it, the full control reference, how to read the HUD (including LOD bands vs. simulation tiers), the four-phase tick pipeline, the sim→render handoff, profiling via++ --trace/--live, and the headless harness. Every figure sourced from code; all 7 relative links verified to resolve.Verification
AntHill.Harness --duration 3(headless, no Godot): schedule builds, 181 ticks, clean shutdown,FillRenderBufferat 526 µs p50.AntHill.DemoandAntHill.Harnessboth build: 0 warnings, 0 errors.Known gap, not addressed here
grep AntHill .github/workflows/returns nothing. The demo is inTyphon.slnxso it compiles in CI, but no job ever callsRuntimeSchedule.Build()on it — which is exactly why this class of breakage survived five weeks. A ~1 s smoke test constructing the AntHill runtime and assertingBuild()succeeds would surface every future AC-0x tightening on the PR that lands it. Left out of this PR deliberately; happy to file it separately.There is no tracking issue for this — the commit is unprefixed rather than pointing at an invented number.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ETHnFHUeFTho3EAnXmXNdS