Skip to content

perf: seed symmetry colour refinement by survivors on wide-sparse domains#959

Merged
rasros merged 1 commit into
mainfrom
perf/symmetry-domain-seed
Jul 4, 2026
Merged

perf: seed symmetry colour refinement by survivors on wide-sparse domains#959
rasros merged 1 commit into
mainfrom
perf/symmetry-domain-seed

Conversation

@rasros

@rasros rasros commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Advances #938 (the liner-sf half).

What changed

  • Seed the symmetry pass's Weisfeiler–Leman colour refinement (domainSeed) from a variable's survivors rather than its holes when the domain is sparser than dense.

Why

domainSeed fingerprinted each integer variable by enumerating its domain holes, building an O(span) LongArray key. On liner-sf-repositioning — domains spanning up to 20M for a handful of live values — that key is tens of millions of words, and every RefineKey hash/compare across the refinement rounds then costs O(span). BREAK_SYMMETRIES alone took 741ms of liner-sf's 800ms presolve (and it finds no symmetry to break). Fingerprinting by whichever of holes or survivors is smaller drops liner-sf presolve to ~175ms — the liner-sf goal in #938, though the bottleneck was the symmetry colour seed rather than Element GAC as the issue hypothesized. 2DBinPacking is untouched, so #938 stays open.

The two seed forms carry a distinct marker word, and within a form equal domains yield equal keys and distinct domains distinct keys, so the colour partition — and every generator found — is identical.

Testing

  • Byte-identical presolve oracle (dry-run-presolve, budget=0) across all 130 mzn-bench instances.
  • Bench-parity solve on the budget-truncated instances: ma-path-finding and oocsp prove the identical optimum with identical assignments; no wrong-optimum.

@rasros rasros merged commit aa3be85 into main Jul 4, 2026
2 checks passed
@rasros rasros deleted the perf/symmetry-domain-seed branch July 4, 2026 04:58
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