Skip to content

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

Merged
LocalIdentity merged 2 commits into
PathOfBuildingCommunity:devfrom
rasmuskl:ninja/stable-xml-save-order
Sep 10, 2026
Merged

Deterministic xml: Save builds with a stable element order#2513
LocalIdentity merged 2 commits 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, weapon-set node lists, and the node-id-keyed allocNodes, masterySelections, jewels, attribute nodes 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, weapon sets by number) 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.

rasmuskl and others added 2 commits September 9, 2026 13:15
The XML save path walked several maps with pairs(): calcs/config inputs and placeholders, item slots, saver sections, weapon-set node lists, and the node-id-keyed allocNodes, masterySelections, jewels, attribute nodes 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, weapon sets by number) 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.
@LocalIdentity LocalIdentity added the technical Hidden from release notes label Sep 10, 2026
@LocalIdentity
LocalIdentity merged commit 852042e into PathOfBuildingCommunity:dev Sep 10, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical Hidden from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants