Skip to content

Deterministic xml: Save builds with a stable element order - #10338

Open
rasmuskl wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
rasmuskl:ninja/stable-xml-save-order
Open

Deterministic xml: Save builds with a stable element order#10338
rasmuskl wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
rasmuskl:ninja/stable-xml-save-order

Conversation

@rasmuskl

@rasmuskl rasmuskl commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description of the problem being solved:

The XML save path walked several maps with pairs(): calcs/config inputs and placeholders, item slots, saver sections, and the node-id-keyed allocNodes, masterySelections, jewels and hashOverrides in PassiveSpec. Their emission order was hash order, so the same build could save differently between runs. Sort each walk (names ascending, node ids ascending, slots in creation order) so a build always serialises the same way.

Steps taken to verify a working solution:

Has been running headless in poe.ninja for about a month.

The XML save path walked several maps with pairs(): calcs/config inputs and placeholders, item slots, saver sections, and the node-id-keyed allocNodes, masterySelections, jewels and hashOverrides in PassiveSpec. Their emission order was hash order, so the same build could save differently between runs. Sort each walk (names ascending, node ids ascending, slots in creation order) so a build always serialises the same way. EncodeURL also walks allocNodes ascending, so the nodeCount < 255 cap drops the same nodes every time. Loaders read all of these back as maps, so this is a pure reordering.
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