mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-15 13:22:19 +01:00
e28a8b7956fe3fbd96d2fd1e5dd59c71c59c3e80
The generator kept its definitions, reference counts and type bindings in HashMap and HashSet, whose iteration order changes from run to run. The topological sort walked the keys in that order, so which shared types were bound before their dependents, and so how some types were written out, changed between runs. Running the same schema eight times gave eight different files. Use BTreeMap and BTreeSet in generator.rs and prepare.rs so every walk is in sorted key order. The final let block was already sorted by identifier and is unchanged. Verified: cargo test passes (48 tests). Running the release binary on the KDE schema.json eight times gave one identical output; the same eight runs before the change gave eight different outputs.