Repository navigation
Take data/visuals.ron out of rules_hash (ADR 0003) - #51
Merged
Merged
Conversation
Bump rules_version to 25: data/visuals.ron leaves rules_hash (ADR 0003); no sim change. Rules::visuals becomes #[serde(skip)], so rules_hash stops covering data/visuals.ron, while Rules::load still parses and validates it and sim-cli data-check still fails on a bad, missing or unknown entry. The sim never reads the file; the UI strings are the precedent. The owner took this default of the art pass plan on 2026-10-26. - docs/adr/0003-visuals-outside-rules-hash.md (Accepted) and its index row. - rules: rules_hash_ignores_visuals_ron replaces the visuals clause of rules_hash_is_stable_and_covers_attached_files; a bad visual still fails to load. sim-cli data_check: a kind without a visual, an out-of-range look and a missing visuals.ron exit 1; a valid look edit prints the repository's own OK line, rules_hash included. - just rerecord: the eleven fixtures change in the header's rules_version and rules_hash only (10 bytes); no .hash file moved. - Docs: DETERMINISM, DATA_FORMAT, data/README, data/rules/README, ART_STYLE, ARCHITECTURE, CONTRIBUTING, the fixture README, the visuals.rs module doc, the visuals.ron comment and the rules_hash doc; a ROADMAP Notes line under M4b decision 5; the timing trap for replays recorded before the bump in PLAYTEST and HANDOFF.
Since ADR 0003, data/visuals.ron and the UI strings under
data/rules/strings/ are not in rules_hash, so an edit to either needs no
rules_version bump and no just rerecord. data/README.md ("Checking your
change"), the worked example in data/rules/README.md, the balance-change
note in docs/design/README.md and the versioning row in docs/design/ai.md
still said every RON edit changes the hash. They now name the two
unhashed files.
The rules_version row of the rules.ron table in data/rules/README.md now
shows the current value, 25, instead of the stale 22.
Docs only: no data, code or fixture change, so no rules_version bump.
No command prints a replay header's rules_version: verify's RULES CHANGED line shows only the replay's and the loaded rules_hash, and data-check prints the loaded data's version. DETERMINISM, the ROADMAP M4b note, ADR 0003, HANDOFF and PLAYTEST now say that the "replay 0x..." hash names the recording build, because data-check at that commit prints the same hash (0xb231ab753cb4197e is rules_version 24, e84af88). DETERMINISM's verify-output table and its regeneration policy also give the pre-bump replay as a second cause of RULES CHANGED. DETERMINISM's ADR 0003 history called the rules_hash varint 9 bytes long. It is 10 bytes, at offsets 9 to 18. Its last byte, 0x01, is the same in both recordings, so 10 bytes change in all: offsets 8 to 17. HANDOFF now says M5b is merged as PR #47 (e84af88), in its state paragraph and in the table. It had still described M5b as waiting on the PR. Docs only: no data, code or fixture change, so no rules_version bump.
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.
What and why
This is the first PR of the pre-stream art pass. That pass pulls M7's look items forward: CC0 KayKit models through
data/visuals.ron, a minimap, a draw-call counter and the Inter font. The owner approved it on 2026-10-21, and on 2026-10-26 took every default of its plan.Owner decision 1 settles what M4b decision 5 left open:
data/visuals.ronleavesrules_hash, as its own small PR, before any art lands.Why: the sim never reads visuals, just as UI strings were already outside the hash. While visuals were hashed, every model swap or 40 m readability tweak during the art pass would have cost a
rules_versionbump and a re-record of all 11 fixtures. After this PR, a look change is a one-line RON edit.Changes
docs/adr/0003-visuals-outside-rules-hash.md(Accepted, 2026-10-26: Context, Decision, Alternatives, Consequences), with its row in the ADR index.Rules::visualsis now#[serde(skip)], sorules_hashno longer coversdata/visuals.ron.Rules::loadstill parses and validates the file, sodata-checkstill fails on a bad or missing entry.SIM_VERSIONare unchanged.rules_hash_ignores_visuals_ron, which checks an in-memory change, an emptiedVisuals, and an edited file copy.bad_visual_still_fails_to_load_naming_file_and_field.visuals.roneach exit 1. A valid look edit prints the sameOKline,rules_hashincluded.rules_version24 to 25 (reason: "data/visuals.ron leaves rules_hash (ADR 0003); no sim change"), withjust rerecordin the same commit..hashfile is byte-identical. In each of the 11.eonreplayfiles, only header bytes 8 to 17 change: therules_versionbyte and therules_hashvarint.move_500,combat_skirmish,capture_seatandm5_first_match.height_tiles_x100was edited from 150 to 160 invisuals.ron.sim-cli verifyofcombat_skirmishandm5_first_matchstill printsOK, and therules_hashis unchanged.acquire_range_tilesfrom 6 to 7 inrules.ron, printsRULES CHANGED.data/README.md,data/rules/README.md(now at 25, worked example 25 to 26), ART_STYLE, ARCHITECTURE, CONTRIBUTING, design/README and ai.md;Timing trap for the owner's M5b match
A replay recorded before this bump (
rules_version24, maine84af88) reportsRULES CHANGEDon this build and every later one. Verify it with the build that recorded it.No command prints a header's
rules_version. Instead, thereplay 0x…value in theRULES CHANGEDline names the build:0xb231ab753cb4197eisrules_version24 (e84af88).docs/PLAYTEST.mdsays this in the M5b owner checklist.Review
An adversarial review across determinism, tests and docs confirmed 7 findings, all docs. They are fixed in 11f1bbc and ad41df9. Some lines still said "every RON edit changes
rules_hash", one byte count was wrong, and one doc relied on reading a header'srules_version. One finding was refuted: a mechanical guard against the sim reading visuals is not needed, because the sim and ai crates never referenceRules::visuals.Tier
Data PR (files under
data/)cargo run -p sim-cli -- data-check datapasses (OK rules_version=25 rules_hash=0xfb0d0b8986fc8865 resources=4 units=8 buildings=8 ages=3 techs=12 side_techs=2 factions=1 personalities=1 build_orders=1 maps=plains_1v1 strings=en)cargo test -p simpasses (6.7 to 7.1 s warm)rules_versionis bumped with a one-line reason (24 to 25; every.hashunchanged)Docs PR (files under
docs/,README.md,data/*/README.md)typospasses (insidejust ci)Code PR (files under
crates/,scripts/,.github/)just cipasses locally (Linux; cargo-machete and cargo-deny are not installed there, but CI runs them)f32,f64,HashMap,HashSetorInstantincrates/sim,crates/rules,crates/aicrates/gameLicensing and disclosure
How to verify
Generated by Claude Code