Stop paying for determinism nothing asks for - #38
Draft
marlls1989 wants to merge 2 commits into
Draft
Conversation
marlls1989
force-pushed
the
refactor/no-determinism-slop
branch
from
August 8, 2026 07:49
109f25a to
e393ac0
Compare
I had reached for ordered collections and sorts throughout to keep the output repeatable between runs, which is worth nothing here: emission order carries no meaning, and a run may pick any equally-good representative. Ordered where nothing observes the order costs a comparison per lookup and says the order matters when it does not. The guidelines now say so outright. Converted to hash collections: the membership and lookup sets across the model validation, the edge classification, the minimisation and the emitters; the hazard and constraint dedup maps, whose iteration only fixed the order the blocks come out in; the leakage dedup; the reachability relation behind the state-variable search; and the seed pool. Dropped two sorts: the Verilog UDP table rows, a truth table whose rows carry no order between them — the emitted line multiset is unchanged, only the row order moves — and the seed ranking's final minterm tie-break, which sat after the two real ranking criteria to settle ties that need no settling.
The section stated flatly that determinism is worth nothing and loses every trade. That is stronger than the position: repeatable output is a real argument for reproducibility, and the question is being answered strip-first rather than answered against. So it now says what it is — where the thinking has got to. The working answer stands (strip it, do not add it back by reflex), and reintroduction is allowed on evidence: the algorithm cost, the alternatives, and a benchmark. "It makes the output stable" is the claim under examination, so it does not count as an argument for itself.
marlls1989
force-pushed
the
refactor/no-determinism-slop
branch
from
August 8, 2026 08:37
e393ac0 to
48d6957
Compare
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.
The open question
Whether deterministic output is a good goal is not settled. There is a real argument for it — reproducibility: a run you can repeat byte-for-byte is a run you can diff against a previous one, hand to someone else, or bisect against when a characterisation result changes. That argument has not been dismissed.
What is settled is that determinism was never decided here. It accumulated: I reached for ordered collections and sorts by reflex, case by case, without ever weighing the cost, and in places advertised the resulting stability as a benefit. Whatever the answer turns out to be, that is not how it should have been arrived at.
The plan
Deliberately two-phase, and in this order:
Strip it all. Remove every ordered collection, sort and tie-break that exists only to stabilise output, everywhere, without exception. Get to a tree where nothing is ordered by reflex and the only orderings left are ones an external format demands.
Reintroduce, one case at a time, each defended. Where determinism turns out to be worth having, put it back deliberately — with the algorithm cost stated, the alternatives considered, and benchmarks supporting the choice. A reintroduction without that evidence does not go back in.
Phase 1 first, on purpose. Stripping and then arguing each case back is tractable; pondering costs and alternatives while the reflex ordering is still in place means the pondering never finishes and the reflex wins by default. The point of the order is to make each reintroduction pay for itself rather than inherit its place.
This PR is partway through phase 1. It should not merge until phase 1 is complete, and phase 2 is a separate discussion.
Phase 1 so far — 124 ordered-collection sites down to 94
Converted to hash collections:
seen,visited,taken,pin_set,folded,internal_set. Nothing iterates them.Two sorts dropped:
The Verilog UDP table rows. A UDP table is a truth table; its rows carry no order between them. The emitted line multiset is unchanged — only the row order moves:
The seed ranking's final minterm tie-break, which sat after the two real ranking criteria purely to settle ties that need no settling.
Phase 1 remaining — the 94
These need judgement rather than mechanical replacement:
statetable.rsrow order — Liberty matches statetable rows first-to-last, so this may be genuinely load-bearing rather than reflex. An external format demanding an order survives phase 1 by definition.confluence.rsstable_set— collected into aVeccompared for equality when merging oscillation records; an arbitrary order could make equal sets compare unequal. That would be an algorithmic need, not determinism, but it is unconfirmed.edge.rs(34 sites), inside the classification passes.model.rsvars,minimise.rspurged/outputs), whose consumers may iterate them into output.One thing for the phase-2 discussion
GUIDELINES.mdin this PR states the rule absolutely — "determinism is not a goal … it is worth nothing here, so it loses every trade it is offered". That is stronger than the position above, which is that the question is open and being answered strip-first. If phase 2 finds cases worth keeping, that wording needs revisiting along with them.Verification
cargo fmt --all --check,cargo clippy --all-targets --locked -- -D warnings,cargo build --all-targets --lockedandcargo test --locked(343 + 13 + 21) clean at every step of the sweep. Arc and leakage record counts unchanged throughout.